Original Post
Well I compiled my C++ SDL game project just fine. I go to compile both in release and debug mode. No errors, warnings, I don't even get a single runtime error in my game while running the debug executable. Flawless I suppose. Well I have a process that renders my texture tile across the screen because the game is tile-based, that work fine in the debug executable. When I go to run the release executable, it still renders my character and does everything else properly, but it isn't rendering the map! I have no idea why and it's really been bugging me. Maybe someone around here might have a clue as to why it won't. Here's my map rendering function:
void CSDL::Draw_Map_Base(SDL_Surface *screen, int x_offset, int y_offset, CBase &Base)
{
//Vars
int x_shift=0, y_shift=0, x_next=21, y_next=16;
//Position check (for texture bleeding prevention)
if( (x_offset + 640) > (Base.getMapXSize() * 32) ) { x_offset = ((Base.getMapXSize() * 32) - 640); }
if( (y_offset + 480) > (Base.getMapYSize() * 32) ) { y_offset = ((Base.getMapYSize() * 32) - 480); }
//Calculate new (x,y) pos in NMUs
x_shift += (int)floor((double)x_offset/32);
y_shift += (int)floor((double)y_offset/32);
//Initial NMUs to start rendering at
int y = y_shift;
int x = x_shift;
//Render loop
for(; y < y_shift + y_next; y++)
{
for(; x < x_shift + x_next; x++)
{
//Render
DrawIMG( screen, &(*vecTextures)[Map[y][x].tile_ID].image, ((x*32) - x_offset), ((y*32) - y_offset) );
//Check map bounds
if((x_shift + 20) == Base.getMapXSize()){ x_next = 20; }
else{ x_next = 21; }
}
//Reset x counter
x = x_shift;
//Check map bounds
if((y_shift + 15) == Base.getMapYSize()){ y_next = 15; }
else{ y_next = 16; }
}
}
It runs fine, compiles fine, everything is smooth. Just my release executable isn't rendering the tiles in the background, so my player's image gets rendered where ever I move in the buffer and it's that ugly flickering thing you see in the void of other rendering APIs. I'm stumped. :<