Timer safe_timer;
int stomp_count;
int hit_points;
- std::auto_ptr<Surface> hud_head;
+ SurfacePtr hud_head;
};
#endif
#include <SDL.h>
#include "video/color.hpp"
+#include "video/surface_ptr.hpp"
class DrawingContext;
class MenuItem;
-class Surface;
bool confirm_dialog(Surface* background, std::string text);
int arrange_left;
int active_item;
- std::auto_ptr<Surface> checkbox;
- std::auto_ptr<Surface> checkbox_checked;
- std::auto_ptr<Surface> back;
- std::auto_ptr<Surface> arrow_left;
- std::auto_ptr<Surface> arrow_right;
+ SurfacePtr checkbox;
+ SurfacePtr checkbox_checked;
+ SurfacePtr back;
+ SurfacePtr arrow_left;
+ SurfacePtr arrow_right;
};
#endif
float speed_y; /**< scroll-speed in vertical direction */
Vector scroll_speed;
Vector scroll_offset;
- std::auto_ptr<Surface> image_top; /**< image to draw above pos */
- std::auto_ptr<Surface> image; /**< image to draw, anchored at pos */
- std::auto_ptr<Surface> image_bottom; /**< image to draw below pos+screenheight */
+ SurfacePtr image_top; /**< image to draw above pos */
+ SurfacePtr image; /**< image to draw, anchored at pos */
+ SurfacePtr image_bottom; /**< image to draw below pos+screenheight */
};
#endif /*SUPERTUX_BACKGROUND_H*/
#include <memory>
#include "object/particlesystem.hpp"
+#include "video/surface_ptr.hpp"
class CloudParticleSystem : public ParticleSystem
{
{}
};
- std::auto_ptr<Surface> cloudimage;
+ SurfacePtr cloudimage;
private:
CloudParticleSystem(const CloudParticleSystem&);
#include <memory>
#include "object/particlesystem_interactive.hpp"
+#include "video/surface_ptr.hpp"
class CometParticleSystem : public ParticleSystem_Interactive
{
{}
};
- std::auto_ptr<Surface> cometimages[2];
+ SurfacePtr cometimages[2];
private:
CometParticleSystem(const CometParticleSystem&);
#include <memory>
#include "object/particlesystem.hpp"
+#include "video/surface_ptr.hpp"
class GhostParticleSystem : public ParticleSystem
{
{}
};
- std::auto_ptr<Surface> ghosts[2];
+ SurfacePtr ghosts[2];
private:
GhostParticleSystem(const GhostParticleSystem&);
#include "supertux/script_interface.hpp"
#include "util/reader_fwd.hpp"
#include "video/color.hpp"
-
-class Surface;
+#include "video/surface_ptr.hpp"
class LevelTime : public GameObject,
public ScriptInterface
*/
private:
- std::auto_ptr<Surface> time_surface;
+ SurfacePtr time_surface;
bool running;
float time_left;
};
std::auto_ptr<Sprite> sprite; /**< The main sprite representing Tux */
- std::auto_ptr<Surface> airarrow; /**< arrow indicating Tux' position when he's above the camera */
+ SurfacePtr airarrow; /**< arrow indicating Tux' position when he's above the camera */
Vector floor_normal;
void try_grab();
#include <memory>
#include "object/particlesystem_interactive.hpp"
+#include "video/surface_ptr.hpp"
class RainParticleSystem : public ParticleSystem_Interactive
{
{}
};
- std::auto_ptr<Surface> rainimages[2];
+ SurfacePtr rainimages[2];
private:
RainParticleSystem(const RainParticleSystem&);
#include <sstream>
#include <vector>
+#include "video/surface_ptr.hpp"
+
class Console;
class ConsoleStreamBuffer;
class ConsoleCommandReceiver;
class DrawingContext;
-class Surface;
class Font;
class Console
std::list<std::string>::iterator history_position; /**< item of command history that is currently displayed */
std::list<std::string> lines; /**< backbuffer of lines sent to the console. New lines get added to front. */
- std::auto_ptr<Surface> background; /**< console background image */
- std::auto_ptr<Surface> background2; /**< second, moving console background image */
+ SurfacePtr background; /**< console background image */
+ SurfacePtr background2; /**< second, moving console background image */
HSQUIRRELVM vm; /**< squirrel thread for the console (with custom roottable) */
HSQOBJECT vm_object;
void process_menu();
std::auto_ptr<Level> level;
- std::auto_ptr<Surface> statistics_backdrop;
+ SurfacePtr statistics_backdrop;
// scripts
typedef std::vector<HSQOBJECT> ScriptList;
#include <string>
#include <vector>
+#include "video/surface_ptr.hpp"
+
class DrawingContext;
class InfoBoxLine;
-class Surface;
/** This class is displaying a box with information text inside the game */
class InfoBox
size_t firstline;
std::vector<InfoBoxLine*> lines;
std::map<std::string, Surface*> images;
- std::auto_ptr<Surface> arrow_scrollup;
- std::auto_ptr<Surface> arrow_scrolldown;
+ SurfacePtr arrow_scrollup;
+ SurfacePtr arrow_scrolldown;
private:
InfoBox(const InfoBox&);
font(Resources::normal_font),
color(),
text(text),
- image(0)
+ image()
{
font = get_font_by_format_char(format_char);
lineType = get_linetype_by_format_char(format_char);
#include <memory>
#include "video/color.hpp"
+#include "video/surface_ptr.hpp"
class DrawingContext;
class Font;
class Rectf;
-class Surface;
/**
* Helper class for InfoBox: Represents a line of text
Font* font;
Color color;
std::string text;
- std::auto_ptr<Surface> image;
+ SurfacePtr image;
private:
InfoBoxLine(const InfoBoxLine&);
#include "util/reader_fwd.hpp"
#include "util/writer_fwd.hpp"
#include "video/color.hpp"
-
-class Surface;
+#include "video/surface_ptr.hpp"
static const float BORDER_X = 10;
static const float BORDER_Y = 10;
int max_ice_bullets; /**< maximum number of ice bullets in play */
private:
- std::auto_ptr<Surface> coin_surface;
+ SurfacePtr coin_surface;
private:
PlayerStatus(const PlayerStatus&);
#include "supertux/screen.hpp"
#include "video/color.hpp"
+#include "video/surface_ptr.hpp"
class DrawingContext;
-class Surface;
class Font;
class InfoBoxLine;
float defaultspeed;
float speed;
std::string music;
- std::auto_ptr<Surface> background;
+ SurfacePtr background;
std::vector<InfoBoxLine*> lines;
float scroll;
bool fading;
private:
std::auto_ptr<MainMenu> main_menu;
- std::auto_ptr<Surface> frame;
+ SurfacePtr frame;
std::auto_ptr<CodeController> controller;
std::auto_ptr<GameSession> titlesession;
#include "video/texture.hpp"
#include "video/video_systems.hpp"
-std::auto_ptr<Surface>
+SurfacePtr
Surface::create(const std::string& file)
{
- return std::auto_ptr<Surface>(new Surface(file));
+ return SurfacePtr(new Surface(file));
}
-std::auto_ptr<Surface>
+SurfacePtr
Surface::create(const std::string& file, const Rect& rect)
{
- return std::auto_ptr<Surface>(new Surface(file, rect));
+ return SurfacePtr(new Surface(file, rect));
}
Surface::Surface(const std::string& file) :
#include "math/vector.hpp"
#include "math/rect.hpp"
+#include "video/surface_ptr.hpp"
class Texture;
class SurfaceData;
-/**
- * A rectangular image.
- * The class basically holds a reference to a texture with additional UV
- * coordinates that specify a rectangular area on this texture
- */
+/** A rectangular image. The class basically holds a reference to a
+ texture with additional UV coordinates that specify a rectangular
+ area on this texture */
class Surface
{
public:
- static std::auto_ptr<Surface> create(const std::string& file);
- static std::auto_ptr<Surface> create(const std::string& file, const Rect& rect);
+ static SurfacePtr create(const std::string& file);
+ static SurfacePtr create(const std::string& file, const Rect& rect);
private:
Texture* texture;
int get_width() const;
int get_height() const;
Vector get_position() const;
- /**
- * returns a vector containing width and height
- */
+
+ /** returns a vector containing width and height */
Vector get_size() const;
};