Changeset 289 for trunk/deushax


Ignore:
Timestamp:
Jan 26, 2011, 1:33:36 AM (12 years ago)
Author:
sam
Message:

Change the way the Scene object works.

Location:
trunk/deushax
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/deushax/debugsprite.cpp

    r259 r289  
    6161    int z = data->z;
    6262
    63     data->game->GetScene()->AddTile((data->tiler << 16) | 31,
    64                                     x - 16, y, z, 1);
    65     data->game->GetScene()->AddTile((data->tiler << 16) | 15,
    66                                     x - 16, y, z + 32, 1);
     63    Scene::GetDefault()->AddTile((data->tiler << 16) | 31,
     64                                 x - 16, y, z, 1);
     65    Scene::GetDefault()->AddTile((data->tiler << 16) | 15,
     66                                 x - 16, y, z + 32, 1);
    6767}
    6868
  • trunk/deushax/game.cpp

    r259 r289  
    2626    int mousex, mousey;
    2727    int done;
    28 
    29     Scene *scene;
    3028};
    3129
     
    4038    data->x = data->y = 0;
    4139    data->done = 0;
    42     data->scene = NULL;
    4340}
    4441
     
    5855    Entity::TickDraw(deltams);
    5956
    60     GetScene();
    61 
    62     data->map->Render(data->scene, -data->mousex, -data->mousey, 0);
    63     data->scene->Render();
    64 
    65     delete data->scene;
    66     data->scene = NULL;
     57    data->map->Render(-data->mousex, -data->mousey, 0);
    6758}
    6859
     60#if 0
    6961Scene *Game::GetScene()
    7062{
     
    7365    return data->scene;
    7466}
     67#endif
    7568
    7669void Game::SetMouse(int x, int y)
  • trunk/deushax/game.h

    r221 r289  
    1313
    1414#include "entity.h"
    15 #include "scene.h"
    1615
    1716class GameData;
     
    3029public:
    3130    /* New methods */
    32     Scene *GetScene();
    3331    void SetMouse(int x, int y);
    3432    void Quit();
  • trunk/deushax/mapviewer.cpp

    r259 r289  
    2626    int povx, povy;
    2727    int done;
    28 
    29     Scene *scene;
    3028};
    3129
     
    4038    data->x = data->y = 0;
    4139    data->done = 0;
    42     data->scene = NULL;
    4340}
    4441
     
    5855    Entity::TickDraw(deltams);
    5956
    60     GetScene();
    61 
    62     data->map->Render(data->scene, -data->povx, -data->povy, 0);
    63     data->scene->Render();
    64 
    65     delete data->scene;
    66     data->scene = NULL;
    67 }
    68 
    69 Scene *MapViewer::GetScene()
    70 {
    71     if (!data->scene)
    72         data->scene = new Scene(45.0f);
    73     return data->scene;
     57    data->map->Render(-data->povx, -data->povy, 0);
    7458}
    7559
  • trunk/deushax/mapviewer.h

    r220 r289  
    1313
    1414#include "entity.h"
    15 #include "scene.h"
    1615
    1716class MapViewerData;
Note: See TracChangeset for help on using the changeset viewer.