Ignore:
Timestamp:
Aug 16, 2010, 11:40:15 PM (10 years ago)
Author:
sam
Message:

Allow other classes to request the Game's Scene object.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/game.cpp

    r111 r131  
    2727    int done;
    2828
    29     int frame;
     29    Scene *scene;
    3030};
    3131
     
    4040    data->x = data->y = 0;
    4141    data->done = 0;
    42     data->frame = 0;
     42    data->scene = NULL;
    4343}
    4444
     
    6363    Asset::TickRender(delta_time);
    6464
    65     Scene *scene = new Scene();
     65    GetScene();
    6666
    67     data->map->Render(scene, data->mousex, data->mousey, 0);
     67    data->map->Render(data->scene, data->mousex, data->mousey, 0);
     68    data->scene->Render();
    6869
    69     scene->Render();
    70     delete scene;
     70    delete data->scene;
     71    data->scene = NULL;
     72}
     73
     74Scene *Game::GetScene()
     75{
     76    if (!data->scene)
     77        data->scene = new Scene();
     78    return data->scene;
    7179}
    7280
Note: See TracChangeset for help on using the changeset viewer.