git-svn-id: http://supertux.lethargik.org/svn/supertux/trunk/supertux@6206
837edb03-e0f3-0310-88ca-
d4d4e8b29345
19 files changed:
Timer safe_timer;
int stomp_count;
int hit_points;
Timer safe_timer;
int stomp_count;
int hit_points;
- std::auto_ptr<Surface> hud_head;
#include <SDL.h>
#include "video/color.hpp"
#include <SDL.h>
#include "video/color.hpp"
+#include "video/surface_ptr.hpp"
class DrawingContext;
class MenuItem;
class DrawingContext;
class MenuItem;
bool confirm_dialog(Surface* background, std::string text);
bool confirm_dialog(Surface* background, std::string text);
int arrange_left;
int active_item;
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;
float speed_y; /**< scroll-speed in vertical direction */
Vector scroll_speed;
Vector scroll_offset;
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*/
};
#endif /*SUPERTUX_BACKGROUND_H*/
#include <memory>
#include "object/particlesystem.hpp"
#include <memory>
#include "object/particlesystem.hpp"
+#include "video/surface_ptr.hpp"
class CloudParticleSystem : public ParticleSystem
{
class CloudParticleSystem : public ParticleSystem
{
- std::auto_ptr<Surface> cloudimage;
private:
CloudParticleSystem(const CloudParticleSystem&);
private:
CloudParticleSystem(const CloudParticleSystem&);
#include <memory>
#include "object/particlesystem_interactive.hpp"
#include <memory>
#include "object/particlesystem_interactive.hpp"
+#include "video/surface_ptr.hpp"
class CometParticleSystem : public ParticleSystem_Interactive
{
class CometParticleSystem : public ParticleSystem_Interactive
{
- std::auto_ptr<Surface> cometimages[2];
+ SurfacePtr cometimages[2];
private:
CometParticleSystem(const CometParticleSystem&);
private:
CometParticleSystem(const CometParticleSystem&);
#include <memory>
#include "object/particlesystem.hpp"
#include <memory>
#include "object/particlesystem.hpp"
+#include "video/surface_ptr.hpp"
class GhostParticleSystem : public ParticleSystem
{
class GhostParticleSystem : public ParticleSystem
{
- std::auto_ptr<Surface> ghosts[2];
private:
GhostParticleSystem(const GhostParticleSystem&);
private:
GhostParticleSystem(const GhostParticleSystem&);
#include "supertux/script_interface.hpp"
#include "util/reader_fwd.hpp"
#include "video/color.hpp"
#include "supertux/script_interface.hpp"
#include "util/reader_fwd.hpp"
#include "video/color.hpp"
+#include "video/surface_ptr.hpp"
class LevelTime : public GameObject,
public ScriptInterface
class LevelTime : public GameObject,
public ScriptInterface
- std::auto_ptr<Surface> time_surface;
+ SurfacePtr time_surface;
bool running;
float time_left;
};
bool running;
float time_left;
};
std::auto_ptr<Sprite> sprite; /**< The main sprite representing Tux */
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();
Vector floor_normal;
void try_grab();
#include <memory>
#include "object/particlesystem_interactive.hpp"
#include <memory>
#include "object/particlesystem_interactive.hpp"
+#include "video/surface_ptr.hpp"
class RainParticleSystem : public ParticleSystem_Interactive
{
class RainParticleSystem : public ParticleSystem_Interactive
{
- std::auto_ptr<Surface> rainimages[2];
+ SurfacePtr rainimages[2];
private:
RainParticleSystem(const RainParticleSystem&);
private:
RainParticleSystem(const RainParticleSystem&);
#include <sstream>
#include <vector>
#include <sstream>
#include <vector>
+#include "video/surface_ptr.hpp"
+
class Console;
class ConsoleStreamBuffer;
class ConsoleCommandReceiver;
class DrawingContext;
class Console;
class ConsoleStreamBuffer;
class ConsoleCommandReceiver;
class DrawingContext;
class Font;
class Console
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::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;
HSQUIRRELVM vm; /**< squirrel thread for the console (with custom roottable) */
HSQOBJECT vm_object;
void process_menu();
std::auto_ptr<Level> level;
void process_menu();
std::auto_ptr<Level> level;
- std::auto_ptr<Surface> statistics_backdrop;
+ SurfacePtr statistics_backdrop;
// scripts
typedef std::vector<HSQOBJECT> ScriptList;
// scripts
typedef std::vector<HSQOBJECT> ScriptList;
#include <string>
#include <vector>
#include <string>
#include <vector>
+#include "video/surface_ptr.hpp"
+
class DrawingContext;
class InfoBoxLine;
class DrawingContext;
class InfoBoxLine;
/** This class is displaying a box with information text inside the game */
class InfoBox
/** 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;
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&);
private:
InfoBox(const InfoBox&);
font(Resources::normal_font),
color(),
text(text),
font(Resources::normal_font),
color(),
text(text),
{
font = get_font_by_format_char(format_char);
lineType = get_linetype_by_format_char(format_char);
{
font = get_font_by_format_char(format_char);
lineType = get_linetype_by_format_char(format_char);
#include <memory>
#include "video/color.hpp"
#include <memory>
#include "video/color.hpp"
+#include "video/surface_ptr.hpp"
class DrawingContext;
class Font;
class Rectf;
class DrawingContext;
class Font;
class Rectf;
/**
* Helper class for InfoBox: Represents a line of text
/**
* Helper class for InfoBox: Represents a line of text
Font* font;
Color color;
std::string text;
Font* font;
Color color;
std::string text;
- std::auto_ptr<Surface> image;
private:
InfoBoxLine(const InfoBoxLine&);
private:
InfoBoxLine(const InfoBoxLine&);
#include "util/reader_fwd.hpp"
#include "util/writer_fwd.hpp"
#include "video/color.hpp"
#include "util/reader_fwd.hpp"
#include "util/writer_fwd.hpp"
#include "video/color.hpp"
+#include "video/surface_ptr.hpp"
static const float BORDER_X = 10;
static const float BORDER_Y = 10;
static const float BORDER_X = 10;
static const float BORDER_Y = 10;
int max_ice_bullets; /**< maximum number of ice bullets in play */
private:
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&);
private:
PlayerStatus(const PlayerStatus&);
#include "supertux/screen.hpp"
#include "video/color.hpp"
#include "supertux/screen.hpp"
#include "video/color.hpp"
+#include "video/surface_ptr.hpp"
class Font;
class InfoBoxLine;
class Font;
class InfoBoxLine;
float defaultspeed;
float speed;
std::string music;
float defaultspeed;
float speed;
std::string music;
- std::auto_ptr<Surface> background;
std::vector<InfoBoxLine*> lines;
float scroll;
bool fading;
std::vector<InfoBoxLine*> lines;
float scroll;
bool fading;
private:
std::auto_ptr<MainMenu> main_menu;
private:
std::auto_ptr<MainMenu> main_menu;
- std::auto_ptr<Surface> frame;
std::auto_ptr<CodeController> controller;
std::auto_ptr<GameSession> titlesession;
std::auto_ptr<CodeController> controller;
std::auto_ptr<GameSession> titlesession;
#include "video/texture.hpp"
#include "video/video_systems.hpp"
#include "video/texture.hpp"
#include "video/video_systems.hpp"
Surface::create(const std::string& file)
{
Surface::create(const std::string& file)
{
- return std::auto_ptr<Surface>(new Surface(file));
+ return SurfacePtr(new Surface(file));
Surface::create(const std::string& file, const Rect& rect)
{
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) :
}
Surface::Surface(const std::string& file) :
#include "math/vector.hpp"
#include "math/rect.hpp"
#include "math/vector.hpp"
#include "math/rect.hpp"
+#include "video/surface_ptr.hpp"
class Texture;
class SurfaceData;
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 */
- 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;
private:
Texture* texture;
int get_width() const;
int get_height() const;
Vector get_position() const;
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;
};
Vector get_size() const;
};