Compare commits
6 Commits
v1.0
...
9c10b6a372
| Author | SHA1 | Date | |
|---|---|---|---|
| 9c10b6a372 | |||
| 31f63516ca | |||
| b5f4425672 | |||
| 51eb933383 | |||
| 3f127b5444 | |||
| 2055ac523d |
BIN
data/fosforo.gif
Normal file
BIN
data/fosforo.gif
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 148 B |
@@ -9,6 +9,7 @@ end2.gif
|
|||||||
floor.gif
|
floor.gif
|
||||||
font.gif
|
font.gif
|
||||||
font2.gif
|
font2.gif
|
||||||
|
fosforo.gif
|
||||||
gat.gif
|
gat.gif
|
||||||
gat2.gif
|
gat2.gif
|
||||||
intro1.gif
|
intro1.gif
|
||||||
|
|||||||
@@ -2435,13 +2435,13 @@ namespace actor
|
|||||||
int partsCollected = 0;
|
int partsCollected = 0;
|
||||||
bool roomVisited[MAX_ROOMS];
|
bool roomVisited[MAX_ROOMS];
|
||||||
int livesLost = 0;
|
int livesLost = 0;
|
||||||
int catsLifeOdds = 5;
|
int catsLifeOdds = 2;
|
||||||
uint32_t start_time = 0;
|
uint32_t start_time = 0;
|
||||||
|
|
||||||
void reset()
|
void reset()
|
||||||
{
|
{
|
||||||
partsCollected = livesLost = 0;
|
partsCollected = livesLost = 0;
|
||||||
catsLifeOdds = 5;
|
catsLifeOdds = 2;
|
||||||
for (int i = 0; i < MAX_ROOMS; ++i)
|
for (int i = 0; i < MAX_ROOMS; ++i)
|
||||||
roomVisited[i] = false;
|
roomVisited[i] = false;
|
||||||
start_time = SDL_GetTicks();
|
start_time = SDL_GetTicks();
|
||||||
|
|||||||
105
source/jdraw.cpp
105
source/jdraw.cpp
@@ -15,11 +15,15 @@ namespace draw
|
|||||||
SDL_Renderer *sdl_renderer = nullptr; // El renderer de SDL
|
SDL_Renderer *sdl_renderer = nullptr; // El renderer de SDL
|
||||||
SDL_Texture *sdl_texture = nullptr; // La textura de SDL a la que pintarem la nostra superficie "screen" i que despres volcarem a pantalla
|
SDL_Texture *sdl_texture = nullptr; // La textura de SDL a la que pintarem la nostra superficie "screen" i que despres volcarem a pantalla
|
||||||
|
|
||||||
|
SDL_Rect dest_rect = {0, 0, 320, 240};
|
||||||
|
static int fullscreen_scale = 1;
|
||||||
|
|
||||||
static int screen_zoom = 1;
|
static int screen_zoom = 1;
|
||||||
static bool screen_fullscreen = false;
|
static bool screen_fullscreen = false;
|
||||||
static int screen_width = 320;
|
static int screen_width = 320;
|
||||||
static int screen_height = 240;
|
static int screen_height = 240;
|
||||||
std::string screen_title = "";
|
std::string screen_title = "";
|
||||||
|
static int screen_mode = SCREEN_MODE_NORMAL;
|
||||||
|
|
||||||
surface *screen = nullptr; // La superficie screen, que representa la pantalla. Se crea i destrueix internament
|
surface *screen = nullptr; // La superficie screen, que representa la pantalla. Se crea i destrueix internament
|
||||||
surface *destination = nullptr; // Punter a la actual superficie de destí
|
surface *destination = nullptr; // Punter a la actual superficie de destí
|
||||||
@@ -89,8 +93,39 @@ namespace draw
|
|||||||
sdl_renderer = SDL_CreateRenderer(sdl_window, -1, 0);
|
sdl_renderer = SDL_CreateRenderer(sdl_window, -1, 0);
|
||||||
sdl_texture = SDL_CreateTexture(sdl_renderer, SDL_PIXELFORMAT_ARGB8888, SDL_TEXTUREACCESS_STREAMING, screen_width, screen_height);
|
sdl_texture = SDL_CreateTexture(sdl_renderer, SDL_PIXELFORMAT_ARGB8888, SDL_TEXTUREACCESS_STREAMING, screen_width, screen_height);
|
||||||
|
|
||||||
|
SDL_RendererInfo info;
|
||||||
|
const int num_render_drivers = SDL_GetNumRenderDrivers();
|
||||||
|
printf("Available renderers:\n");
|
||||||
|
for (int i=0; i<num_render_drivers; ++i)
|
||||||
|
{
|
||||||
|
SDL_GetRenderDriverInfo(i, &info);
|
||||||
|
printf(" - %i: %s\n", i, info.name);
|
||||||
|
}
|
||||||
|
|
||||||
|
SDL_GetRendererInfo(sdl_renderer, &info);
|
||||||
|
printf("\nRenderer: %s\n", info.name);
|
||||||
|
|
||||||
|
SDL_ShowCursor(false);
|
||||||
|
|
||||||
|
if (screen_fullscreen)
|
||||||
|
{
|
||||||
|
int w, h;
|
||||||
|
SDL_GetWindowSize(sdl_window, &w, &h);
|
||||||
|
fullscreen_scale = h/screen_height;
|
||||||
|
dest_rect.w = screen_width * fullscreen_scale;
|
||||||
|
dest_rect.h = screen_height * fullscreen_scale;
|
||||||
|
dest_rect.x = (w - dest_rect.w)/2;
|
||||||
|
dest_rect.y = (h - dest_rect.h)/2;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
dest_rect.x = dest_rect.y = 0;
|
||||||
|
dest_rect.w = screen_width * zoom;
|
||||||
|
dest_rect.h = screen_height * zoom;
|
||||||
|
}
|
||||||
|
|
||||||
// Establim el tamany "logic", indepndent del tamany de finestra
|
// Establim el tamany "logic", indepndent del tamany de finestra
|
||||||
SDL_RenderSetLogicalSize(sdl_renderer, width, height);
|
//SDL_RenderSetLogicalSize(sdl_renderer, width, height);
|
||||||
|
|
||||||
// Creem la superficie "screen" i la establim com a superficie destinació
|
// Creem la superficie "screen" i la establim com a superficie destinació
|
||||||
screen = createSurface(width, height);
|
screen = createSurface(width, height);
|
||||||
@@ -152,8 +187,27 @@ namespace draw
|
|||||||
sdl_renderer = SDL_CreateRenderer(sdl_window, -1, 0);
|
sdl_renderer = SDL_CreateRenderer(sdl_window, -1, 0);
|
||||||
sdl_texture = SDL_CreateTexture(sdl_renderer, SDL_PIXELFORMAT_ARGB8888, SDL_TEXTUREACCESS_STREAMING, screen_width, screen_height);
|
sdl_texture = SDL_CreateTexture(sdl_renderer, SDL_PIXELFORMAT_ARGB8888, SDL_TEXTUREACCESS_STREAMING, screen_width, screen_height);
|
||||||
|
|
||||||
|
SDL_ShowCursor(false);
|
||||||
|
|
||||||
|
if (screen_fullscreen)
|
||||||
|
{
|
||||||
|
int w, h;
|
||||||
|
SDL_GetWindowSize(sdl_window, &w, &h);
|
||||||
|
fullscreen_scale = h/screen_height;
|
||||||
|
dest_rect.w = screen_width * fullscreen_scale;
|
||||||
|
dest_rect.h = screen_height * fullscreen_scale;
|
||||||
|
dest_rect.x = (w - dest_rect.w)/2;
|
||||||
|
dest_rect.y = (h - dest_rect.h)/2;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
dest_rect.x = dest_rect.y = 0;
|
||||||
|
dest_rect.w = screen_width * zoom;
|
||||||
|
dest_rect.h = screen_height * zoom;
|
||||||
|
}
|
||||||
|
|
||||||
// Establim el tamany "logic", indepndent del tamany de finestra
|
// Establim el tamany "logic", indepndent del tamany de finestra
|
||||||
SDL_RenderSetLogicalSize(sdl_renderer, screen_width, screen_height);
|
//SDL_RenderSetLogicalSize(sdl_renderer, screen_width, screen_height);
|
||||||
}
|
}
|
||||||
|
|
||||||
void setZoom(const int value)
|
void setZoom(const int value)
|
||||||
@@ -203,6 +257,23 @@ namespace draw
|
|||||||
return screen_zoom;
|
return screen_zoom;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void toggleScreenMode()
|
||||||
|
{
|
||||||
|
screen_mode++;
|
||||||
|
if (screen_mode == SCREEN_MODE_NUM_MODES) screen_mode = 0;
|
||||||
|
//reinit();
|
||||||
|
}
|
||||||
|
|
||||||
|
void setScreenMode(const int value)
|
||||||
|
{
|
||||||
|
screen_mode = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
const int getScreenMode()
|
||||||
|
{
|
||||||
|
return screen_mode;
|
||||||
|
}
|
||||||
|
|
||||||
// Crea una superficie i torna un punter a ella
|
// Crea una superficie i torna un punter a ella
|
||||||
surface *createSurface(const uint16_t w, const uint16_t h)
|
surface *createSurface(const uint16_t w, const uint16_t h)
|
||||||
{
|
{
|
||||||
@@ -629,9 +700,35 @@ namespace draw
|
|||||||
// Desbloquejem la textura
|
// Desbloquejem la textura
|
||||||
SDL_UnlockTexture(sdl_texture);
|
SDL_UnlockTexture(sdl_texture);
|
||||||
|
|
||||||
// Pintem la textura a pantalla
|
if (screen_fullscreen)
|
||||||
SDL_RenderCopy(sdl_renderer, sdl_texture, NULL, NULL);
|
{
|
||||||
|
SDL_SetRenderDrawColor(sdl_renderer, 0, 0, 0, 255);
|
||||||
|
SDL_RenderClear(sdl_renderer);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Pintem la textura a pantalla
|
||||||
|
SDL_RenderCopy(sdl_renderer, sdl_texture, NULL, &dest_rect);
|
||||||
|
|
||||||
|
if (screen_mode & SCREEN_MODE_SCANLINES)
|
||||||
|
{
|
||||||
|
if (screen_zoom>=3 || screen_fullscreen)
|
||||||
|
{
|
||||||
|
int zoom = screen_fullscreen ? fullscreen_scale : screen_zoom;
|
||||||
|
SDL_SetRenderDrawBlendMode(sdl_renderer, SDL_BLENDMODE_BLEND);
|
||||||
|
for (int y=0; y<screen_height; ++y)
|
||||||
|
{
|
||||||
|
SDL_SetRenderDrawColor(sdl_renderer, 0, 0, 0, 192);
|
||||||
|
SDL_RenderDrawLine(sdl_renderer, dest_rect.x, dest_rect.y + y*zoom, dest_rect.x + dest_rect.w, dest_rect.y + y*zoom);
|
||||||
|
SDL_SetRenderDrawColor(sdl_renderer, 0, 0, 0, 96);
|
||||||
|
if (zoom>3) SDL_RenderDrawLine(sdl_renderer, dest_rect.x, 1+dest_rect.y + y*zoom, dest_rect.x + dest_rect.w, 1+dest_rect.y + y*zoom);
|
||||||
|
}
|
||||||
|
SDL_SetRenderDrawColor(sdl_renderer, 0, 0, 0, 16);
|
||||||
|
for (int x=0; x<screen_width; ++x)
|
||||||
|
{
|
||||||
|
SDL_RenderDrawLine(sdl_renderer, dest_rect.x + x*zoom, dest_rect.y, dest_rect.x + x*zoom, dest_rect.y + dest_rect.h);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
// I ho presentem
|
// I ho presentem
|
||||||
SDL_RenderPresent(sdl_renderer);
|
SDL_RenderPresent(sdl_renderer);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,6 +13,12 @@
|
|||||||
#define FONT_ZOOM_HORIZONTAL 2
|
#define FONT_ZOOM_HORIZONTAL 2
|
||||||
#define FONT_ZOOM_BOTH 3
|
#define FONT_ZOOM_BOTH 3
|
||||||
|
|
||||||
|
#define SCREEN_MODE_NORMAL 0
|
||||||
|
#define SCREEN_MODE_SCANLINES 1
|
||||||
|
#define SCREEN_MODE_FOSFORO 2
|
||||||
|
#define SCREEN_MODE_SCANFOS 3
|
||||||
|
#define SCREEN_MODE_NUM_MODES 4
|
||||||
|
|
||||||
// Unitat per a la gestió dels recursos gràfics i dibuixat en pantalla
|
// Unitat per a la gestió dels recursos gràfics i dibuixat en pantalla
|
||||||
namespace draw
|
namespace draw
|
||||||
{
|
{
|
||||||
@@ -44,6 +50,10 @@ namespace draw
|
|||||||
const bool getFullscreen();
|
const bool getFullscreen();
|
||||||
const int getZoom();
|
const int getZoom();
|
||||||
|
|
||||||
|
void toggleScreenMode();
|
||||||
|
void setScreenMode(const int value);
|
||||||
|
const int getScreenMode();
|
||||||
|
|
||||||
/// @brief Crea una superficie i torna un punter a ella
|
/// @brief Crea una superficie i torna un punter a ella
|
||||||
/// @param w ample de la superficie
|
/// @param w ample de la superficie
|
||||||
/// @param h alt de la superficie
|
/// @param h alt de la superficie
|
||||||
|
|||||||
@@ -341,7 +341,19 @@ namespace file
|
|||||||
#elif __linux__
|
#elif __linux__
|
||||||
struct passwd *pw = getpwuid(getuid());
|
struct passwd *pw = getpwuid(getuid());
|
||||||
const char *homedir = pw->pw_dir;
|
const char *homedir = pw->pw_dir;
|
||||||
config_folder = std::string(homedir) + "/." + foldername;
|
config_folder = std::string(homedir) + "/.config/" + foldername;
|
||||||
|
|
||||||
|
{
|
||||||
|
// Intenta crear ".config", per si no existeix
|
||||||
|
std::string config_base_folder = std::string(homedir) + "/.config";
|
||||||
|
int ret = mkdir(config_base_folder.c_str(), S_IRWXU);
|
||||||
|
if (ret == -1 && errno != EEXIST)
|
||||||
|
{
|
||||||
|
printf("ERROR CREATING CONFIG BASE FOLDER.");
|
||||||
|
exit(EXIT_FAILURE);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
struct stat st = {0};
|
struct stat st = {0};
|
||||||
|
|||||||
@@ -17,12 +17,15 @@ namespace modules
|
|||||||
void init()
|
void init()
|
||||||
{
|
{
|
||||||
audio::playMusic("mus_gameover.ogg", 0);
|
audio::playMusic("mus_gameover.ogg", 0);
|
||||||
if (gat == nullptr) gat = actor::createFromTemplate("GAT-NEGRE");
|
gat = actor::createFromTemplate("GAT-NEGRE");
|
||||||
}
|
}
|
||||||
|
|
||||||
bool loop()
|
bool loop()
|
||||||
{
|
{
|
||||||
if (controller::pressed(KEY_JUMP) || controller::pressed(KEY_PICK)) {
|
if (controller::pressed(KEY_JUMP) || controller::pressed(KEY_PICK))
|
||||||
|
{
|
||||||
|
if (gat) actor::remove(gat);
|
||||||
|
gat = nullptr;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -296,6 +296,7 @@ namespace modules
|
|||||||
if ( (controller::pressed(KEY_MENU)) || (controller::pressed(KEY_PICK)) || (controller::pressed(KEY_JUMP)) )
|
if ( (controller::pressed(KEY_MENU)) || (controller::pressed(KEY_PICK)) || (controller::pressed(KEY_JUMP)) )
|
||||||
{
|
{
|
||||||
missatge[0] = 0;
|
missatge[0] = 0;
|
||||||
|
audio::resumeMusic();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
draw::color(BLACK);
|
draw::color(BLACK);
|
||||||
@@ -989,6 +990,8 @@ namespace modules
|
|||||||
|
|
||||||
void setMissatge(const char *text)
|
void setMissatge(const char *text)
|
||||||
{
|
{
|
||||||
|
actor::pauseWalkSound();
|
||||||
|
audio::pauseMusic();
|
||||||
strcpy(missatge, text);
|
strcpy(missatge, text);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -19,7 +19,6 @@ namespace modules
|
|||||||
{
|
{
|
||||||
if (audio::getCurrentMusic() != "mus_gameover.ogg") audio::playMusic("mus_gameover.ogg", 0);
|
if (audio::getCurrentMusic() != "mus_gameover.ogg") audio::playMusic("mus_gameover.ogg", 0);
|
||||||
|
|
||||||
if (heroi) actor::remove(heroi);
|
|
||||||
if (actor::hero::isPrologo()) {
|
if (actor::hero::isPrologo()) {
|
||||||
heroi = actor::create("HERO", {16, 32, 0}, {6, 6, 8}, "gat.gif", {0, 0, 24, 28}, {-4, 32});
|
heroi = actor::create("HERO", {16, 32, 0}, {6, 6, 8}, "gat.gif", {0, 0, 24, 28}, {-4, 32});
|
||||||
} else {
|
} else {
|
||||||
@@ -43,7 +42,12 @@ namespace modules
|
|||||||
|
|
||||||
bool loop()
|
bool loop()
|
||||||
{
|
{
|
||||||
if (controller::pressed(KEY_JUMP) || controller::pressed(KEY_PICK)) { return false; }
|
if (controller::pressed(KEY_JUMP) || controller::pressed(KEY_PICK))
|
||||||
|
{
|
||||||
|
if (heroi) actor::remove(heroi);
|
||||||
|
heroi = nullptr;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
draw::cls(2);
|
draw::cls(2);
|
||||||
draw::color(1);
|
draw::color(1);
|
||||||
|
|||||||
@@ -76,9 +76,17 @@ namespace modules
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void cleanup()
|
||||||
|
{
|
||||||
|
for (int i=0; i<6; ++i) { actor::remove(parts[i]); parts[i]=nullptr;}
|
||||||
|
actor::remove(anbernic); anbernic=nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
int loop()
|
int loop()
|
||||||
{
|
{
|
||||||
if (controller::pressed(KEY_MENU)) {
|
if (controller::pressed(KEY_MENU))
|
||||||
|
{
|
||||||
|
cleanup();
|
||||||
return INGAME_CONTINUAR;
|
return INGAME_CONTINUAR;
|
||||||
}
|
}
|
||||||
if (controller::pressed(KEY_DOWN) || input::keyPressed(SDL_SCANCODE_DOWN))
|
if (controller::pressed(KEY_DOWN) || input::keyPressed(SDL_SCANCODE_DOWN))
|
||||||
@@ -94,11 +102,7 @@ namespace modules
|
|||||||
if (controller::pressed(KEY_JUMP) || controller::pressed(KEY_PICK) || input::keyPressed(SDL_SCANCODE_RETURN))
|
if (controller::pressed(KEY_JUMP) || controller::pressed(KEY_PICK) || input::keyPressed(SDL_SCANCODE_RETURN))
|
||||||
{
|
{
|
||||||
audio::playSound("snd_push.wav", SOUND_BASIC);
|
audio::playSound("snd_push.wav", SOUND_BASIC);
|
||||||
if (selected_option==INGAME_EIXIR)
|
cleanup();
|
||||||
{
|
|
||||||
for (int i=0; i<6; ++i) { actor::remove(parts[i]); parts[i]=nullptr;}
|
|
||||||
actor::remove(anbernic); anbernic=nullptr;
|
|
||||||
}
|
|
||||||
return selected_option;
|
return selected_option;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ namespace modules
|
|||||||
void init()
|
void init()
|
||||||
{
|
{
|
||||||
srand(SDL_GetTicks());
|
srand(SDL_GetTicks());
|
||||||
anys = draw::getSurface("25anys.gif");
|
anys = draw::getSurface("25anys.gif"); // getSurface() no crea res, així que no fa falta destruir ni fer res al eixir
|
||||||
num_pixels = 0;
|
num_pixels = 0;
|
||||||
draw::surface *surf = draw::getSurface("jailgames.gif");
|
draw::surface *surf = draw::getSurface("jailgames.gif");
|
||||||
for (int y=0; y<surf->h; ++y)
|
for (int y=0; y<surf->h; ++y)
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ namespace modules
|
|||||||
if (audio::getCurrentMusic() != "mus_menu.ogg") audio::playMusic("mus_menu.ogg");
|
if (audio::getCurrentMusic() != "mus_menu.ogg") audio::playMusic("mus_menu.ogg");
|
||||||
selected_option = OPTION_JUGAR;
|
selected_option = OPTION_JUGAR;
|
||||||
::game::setUpdateTicks(64);
|
::game::setUpdateTicks(64);
|
||||||
draw::loadPalette("test.gif");
|
//draw::loadPalette("test.gif");
|
||||||
surf = draw::getSurface("test.gif");
|
surf = draw::getSurface("test.gif");
|
||||||
draw::restorecol(2);
|
draw::restorecol(2);
|
||||||
if (config::isProgoloDesbloquejat()) min_option=0;
|
if (config::isProgoloDesbloquejat()) min_option=0;
|
||||||
|
|||||||
@@ -76,6 +76,15 @@ void loadConfig()
|
|||||||
std::string txt_fullscreen = file::getConfigValue("fullscreen");
|
std::string txt_fullscreen = file::getConfigValue("fullscreen");
|
||||||
if (txt_fullscreen=="yes") fullscreen = true;
|
if (txt_fullscreen=="yes") fullscreen = true;
|
||||||
|
|
||||||
|
int screen_mode = SCREEN_MODE_NORMAL;
|
||||||
|
std::string txt_fosforo = file::getConfigValue("fosforo");
|
||||||
|
if (txt_fosforo=="yes") screen_mode |= SCREEN_MODE_FOSFORO;
|
||||||
|
|
||||||
|
std::string txt_scanlines = file::getConfigValue("scanlines");
|
||||||
|
if (txt_scanlines=="yes") screen_mode |= SCREEN_MODE_SCANLINES;
|
||||||
|
|
||||||
|
draw::setScreenMode(screen_mode);
|
||||||
|
|
||||||
static const char* nomtecles[6] = {"keyup", "keydown", "keyleft", "keyright", "keyjump", "keypick"};
|
static const char* nomtecles[6] = {"keyup", "keydown", "keyleft", "keyright", "keyjump", "keypick"};
|
||||||
for (int i=0; i<6; ++i)
|
for (int i=0; i<6; ++i)
|
||||||
{
|
{
|
||||||
@@ -95,9 +104,10 @@ void game::init()
|
|||||||
{
|
{
|
||||||
if (game::getParams(1) && strcmp(game::getParams(1), "editor")==0) editor::setDevMode();
|
if (game::getParams(1) && strcmp(game::getParams(1), "editor")==0) editor::setDevMode();
|
||||||
|
|
||||||
if (editor::isDevMode())
|
if (editor::isDevMode()) {
|
||||||
draw::init("The Pool", 520, 240, zoom);
|
draw::init("The Pool", 520, 240, zoom);
|
||||||
else {
|
SDL_ShowCursor(true);
|
||||||
|
} else {
|
||||||
loadConfig();
|
loadConfig();
|
||||||
draw::init("The Pool", 320, 240, zoom, fullscreen);
|
draw::init("The Pool", 320, 240, zoom, fullscreen);
|
||||||
console::init();
|
console::init();
|
||||||
@@ -112,7 +122,11 @@ void game::init()
|
|||||||
audio::loadSound("snd_boost.wav");
|
audio::loadSound("snd_boost.wav");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (draw::getScreenMode()&SCREEN_MODE_FOSFORO) {
|
||||||
|
draw::loadPalette("fosforo.gif");
|
||||||
|
} else {
|
||||||
draw::loadPalette("test.gif");
|
draw::loadPalette("test.gif");
|
||||||
|
}
|
||||||
|
|
||||||
if (editor::isDevMode()) {
|
if (editor::isDevMode()) {
|
||||||
current_module = M_GAME;
|
current_module = M_GAME;
|
||||||
@@ -139,6 +153,19 @@ bool game::loop()
|
|||||||
fullscreen = draw::getFullscreen();
|
fullscreen = draw::getFullscreen();
|
||||||
file::setConfigValue("fullscreen", fullscreen?"yes":"no");
|
file::setConfigValue("fullscreen", fullscreen?"yes":"no");
|
||||||
}
|
}
|
||||||
|
if (input::keyPressed(SDL_SCANCODE_F4)) {
|
||||||
|
draw::toggleScreenMode();
|
||||||
|
const int mode = draw::getScreenMode();
|
||||||
|
|
||||||
|
if (mode&SCREEN_MODE_FOSFORO) {
|
||||||
|
draw::loadPalette("fosforo.gif");
|
||||||
|
} else {
|
||||||
|
draw::loadPalette("test.gif");
|
||||||
|
}
|
||||||
|
|
||||||
|
file::setConfigValue("fosforo", mode&SCREEN_MODE_FOSFORO?"yes":"no");
|
||||||
|
file::setConfigValue("scanlines", mode&SCREEN_MODE_SCANLINES?"yes":"no");
|
||||||
|
}
|
||||||
|
|
||||||
if (input::keyPressed(SDL_SCANCODE_F12)) {
|
if (input::keyPressed(SDL_SCANCODE_F12)) {
|
||||||
draw::reloadAll();
|
draw::reloadAll();
|
||||||
|
|||||||
Reference in New Issue
Block a user