Cambiado el tamaño de la textura usado para pintar el mapa
This commit is contained in:
@@ -101,6 +101,7 @@ struct cheat_t
|
|||||||
struct online_t
|
struct online_t
|
||||||
{
|
{
|
||||||
bool enabled; // Indica si se quiere usar el modo online o no
|
bool enabled; // Indica si se quiere usar el modo online o no
|
||||||
|
bool sessionEnabled; // Indica ya se ha hecho login
|
||||||
std::string server; // Servidor para los servicios online
|
std::string server; // Servidor para los servicios online
|
||||||
int port; // Puerto del servidor
|
int port; // Puerto del servidor
|
||||||
std::string gameID; // Identificador del juego para los servicios online
|
std::string gameID; // Identificador del juego para los servicios online
|
||||||
|
|||||||
@@ -144,6 +144,7 @@ void Director::initOptions()
|
|||||||
|
|
||||||
// Opciones online
|
// Opciones online
|
||||||
options->online.enabled = true;
|
options->online.enabled = true;
|
||||||
|
options->online.sessionEnabled = false;
|
||||||
options->online.server = "jaildoctor.duckdns.org";
|
options->online.server = "jaildoctor.duckdns.org";
|
||||||
options->online.port = 9911;
|
options->online.port = 9911;
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
|
|||||||
@@ -281,6 +281,11 @@ void EnterID::switchPalette()
|
|||||||
// Inicializa los servicios online
|
// Inicializa los servicios online
|
||||||
void EnterID::initOnline()
|
void EnterID::initOnline()
|
||||||
{
|
{
|
||||||
|
if (options->online.sessionEnabled)
|
||||||
|
{ // Si ya ha iniciado la sesión, que no continue
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (options->online.jailerID == "")
|
if (options->online.jailerID == "")
|
||||||
{ // Jailer ID no definido
|
{ // Jailer ID no definido
|
||||||
|
|
||||||
@@ -289,10 +294,14 @@ void EnterID::initOnline()
|
|||||||
else
|
else
|
||||||
{ // Jailer ID iniciado
|
{ // Jailer ID iniciado
|
||||||
|
|
||||||
options->online.enabled = true;
|
options->online.enabled = options->online.sessionEnabled = true;
|
||||||
jscore::init(options->online.server, options->online.port);
|
jscore::init(options->online.server, options->online.port);
|
||||||
|
|
||||||
|
#ifdef DEBUG
|
||||||
|
const std::string caption = options->online.jailerID + " IS LOGGED IN (DEBUG)";
|
||||||
|
#else
|
||||||
const std::string caption = options->online.jailerID + " IS LOGGED IN";
|
const std::string caption = options->online.jailerID + " IS LOGGED IN";
|
||||||
|
#endif
|
||||||
screen->showNotification(caption);
|
screen->showNotification(caption);
|
||||||
if (options->console)
|
if (options->console)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -473,7 +473,7 @@ Room::Room(room_t *room, SDL_Renderer *renderer, Screen *screen, Asset *asset, o
|
|||||||
setAnimatedTiles();
|
setAnimatedTiles();
|
||||||
|
|
||||||
// Crea la textura para el mapa de tiles de la habitación
|
// Crea la textura para el mapa de tiles de la habitación
|
||||||
mapTexture = SDL_CreateTexture(renderer, SDL_PIXELFORMAT_RGBA8888, SDL_TEXTUREACCESS_TARGET, GAMECANVAS_WIDTH, GAMECANVAS_HEIGHT);
|
mapTexture = SDL_CreateTexture(renderer, SDL_PIXELFORMAT_RGBA8888, SDL_TEXTUREACCESS_TARGET, PLAY_AREA_WIDTH, PLAY_AREA_HEIGHT);
|
||||||
if (mapTexture == nullptr)
|
if (mapTexture == nullptr)
|
||||||
{
|
{
|
||||||
if (options->console)
|
if (options->console)
|
||||||
@@ -665,7 +665,8 @@ void Room::fillMapTexture()
|
|||||||
void Room::renderMap()
|
void Room::renderMap()
|
||||||
{
|
{
|
||||||
// Dibuja la textura con el mapa en pantalla
|
// Dibuja la textura con el mapa en pantalla
|
||||||
SDL_RenderCopy(renderer, mapTexture, nullptr, nullptr);
|
static SDL_Rect dest = {0, 0, PLAY_AREA_WIDTH, PLAY_AREA_HEIGHT};
|
||||||
|
SDL_RenderCopy(renderer, mapTexture, nullptr, &dest);
|
||||||
|
|
||||||
// Dibuja los tiles animados
|
// Dibuja los tiles animados
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
|
|||||||
Reference in New Issue
Block a user