Changeset 259


Ignore:
Timestamp:
Jan 22, 2011, 6:02:25 PM (9 years ago)
Author:
sam
Message:

Slightly change the ...Data initialisation in classes.

Location:
trunk
Files:
21 edited

Legend:

Unmodified
Added
Removed
  • trunk/deushax/debugsprite.cpp

    r222 r259  
    3333
    3434DebugSprite::DebugSprite(Game *game)
     35  : data(new DebugSpriteData())
    3536{
    36     data = new DebugSpriteData();
    3737    data->game = game;
    3838    Ticker::Ref(game);
  • trunk/deushax/game.cpp

    r222 r259  
    3535
    3636Game::Game(char const *mapname)
     37  : data(new GameData())
    3738{
    38     data = new GameData();
    3939    data->map = new Map(mapname);
    4040    data->x = data->y = 0;
  • trunk/deushax/mapviewer.cpp

    r222 r259  
    3535
    3636MapViewer::MapViewer(char const *mapname)
     37  : data(new MapViewerData())
    3738{
    38     data = new MapViewerData();
    3939    data->map = new Map(mapname);
    4040    data->x = data->y = 0;
  • trunk/monsterz/board.cpp

    r258 r259  
    5656
    5757Board::Board(Game *game)
    58 {
    59     data = new BoardData();
     58  : data(new BoardData())
     59{
    6060    data->game = game;
    6161    Ticker::Ref(game);
  • trunk/monsterz/game.cpp

    r222 r259  
    3939
    4040Game::Game()
     41  : data(new GameData())
    4142{
    42     data = new GameData();
    4343    data->x = data->y = 0;
    4444    data->done = 0;
  • trunk/monsterz/mash.cpp

    r257 r259  
    3737
    3838Mash::Mash(Game *game, Int2 *cell)
     39  : data(new MashData()),
     40    nextmash(NULL)
    3941{
    40     data = new MashData();
    4142    data->game = game;
    4243    Ticker::Ref(game);
  • trunk/monsterz/mash.h

    r257 r259  
    2929private:
    3030    MashData *data;
     31
     32public:
     33    Mash *nextmash;
    3134};
    3235
  • trunk/monsterz/piece.cpp

    r258 r259  
    5151
    5252Piece::Piece(Game *game, Int2 cell, int id)
    53 {
    54     data = new PieceData();
     53  : data(new PieceData())
     54{
    5555    data->game = game;
    5656    Ticker::Ref(game);
  • trunk/src/debugfps.cpp

    r227 r259  
    3636
    3737DebugFps::DebugFps(int x, int y)
     38  : data(new DebugFpsData())
    3839{
    39     data = new DebugFpsData();
    40 
    4140    data->fontid = Forge::Register("gfx/font/ascii.png");
    4241    data->x = x;
  • trunk/src/debugrecord.cpp

    r221 r259  
    4444
    4545DebugRecord::DebugRecord(char const *path)
     46  : data(new DebugRecordData())
    4647{
    47     data = new DebugRecordData();
    4848    data->path = strdup(path);
    4949    data->width = 0;
  • trunk/src/debugsphere.cpp

    r221 r259  
    112112
    113113DebugSphere::DebugSphere()
     114  : data(new DebugSphereData())
    114115{
    115     data = new DebugSphereData();
    116116    data->time = 0.0f;
    117117}
  • trunk/src/debugstats.cpp

    r221 r259  
    3535
    3636DebugStats::DebugStats(char const *path)
     37  : data(new DebugStatsData())
    3738{
    38     data = new DebugStatsData();
    3939    data->fp = fopen(path, "w+");
    4040
  • trunk/src/dict.cpp

    r225 r259  
    5858
    5959Dict::Dict()
     60  : data(new DictData())
    6061{
    61     data = new DictData();
    6262}
    6363
  • trunk/src/font.cpp

    r221 r259  
    5050
    5151Font::Font(char const *path)
     52  : data(new FontData())
    5253{
    53     data = new FontData();
    5454    data->name = strdup(path);
    5555    data->img = NULL;
  • trunk/src/map.cpp

    r222 r259  
    4646
    4747Map::Map(char const *path)
     48  : data(new MapData())
    4849{
    49     data = new MapData();
    5050    data->ntilers = 0;
    5151    data->layers = NULL;
  • trunk/src/sample.cpp

    r253 r259  
    3838
    3939Sample::Sample(char const *path)
     40  : data(new SampleData())
    4041{
    41     data = new SampleData();
    4242    data->name = strdup(path);
    4343    data->chunk = Mix_LoadWAV(path);
  • trunk/src/scene.cpp

    r222 r259  
    6262
    6363Scene::Scene(float angle)
     64  : data(new SceneData())
    6465{
    65     data = new SceneData();
    6666    data->tiles = 0;
    6767    data->ntiles = 0;
  • trunk/src/sdlinput.cpp

    r238 r259  
    3535
    3636SdlInput::SdlInput()
     37  : data(new SdlInputData())
    3738{
    3839    SDL_Init(SDL_INIT_TIMER);
    3940
    40     data = new SdlInputData();
    4141    SDL_GetMouseState(&data->mx, &data->my);
    4242
  • trunk/src/tileset.cpp

    r222 r259  
    5555
    5656TileSet::TileSet(char const *path, int w, int h, float dilate)
     57  : data(new TileSetData())
    5758{
    58     data = new TileSetData();
    5959    data->name = strdup(path);
    6060    data->tiles = NULL;
  • trunk/src/timer.cpp

    r221 r259  
    103103
    104104Timer::Timer()
     105  : data(new TimerData())
    105106{
    106     data = new TimerData();
    107107}
    108108
  • trunk/src/world.cpp

    r221 r259  
    3737
    3838World::World()
     39  : data(new WorldData())
    3940{
    40     data = new WorldData();
    4141    data->width = 0;
    4242    data->height = 0;
Note: See TracChangeset for help on using the changeset viewer.