Tweaking the build to turn on various debug options in GCC and enable -Wall -Werror on only our executable configs because turning them on globally causes most of the dependencies to fail. One thing to note is if you try to move the -D_GLIBCXX options from the project() to the executable() then you get segfaults inside the libc++ and other places. This is because the ABI changes when you enable these options, so you have to recompile _all_ dependencies with these options.

This commit is contained in:
Zed A. Shaw 2025-01-19 04:02:42 -05:00
parent 4c3049df14
commit ea3dd204a1
5 changed files with 22 additions and 19 deletions

View file

@ -137,8 +137,8 @@ void Raycaster::sprite_casting() {
int texY = ((d * textureHeight) / spriteHeight) / 256;
//get current color from the texture
// BUG: this crashes sometimes when the math goes out of bounds
size_t index = textureWidth * texY + texX;
if(index < 0 || index >= sprite_texture.size()) continue;
int index = textureWidth * texY + texX;
if(index < 0 || (size_t)index >= sprite_texture.size()) continue;
uint32_t color = sprite_texture[index];
// poor person's transparency, get current color from the texture
if((color & 0x00FFFFFF) != 0) {