forked from jaildesigner-jailgames/jaildoctors_dilemma
passat el codi de pintar el mode debug de textura a surface
This commit is contained in:
132
source/room.cpp
132
source/room.cpp
@@ -497,86 +497,74 @@ void Room::fillMapTexture()
|
||||
|
||||
#ifdef DEBUG
|
||||
if (Debug::get()->getEnabled())
|
||||
{ /*
|
||||
// BottomSurfaces
|
||||
if (true)
|
||||
{
|
||||
for (auto l : bottom_floors_)
|
||||
{
|
||||
SDL_SetRenderDrawColor(Screen::get()->getRenderer(), (rand() % 128) + 96, (rand() % 128) + 96, (rand() % 128) + 96, 0xFF);
|
||||
SDL_SetRenderDrawColor(Screen::get()->getRenderer(), 255, 0, 0, 0xFF);
|
||||
SDL_RenderDrawLine(Screen::get()->getRenderer(), l.x1, l.y, l.x2, l.y);
|
||||
}
|
||||
}
|
||||
{
|
||||
auto surface = Screen::get()->getRendererSurface();
|
||||
|
||||
// TopSurfaces
|
||||
if (true)
|
||||
{
|
||||
for (auto l : top_floors_)
|
||||
{
|
||||
SDL_SetRenderDrawColor(Screen::get()->getRenderer(), (rand() % 128) + 96, (rand() % 128) + 96, (rand() % 128) + 96, 0xFF);
|
||||
SDL_SetRenderDrawColor(Screen::get()->getRenderer(), 0, 255, 0, 0xFF);
|
||||
SDL_RenderDrawLine(Screen::get()->getRenderer(), l.x1, l.y, l.x2, l.y);
|
||||
}
|
||||
}
|
||||
// BottomSurfaces
|
||||
if (true)
|
||||
{
|
||||
for (auto l : bottom_floors_)
|
||||
{
|
||||
surface->drawLine(l.x1, l.y, l.x2, l.y, static_cast<Uint8>(PaletteColor::BLUE));
|
||||
}
|
||||
}
|
||||
|
||||
// LeftSurfaces
|
||||
if (true)
|
||||
{
|
||||
for (auto l : left_walls_)
|
||||
{
|
||||
SDL_SetRenderDrawColor(Screen::get()->getRenderer(), (rand() % 128) + 96, (rand() % 128) + 96, (rand() % 128) + 96, 0xFF);
|
||||
SDL_SetRenderDrawColor(Screen::get()->getRenderer(), 128, 128, 255, 0xFF);
|
||||
SDL_RenderDrawLine(Screen::get()->getRenderer(), l.x, l.y1, l.x, l.y2);
|
||||
}
|
||||
}
|
||||
// TopSurfaces
|
||||
if (true)
|
||||
{
|
||||
for (auto l : top_floors_)
|
||||
{
|
||||
surface->drawLine(l.x1, l.y, l.x2, l.y, static_cast<Uint8>(PaletteColor::RED));
|
||||
}
|
||||
}
|
||||
|
||||
// RightSurfaces
|
||||
if (true)
|
||||
{
|
||||
for (auto l : right_walls_)
|
||||
{
|
||||
SDL_SetRenderDrawColor(Screen::get()->getRenderer(), (rand() % 128) + 96, (rand() % 128) + 96, (rand() % 128) + 96, 0xFF);
|
||||
SDL_SetRenderDrawColor(Screen::get()->getRenderer(), 255, 255, 0, 0xFF);
|
||||
SDL_RenderDrawLine(Screen::get()->getRenderer(), l.x, l.y1, l.x, l.y2);
|
||||
}
|
||||
}
|
||||
// LeftSurfaces
|
||||
if (true)
|
||||
{
|
||||
for (auto l : left_walls_)
|
||||
{
|
||||
surface->drawLine(l.x, l.y1, l.x, l.y2, static_cast<Uint8>(PaletteColor::GREEN));
|
||||
}
|
||||
}
|
||||
|
||||
// LeftSlopes
|
||||
if (true)
|
||||
{
|
||||
for (auto l : left_slopes_)
|
||||
{
|
||||
SDL_SetRenderDrawColor(Screen::get()->getRenderer(), (rand() % 128) + 96, (rand() % 128) + 96, (rand() % 128) + 96, 0xFF);
|
||||
SDL_SetRenderDrawColor(Screen::get()->getRenderer(), 0, 255, 255, 0xFF);
|
||||
SDL_RenderDrawLine(Screen::get()->getRenderer(), l.x1, l.y1, l.x2, l.y2);
|
||||
}
|
||||
}
|
||||
// RightSurfaces
|
||||
if (true)
|
||||
{
|
||||
for (auto l : right_walls_)
|
||||
{
|
||||
surface->drawLine(l.x, l.y1, l.x, l.y2, static_cast<Uint8>(PaletteColor::MAGENTA));
|
||||
}
|
||||
}
|
||||
|
||||
// RightSlopes
|
||||
if (true)
|
||||
{
|
||||
for (auto l : right_slopes_)
|
||||
{
|
||||
SDL_SetRenderDrawColor(Screen::get()->getRenderer(), (rand() % 128) + 96, (rand() % 128) + 96, (rand() % 128) + 96, 0xFF);
|
||||
SDL_SetRenderDrawColor(Screen::get()->getRenderer(), 255, 0, 255, 0xFF);
|
||||
SDL_RenderDrawLine(Screen::get()->getRenderer(), l.x1, l.y1, l.x2, l.y2);
|
||||
}
|
||||
}
|
||||
// LeftSlopes
|
||||
if (true)
|
||||
{
|
||||
for (auto l : left_slopes_)
|
||||
{
|
||||
surface->drawLine(l.x1, l.y1, l.x2, l.y2, static_cast<Uint8>(PaletteColor::CYAN));
|
||||
}
|
||||
}
|
||||
|
||||
// AutoSurfaces
|
||||
if (true)
|
||||
{
|
||||
for (auto l : conveyor_belt_floors_)
|
||||
{
|
||||
SDL_SetRenderDrawColor(Screen::get()->getRenderer(), (rand() % 128) + 96, (rand() % 128) + 96, (rand() % 128) + 96, 0xFF);
|
||||
SDL_RenderDrawLine(Screen::get()->getRenderer(), l.x1, l.y, l.x2, l.y);
|
||||
}
|
||||
}
|
||||
*/
|
||||
// RightSlopes
|
||||
if (true)
|
||||
{
|
||||
for (auto l : right_slopes_)
|
||||
{
|
||||
surface->drawLine(l.x1, l.y1, l.x2, l.y2, static_cast<Uint8>(PaletteColor::YELLOW));
|
||||
}
|
||||
}
|
||||
|
||||
// AutoSurfaces
|
||||
if (true)
|
||||
{
|
||||
for (auto l : conveyor_belt_floors_)
|
||||
{
|
||||
surface->drawLine(l.x1, l.y, l.x2, l.y, static_cast<Uint8>(PaletteColor::WHITE));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
#endif // DEBUG
|
||||
Screen::get()->setRendererSurface(previuos_renderer);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user