0 Members and 2 Guests are viewing this topic.
void CMap::drawLayer(int nlayer){ sf::FloatRect vrect = engine.camera.GetRect(); INFO_LAYER *layer = &layers[nlayer]; int gX, gY; for(std::size_t i=0; i<layer->map.size(); ++i) { if (layer->map[i]->gid > 0) { gX = i; gY = int(i/info_map.w); if (gX > info_map.w) gX-=info_map.w*gY; if ((gX*64+32 >= vrect.Left && gX*64-32 <= vrect.Right) && (gY*64+32 >= vrect.Top && gY*64-32 <= vrect.Bottom)) engine.screen.Draw(layer->map[i]->sprt_tile); } }}