Browse Source

scene: avoid doing hundreds of useless OpenGL calls if no 2D sprite is

being displayed in the scene.
legacy
Sam Hocevar sam 12 years ago
parent
commit
d684c0d113
1 changed files with 4 additions and 0 deletions
  1. +4
    -0
      src/scene.cpp

+ 4
- 0
src/scene.cpp View File

@@ -145,6 +145,10 @@ void Scene::AddTile(TileSet *tileset, int id, vec3 pos, int o, vec2 scale)

void Scene::Render() // XXX: rename to Blit()
{
/* Early exit if nothing needs to be rendered */
if (!data->tiles.Count())
return;

if (!data->m_shader)
{
#if !defined _XBOX && !defined __CELLOS_LV2__ && !defined USE_D3D9


Loading…
Cancel
Save