1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-08-13 19:54:17 +02:00

Make MARK_BLOCKED_POSITIONS and MARK_VISITABLE_POSITIONS compilable.

This commit is contained in:
Frank Zago
2009-06-14 15:53:40 +00:00
parent bda62ab147
commit e4275c2c90

View File

@@ -905,61 +905,29 @@ void CMapHandler::terrainRect(int3 top_tile, unsigned char anim, std::vector< st
} else { } else {
// TODO: these should be activable by the console // TODO: these should be activable by the console
#ifdef MARK_BLOCKED_POSITIONS #ifdef MARK_BLOCKED_POSITIONS
if(ttiles[x+bx][y+by][level].tileInfo->blocked) //temporary hiding blocked positions if(ttiles[top_tile.x+bx][top_tile.y+by][top_tile.z].tileInfo->blocked) //temporary hiding blocked positions
{ {
SDL_Rect sr; SDL_Rect sr;
if(smooth)
{ sr.x=srx;
sr.y=by*32 + moveY; sr.y=sry;
sr.x=bx*32 + moveX;
sr.h=sr.w=32; sr.h=sr.w=32;
}
else
{
sr.y=by*32;
sr.x=bx*32;
sr.h=sr.w=32;
validateRectTerr(&sr, extRect);
}
SDL_Surface * ns = CSDL_Ext::newSurface(32, 32, CSDL_Ext::std32bppSurface); memset(rSurf->pixels, 128, rSurf->pitch * rSurf->h);
for(int f=0; f<ns->w*ns->h*4; ++f) SDL_BlitSurface(rSurf,&genRect(sr.h, sr.w, 0, 0),extSurf,&sr);
{
*((unsigned char*)(ns->pixels) + f) = 128;
}
SDL_BlitSurface(ns,&genRect(sr.h, sr.w, 0, 0),extSurf,&sr);
SDL_FreeSurface(ns);
} }
#endif #endif
#ifdef MARK_VISITABLE_POSITIONS #ifdef MARK_VISITABLE_POSITIONS
if(ttiles[x+bx][y+by][level].tileInfo->visitable) //temporary hiding visitable positions if(ttiles[top_tile.x+bx][top_tile.y+by][top_tile.z].tileInfo->visitable) //temporary hiding visitable positions
{ {
SDL_Rect sr; SDL_Rect sr;
if(smooth)
{ sr.x=srx;
sr.y=by*32 + moveY; sr.y=sry;
sr.x=bx*32 + moveX;
sr.h=sr.w=32; sr.h=sr.w=32;
}
else
{
sr.y=by*32;
sr.x=bx*32;
sr.h=sr.w=32;
validateRectTerr(&sr, extRect);
}
SDL_Surface * ns = CSDL_Ext::newSurface(32, 32, CSDL_Ext::std32bppSurface); memset(rSurf->pixels, 128, rSurf->pitch * rSurf->h);
for(int f=0; f<ns->w*ns->h*4; ++f) SDL_BlitSurface(rSurf,&genRect(sr.h, sr.w, 0, 0),extSurf,&sr);
{
*((unsigned char*)(ns->pixels) + f) = 128;
}
SDL_BlitSurface(ns,&genRect(sr.h, sr.w, 0, 0),extSurf,&sr);
SDL_FreeSurface(ns);
} }
#endif #endif
} }
@@ -967,7 +935,7 @@ void CMapHandler::terrainRect(int3 top_tile, unsigned char anim, std::vector< st
} }
// borders printed // borders printed
#if 1 #ifdef MARK_GRID_POSITIONS
// print grid // print grid
// TODO: This option should be activated by the console. // TODO: This option should be activated by the console.
srx = srx_init; srx = srx_init;