forked from jaildesigner-jailgames/jaildoctors_dilemma
Añadidos parametros al programa
This commit is contained in:
@@ -110,7 +110,9 @@ room_t loadRoomFile(std::string file_path)
|
||||
// Procesa las dos subcadenas
|
||||
if (!setItem(&item, line.substr(0, pos), line.substr(pos + 1, line.length())))
|
||||
{
|
||||
std::cout << "Warning: file " << filename.c_str() << "\n, unknown parameter \"" << line.substr(0, pos).c_str() << "\"" << std::endl;
|
||||
{
|
||||
std::cout << "Warning: file " << filename.c_str() << "\n, unknown parameter \"" << line.substr(0, pos).c_str() << "\"" << std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
} while (line != "[/item]");
|
||||
@@ -127,19 +129,25 @@ room_t loadRoomFile(std::string file_path)
|
||||
// Procesa las dos subcadenas
|
||||
if (!setVars(&room, line.substr(0, pos), line.substr(pos + 1, line.length())))
|
||||
{
|
||||
std::cout << "Warning: file " << filename.c_str() << "\n, unknown parameter \"" << line.substr(0, pos).c_str() << "\"" << std::endl;
|
||||
{
|
||||
std::cout << "Warning: file " << filename.c_str() << "\n, unknown parameter \"" << line.substr(0, pos).c_str() << "\"" << std::endl;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Cierra el fichero
|
||||
std::cout << "Room loaded: " << filename.c_str() << std::endl;
|
||||
{
|
||||
std::cout << "Room loaded: " << filename.c_str() << std::endl;
|
||||
}
|
||||
file.close();
|
||||
}
|
||||
// El fichero no se puede abrir
|
||||
else
|
||||
{
|
||||
std::cout << "Warning: Unable to open " << filename.c_str() << " file" << std::endl;
|
||||
{
|
||||
std::cout << "Warning: Unable to open " << filename.c_str() << " file" << std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
return room;
|
||||
@@ -434,7 +442,10 @@ Room::Room(room_t *room, SDL_Renderer *renderer, Screen *screen, Asset *asset, o
|
||||
mapTexture = SDL_CreateTexture(renderer, SDL_PIXELFORMAT_RGBA8888, SDL_TEXTUREACCESS_TARGET, GAMECANVAS_WIDTH, GAMECANVAS_HEIGHT);
|
||||
if (mapTexture == nullptr)
|
||||
{
|
||||
std::cout << "Error: mapTexture could not be created!\nSDL Error: " << SDL_GetError() << std::endl;
|
||||
if (options->console)
|
||||
{
|
||||
std::cout << "Error: mapTexture could not be created!\nSDL Error: " << SDL_GetError() << std::endl;
|
||||
}
|
||||
}
|
||||
SDL_SetTextureBlendMode(mapTexture, SDL_BLENDMODE_BLEND);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user