This commit is contained in:
Miloslav Číž 2020-10-24 19:10:42 +02:00
parent 0002cd8244
commit 3f97ebf518
3 changed files with 14 additions and 12 deletions

10
game.h
View File

@ -984,15 +984,17 @@ void SFG_pixelFunc(RCL_PixelInfo *pixel)
);
#if SFG_BACKGROUND_BLUR != 0
SFG_backgroundBlurIndex = (SFG_backgroundBlurIndex + 1) % 8;
// SFG_backgroundBlurIndex = (SFG_backgroundBlurIndex + 1) % 0x07;
SFG_backgroundBlurIndex = (SFG_backgroundBlurIndex + 1) % 8;
#endif
#else
color = 1;
#endif
}
#if SFG_RAYCASTING_SUBSAMPLE == 1
// the other version will probably get optimized to this, but just in case
SFG_setGamePixel(pixel->position.x,pixel->position.y,color);
#else
RCL_Unit screenX = pixel->position.x * SFG_RAYCASTING_SUBSAMPLE;
for (int_fast8_t i = 0; i < SFG_RAYCASTING_SUBSAMPLE; ++i)
@ -1000,6 +1002,7 @@ SFG_backgroundBlurIndex = (SFG_backgroundBlurIndex + 1) % 8;
SFG_setGamePixel(screenX,pixel->position.y,color);
screenX++;
}
#endif
}
/**
@ -1254,7 +1257,6 @@ RCL_Unit SFG_floorHeightAt(int16_t x, int16_t y)
doorHeight = doorHeight != (0xff & SFG_DOOR_VERTICAL_POSITION_MASK) ?
doorHeight * SFG_DOOR_HEIGHT_STEP : RCL_UNITS_PER_SQUARE;
break;
}
}

View File

@ -155,16 +155,16 @@ static inline SFG_TileDefinition SFG_getMapTile
uint8_t *properties
)
{
if (x < 0 || x >= SFG_MAP_SIZE || y < 0 || y >= SFG_MAP_SIZE)
if (x >= 0 && x < SFG_MAP_SIZE && y >= 0 && y < SFG_MAP_SIZE)
{
*properties = SFG_TILE_PROPERTY_NORMAL;
return SFG_OUTSIDE_TILE;
}
uint8_t tile = level->mapArray[y * SFG_MAP_SIZE + x];
*properties = tile & 0xc0;
return level->tileDictionary[tile & 0x3f];
}
*properties = SFG_TILE_PROPERTY_NORMAL;
return SFG_OUTSIDE_TILE;
}
#define SFG_NUMBER_OF_LEVELS 10

View File

@ -34,7 +34,7 @@
// #define SFG_TIME_MULTIPLIER 512
// uncomment for perfomance debug
//#define SFG_CPU_LOAD(percent) printf("CPU load: %d%\n",percent);
#define SFG_CPU_LOAD(percent) printf("CPU load: %d%\n",percent);
#ifndef __EMSCRIPTEN__
#ifndef GAME_LQ