forked from jaildesigner-jailgames/jaildoctors_dilemma
Sustituyendo todos los defines de const.h
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
#include "const.h"
|
||||
|
||||
#include "animatedsprite.h"
|
||||
|
||||
// Constructor
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#include "const.h"
|
||||
|
||||
#include "utils.h"
|
||||
#include "director.h"
|
||||
#include <iostream>
|
||||
@@ -41,10 +41,6 @@ Director::Director(std::string path)
|
||||
// Inicializa JailAudio
|
||||
initJailAudio();
|
||||
|
||||
// Aplica las opciones
|
||||
SDL_SetWindowFullscreen(window, options->fullScreenMode);
|
||||
SDL_SetWindowSize(window, SCREEN_WIDTH * options->windowSize, SCREEN_HEIGHT * options->windowSize);
|
||||
|
||||
// Inicializa el resto de variables
|
||||
init(section);
|
||||
}
|
||||
@@ -122,7 +118,7 @@ bool Director::initSDL()
|
||||
}
|
||||
|
||||
// Crea la ventana
|
||||
window = SDL_CreateWindow(WINDOW_CAPTION, SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, VIEW_WIDTH, VIEW_HEIGHT, SDL_WINDOW_SHOWN | SDL_WINDOW_ALLOW_HIGHDPI);
|
||||
window = SDL_CreateWindow(WINDOW_CAPTION, SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, options->screenWidth, options->screenHeight, SDL_WINDOW_SHOWN | SDL_WINDOW_ALLOW_HIGHDPI);
|
||||
if (window == NULL)
|
||||
{
|
||||
printf("Window could not be created!\nSDL Error: %s\n", SDL_GetError());
|
||||
@@ -147,7 +143,7 @@ bool Director::initSDL()
|
||||
SDL_SetRenderDrawColor(renderer, 0x00, 0x00, 0x00, 0xFF);
|
||||
|
||||
// Establece el tamaño del buffer de renderizado
|
||||
SDL_RenderSetLogicalSize(renderer, SCREEN_WIDTH, SCREEN_HEIGHT);
|
||||
SDL_RenderSetLogicalSize(renderer, options->screenWidth, options->screenHeight);
|
||||
|
||||
// Establece el modo de mezcla
|
||||
SDL_SetRenderDrawBlendMode(renderer, SDL_BLENDMODE_BLEND);
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
#include "movingsprite.h"
|
||||
#include "text.h"
|
||||
#include "menu.h"
|
||||
#include "const.h"
|
||||
|
||||
#include "jail_audio.h"
|
||||
#include "utils.h"
|
||||
#include "input.h"
|
||||
@@ -15,8 +15,8 @@
|
||||
#define DIRECTOR_H
|
||||
|
||||
#define WINDOW_CAPTION "JailDoctor's Dilemma"
|
||||
#define GAME_WIDTH 320
|
||||
#define GAME_HEIGHT 240
|
||||
#define GAME_WIDTH 256
|
||||
#define GAME_HEIGHT 192
|
||||
|
||||
// Director
|
||||
class Director
|
||||
|
||||
@@ -5,7 +5,7 @@ Game::Game(SDL_Renderer *renderer, Screen *screen, Asset *asset, Input *input)
|
||||
{
|
||||
// Inicia variables
|
||||
currentRoom = "01.room";
|
||||
spawnPoint = {2 * BLOCK, 12 * BLOCK, 0, 0, 0, STATUS_STANDING, SDL_FLIP_NONE};
|
||||
spawnPoint = {2 * 8, 12 * 8, 0, 0, 0, STATUS_STANDING, SDL_FLIP_NONE};
|
||||
debug = false;
|
||||
|
||||
// Copia los punteros
|
||||
@@ -26,7 +26,7 @@ Game::Game(SDL_Renderer *renderer, Screen *screen, Asset *asset, Input *input)
|
||||
ticksSpeed = 15;
|
||||
|
||||
section.name = SECTION_PROG_GAME;
|
||||
section.subsection = SECTION_GAME_PLAY;
|
||||
section.subsection = SUBSECTION_GAME_PLAY;
|
||||
}
|
||||
|
||||
Game::~Game()
|
||||
@@ -62,7 +62,7 @@ section_t Game::run()
|
||||
while (section.name == SECTION_PROG_GAME)
|
||||
{
|
||||
// Sección juego jugando
|
||||
if (section.subsection == SECTION_GAME_PLAY)
|
||||
if (section.subsection == SUBSECTION_GAME_PLAY)
|
||||
{
|
||||
update();
|
||||
render();
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#pragma once
|
||||
#include <SDL2/SDL.h>
|
||||
#include "const.h"
|
||||
|
||||
#include "utils.h"
|
||||
#include "sprite.h"
|
||||
#include "movingsprite.h"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#include "const.h"
|
||||
|
||||
#include "ltexture.h"
|
||||
#define STB_IMAGE_IMPLEMENTATION
|
||||
#include "stb_image.h"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#include "const.h"
|
||||
|
||||
#include "menu.h"
|
||||
|
||||
// Constructor
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#include "const.h"
|
||||
|
||||
#include "movingsprite.h"
|
||||
|
||||
// Constructor
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#pragma once
|
||||
#include <SDL2/SDL.h>
|
||||
#include "const.h"
|
||||
|
||||
#include "utils.h"
|
||||
#include "asset.h"
|
||||
#include "room.h"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#pragma once
|
||||
#include <SDL2/SDL.h>
|
||||
#include "const.h"
|
||||
|
||||
#include "utils.h"
|
||||
#include "asset.h"
|
||||
#include "enemy.h"
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
#include "screen.h"
|
||||
#include "const.h"
|
||||
#include <string>
|
||||
#include <stdio.h>
|
||||
|
||||
@@ -11,8 +10,8 @@ Screen::Screen(SDL_Window *window, SDL_Renderer *renderer, options_t *options)
|
||||
this->renderer = renderer;
|
||||
this->options = options;
|
||||
|
||||
gameCanvasWidth = SCREEN_WIDTH;
|
||||
gameCanvasHeight = SCREEN_HEIGHT;
|
||||
gameCanvasWidth = 256;
|
||||
gameCanvasHeight = 192;
|
||||
|
||||
// Establece el modo de video
|
||||
setVideoMode(options->fullScreenMode);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#include "const.h"
|
||||
|
||||
#include "text.h"
|
||||
#include <iostream>
|
||||
#include <fstream>
|
||||
|
||||
Reference in New Issue
Block a user