diff --git a/src/debugfps.cpp b/src/debugfps.cpp index 1550354b..05c33950 100644 --- a/src/debugfps.cpp +++ b/src/debugfps.cpp @@ -35,9 +35,8 @@ private: */ DebugFps::DebugFps(int x, int y) + : data(new DebugFpsData()) { - data = new DebugFpsData(); - data->fontid = Forge::Register("gfx/font/ascii.png"); data->x = x; data->y = y; diff --git a/src/debugrecord.cpp b/src/debugrecord.cpp index 0892ef8d..4344f25c 100644 --- a/src/debugrecord.cpp +++ b/src/debugrecord.cpp @@ -43,8 +43,8 @@ private: */ DebugRecord::DebugRecord(char const *path) + : data(new DebugRecordData()) { - data = new DebugRecordData(); data->path = strdup(path); data->width = 0; data->height = 0; diff --git a/src/debugsphere.cpp b/src/debugsphere.cpp index 8173f980..fd1e8c10 100644 --- a/src/debugsphere.cpp +++ b/src/debugsphere.cpp @@ -111,8 +111,8 @@ GLuint const DebugSphereData::tindices[20][3] = */ DebugSphere::DebugSphere() + : data(new DebugSphereData()) { - data = new DebugSphereData(); data->time = 0.0f; } diff --git a/src/debugstats.cpp b/src/debugstats.cpp index 7e5dd173..6e4493f4 100644 --- a/src/debugstats.cpp +++ b/src/debugstats.cpp @@ -34,8 +34,8 @@ private: */ DebugStats::DebugStats(char const *path) + : data(new DebugStatsData()) { - data = new DebugStatsData(); data->fp = fopen(path, "w+"); gamegroup = GAMEGROUP_AFTER; diff --git a/src/dict.cpp b/src/dict.cpp index 9a3e77a9..02fdc60e 100644 --- a/src/dict.cpp +++ b/src/dict.cpp @@ -57,8 +57,8 @@ private: */ Dict::Dict() + : data(new DictData()) { - data = new DictData(); } Dict::~Dict() diff --git a/src/font.cpp b/src/font.cpp index d8e20900..d1173d54 100644 --- a/src/font.cpp +++ b/src/font.cpp @@ -49,8 +49,8 @@ private: */ Font::Font(char const *path) + : data(new FontData()) { - data = new FontData(); data->name = strdup(path); data->img = NULL; diff --git a/src/map.cpp b/src/map.cpp index bc70633c..dd316092 100644 --- a/src/map.cpp +++ b/src/map.cpp @@ -45,8 +45,8 @@ private: */ Map::Map(char const *path) + : data(new MapData()) { - data = new MapData(); data->ntilers = 0; data->layers = NULL; data->nlayers = 0; diff --git a/src/sample.cpp b/src/sample.cpp index 20feb8c7..f179dace 100644 --- a/src/sample.cpp +++ b/src/sample.cpp @@ -37,8 +37,8 @@ private: */ Sample::Sample(char const *path) + : data(new SampleData()) { - data = new SampleData(); data->name = strdup(path); data->chunk = Mix_LoadWAV(path); } diff --git a/src/scene.cpp b/src/scene.cpp index 37a00a17..e2e985e2 100644 --- a/src/scene.cpp +++ b/src/scene.cpp @@ -61,8 +61,8 @@ private: */ Scene::Scene(float angle) + : data(new SceneData()) { - data = new SceneData(); data->tiles = 0; data->ntiles = 0; data->angle = angle; diff --git a/src/sdlinput.cpp b/src/sdlinput.cpp index 9f6aa9c3..be991011 100644 --- a/src/sdlinput.cpp +++ b/src/sdlinput.cpp @@ -34,10 +34,10 @@ private: */ SdlInput::SdlInput() + : data(new SdlInputData()) { SDL_Init(SDL_INIT_TIMER); - data = new SdlInputData(); SDL_GetMouseState(&data->mx, &data->my); gamegroup = GAMEGROUP_BEFORE; diff --git a/src/tileset.cpp b/src/tileset.cpp index 4a123a45..f399f974 100644 --- a/src/tileset.cpp +++ b/src/tileset.cpp @@ -54,8 +54,8 @@ private: */ TileSet::TileSet(char const *path, int w, int h, float dilate) + : data(new TileSetData()) { - data = new TileSetData(); data->name = strdup(path); data->tiles = NULL; data->img = NULL; diff --git a/src/timer.cpp b/src/timer.cpp index 954e496b..90187a45 100644 --- a/src/timer.cpp +++ b/src/timer.cpp @@ -102,8 +102,8 @@ private: */ Timer::Timer() + : data(new TimerData()) { - data = new TimerData(); } Timer::~Timer() diff --git a/src/world.cpp b/src/world.cpp index c0becb5d..e1cf9865 100644 --- a/src/world.cpp +++ b/src/world.cpp @@ -36,8 +36,8 @@ private: */ World::World() + : data(new WorldData()) { - data = new WorldData(); data->width = 0; data->height = 0;