for (i = 0; i < 2; i++)
delete img_flag[i];
+ delete img_red_glow;
for (i = 0; i < 4; i++)
{
delete img_distro[i];
delete img_cloud[1][i];
}
+ delete tux_life;
+
for (i = 0; i < NUM_SOUNDS; i++)
free_chunk(sounds[i]);
{
/* Free global images: */
-
delete black_text;
delete gold_text;
delete white_text;
delete red_text;
delete white_small_text;
delete white_big_text;
+ delete yellow_nums;
/* Free GUI/menu images: */
delete checkbox;
void free_strings(char **strings, int num);
void st_directory_setup(void);
void st_general_setup(void);
+void st_general_free();
void st_video_setup_sdl(void);
void st_video_setup_gl(void);
void st_video_setup(void);
updatescreen();
unloadshared();
+ st_general_free();
TileManager::destroy_instance();
#ifdef DEBUG
Surface::debug_check();
SDL_FreeSurface(conv);
}
+Text::~Text()
+{
+ delete chars;
+ delete shadow_chars;
+}
+
void
Text::draw(const char* text, int x, int y, int shadowsize, int update)
{
}
}
-Text::~Text()
-{
- if(kind == TEXT_TEXT)
- delete chars;
- else if(kind == TEXT_NUM)
- delete chars;
-}
-
/* --- ERASE TEXT: --- */
void
#include <assert.h>
#include <iostream>
+#include <algorithm>
#include "SDL.h"
#include "SDL_image.h"
#include "texture.h"
Surface::~Surface()
{
+#ifdef DEBUG
+ bool found = false;
+ for(std::list<Surface*>::iterator i = surfaces.begin(); i != surfaces.end();
+ ++i) {
+ if(*i == this) {
+ found = true; break;
+ }
+ }
+ if(!found)
+ printf("Error: Surface freed twice!!!\n");
+#endif
surfaces.remove(this);
delete impl;
}
delete bkg_title;
delete logo;
+ delete img_choose_subset;
}
// EOF //
{
for (BadGuys::iterator i = bad_guys.begin(); i != bad_guys.end(); ++i)
delete *i;
+
+ for (ParticleSystems::iterator i = particle_systems.begin();
+ i != particle_systems.end(); ++i)
+ delete *i;
delete level;
}
std::vector<Upgrade> upgrades;
std::vector<Bullet> bullets;
- std::vector<ParticleSystem*> particle_systems;
+ typedef std::vector<ParticleSystem*> ParticleSystems;
+ ParticleSystems particle_systems;
public:
static World* current() { return current_; }
if (dir != NONE)
{
tux->set_direction(dir);
- tux->update(delta);
+ //tux->update(delta);
}
std::cout << "Walk to dir: " << dir << std::endl;
}
else
{
- tux->set_direction(input_direction);
tux->update(delta);
+ tux->set_direction(input_direction);
}
Menu* menu = Menu::current();
delta *= 1.3f;
+ if (delta > 10.0f)
+ delta = .3f;
+
last_update_time = update_time;
update_time = st_get_ticks();