Fix a level load bug

This commit is contained in:
Miloslav Číž 2020-10-24 13:46:25 +02:00
parent a03690a326
commit ec91af35ca
4 changed files with 34 additions and 26 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.6 KiB

After

Width:  |  Height:  |  Size: 4.6 KiB

3
game.h
View File

@ -3729,7 +3729,10 @@ void SFG_gameStepMenu()
SFG_game.save[i] = 0;
if (SFG_game.selectedLevel == 0)
{
SFG_currentLevel.levelNumber = 0; // to draw intro, not outro
SFG_setGameState(SFG_GAME_STATE_INTRO);
}
else
SFG_setAndInitLevel(SFG_game.selectedLevel);

View File

@ -1369,7 +1369,7 @@ SFG_PROGRAM_MEMORY SFG_Level SFG_level7 =
13, // doorTextureIndex
4, // floorColor
66, // ceilingColor
{8 , 50, 240}, // player start: x, y, direction
{34, 11, 240}, // player start: x, y, direction
1, // backgroundImage
{ // elements
{SFG_LEVEL_ELEMENT_FINISH, {60,1}},{SFG_LEVEL_ELEMENT_BULLETS, {54,1}},
@ -1438,6 +1438,7 @@ SFG_PROGRAM_MEMORY SFG_Level SFG_level7 =
{SFG_LEVEL_ELEMENT_NONE, {0,0}},{SFG_LEVEL_ELEMENT_NONE, {0,0}}
}, // elements
} // level
;
SFG_PROGRAM_MEMORY SFG_Level SFG_level8 =

View File

@ -36,7 +36,8 @@
// uncomment for perfomance debug
//#define SFG_CPU_LOAD(percent) printf("CPU load: %d%\n",percent);
#ifndef GAME_LQ
#ifndef __EMSCRIPTEN__
#ifndef GAME_LQ
// higher quality
#define SFG_FPS 60
#define SFG_LOG(str) puts(str);
@ -46,7 +47,7 @@
#define SFG_DIMINISH_SPRITES 1
#define SFG_HEADBOB_SHEAR (-1 * SFG_SCREEN_RESOLUTION_Y / 80)
#define SFG_BACKGROUND_BLUR 1
#else
#else
// lower quality
#define SFG_FPS 30
#define SFG_SCREEN_RESOLUTION_X 640
@ -56,8 +57,20 @@
#define SFG_DIMINISH_SPRITES 0
#define SFG_DITHERED_SHADOW 0
#define SFG_BACKGROUND_BLUR 0
#endif
#else
// emscripten
#define SFG_FPS 30
#define SFG_SCREEN_RESOLUTION_X 512
#define SFG_SCREEN_RESOLUTION_Y 320
#define SFG_CAN_EXIT 0
#define SFG_RESOLUTION_SCALEDOWN 2
#define SFG_BACKGROUND_BLUR 0
#include <emscripten.h>
#endif
// #define SFG_SCREEN_RESOLUTION_X 88
// #define SFG_SCREEN_RESOLUTION_Y 110
@ -72,15 +85,6 @@
#define MUSIC_VOLUME 16
#ifdef __EMSCRIPTEN__
#define SFG_FPS 30
#define SFG_SCREEN_RESOLUTION_X 512
#define SFG_SCREEN_RESOLUTION_Y 320
#define SFG_CAN_EXIT 0
#define SFG_RESOLUTION_SCALEDOWN 2
#include <emscripten.h>
#endif
#if !SFG_OS_IS_MALWARE
#include <signal.h>