From 05a87dffc3bf3c3e5786efda0c3b6b0f9972373d Mon Sep 17 00:00:00 2001 From: Ingo Ruhnke Date: Sun, 31 Aug 2014 07:42:49 +0200 Subject: [PATCH] Replaced boost::shared_ptr<> with std::shared_ptr<> --- src/object/coin.cpp | 4 ++-- src/object/coin.hpp | 4 ++-- src/object/tilemap.hpp | 10 ++++------ src/sprite/sprite_ptr.hpp | 4 ++-- src/video/font_ptr.hpp | 4 ++-- src/video/gl/gl_lightmap.hpp | 2 +- src/video/gl/gl_painter.cpp | 2 +- src/video/sdl/sdl_painter.cpp | 4 ++-- src/video/surface_ptr.hpp | 4 ++-- src/video/texture_manager.hpp | 4 ++-- src/video/texture_ptr.hpp | 4 ++-- 11 files changed, 22 insertions(+), 24 deletions(-) diff --git a/src/object/coin.cpp b/src/object/coin.cpp index cf82ff3f1..0d3a77105 100644 --- a/src/object/coin.cpp +++ b/src/object/coin.cpp @@ -38,8 +38,8 @@ Coin::Coin(const Vector& pos) Coin::Coin(const Vector& pos, TileMap* tilemap) : MovingSprite(pos, "images/objects/coin/coin.sprite", LAYER_OBJECTS - 1, COLGROUP_TOUCHABLE), - path(boost::shared_ptr(tilemap->get_path())), - walker(boost::shared_ptr(tilemap->get_walker())), + path(std::shared_ptr(tilemap->get_path())), + walker(std::shared_ptr(tilemap->get_walker())), offset(), from_tilemap(true), physic() diff --git a/src/object/coin.hpp b/src/object/coin.hpp index 132a472d3..205d84337 100644 --- a/src/object/coin.hpp +++ b/src/object/coin.hpp @@ -37,8 +37,8 @@ public: virtual void update(float elapsed_time); private: - boost::shared_ptr path; - boost::shared_ptr walker; + std::shared_ptr path; + std::shared_ptr walker; Vector offset; bool from_tilemap; Physic physic; diff --git a/src/object/tilemap.hpp b/src/object/tilemap.hpp index da17b5de1..17e151c3a 100644 --- a/src/object/tilemap.hpp +++ b/src/object/tilemap.hpp @@ -17,8 +17,6 @@ #ifndef HEADER_SUPERTUX_OBJECT_TILEMAP_HPP #define HEADER_SUPERTUX_OBJECT_TILEMAP_HPP -#include - #include "object/path_walker.hpp" #include "supertux/game_object.hpp" #include "supertux/script_interface.hpp" @@ -90,10 +88,10 @@ public: } } - boost::shared_ptr get_path() + std::shared_ptr get_path() { return path; } - boost::shared_ptr get_walker() + std::shared_ptr get_walker() { return walker; } void set_offset(const Vector &offset_) @@ -193,8 +191,8 @@ private: float current_alpha; /**< current tilemap opacity */ float remaining_fade_time; /**< seconds until requested tilemap opacity is reached */ - boost::shared_ptr path; - boost::shared_ptr walker; + std::shared_ptr path; + std::shared_ptr walker; DrawingContext::Target draw_target; /**< set to LIGHTMAP to draw to lightmap */ diff --git a/src/sprite/sprite_ptr.hpp b/src/sprite/sprite_ptr.hpp index 5e48ad3fd..e919abb97 100644 --- a/src/sprite/sprite_ptr.hpp +++ b/src/sprite/sprite_ptr.hpp @@ -17,11 +17,11 @@ #ifndef HEADER_SUPERTUX_SPRITE_SPRITE_PTR_HPP #define HEADER_SUPERTUX_SPRITE_SPRITE_PTR_HPP -#include +#include class Sprite; -typedef boost::shared_ptr SpritePtr; +typedef std::shared_ptr SpritePtr; #endif diff --git a/src/video/font_ptr.hpp b/src/video/font_ptr.hpp index bedc5678a..eb703191c 100644 --- a/src/video/font_ptr.hpp +++ b/src/video/font_ptr.hpp @@ -17,10 +17,10 @@ #ifndef HEADER_SUPERTUX_VIDEO_FONT_PTR_HPP #define HEADER_SUPERTUX_VIDEO_FONT_PTR_HPP -#include +#include class Font; -typedef boost::shared_ptr FontPtr; +typedef std::shared_ptr FontPtr; #endif diff --git a/src/video/gl/gl_lightmap.hpp b/src/video/gl/gl_lightmap.hpp index 9225cd745..786547cf1 100644 --- a/src/video/gl/gl_lightmap.hpp +++ b/src/video/gl/gl_lightmap.hpp @@ -42,7 +42,7 @@ public: private: static const int s_LIGHTMAP_DIV = 5; - boost::shared_ptr m_lightmap; + std::shared_ptr m_lightmap; int m_lightmap_width; int m_lightmap_height; float m_lightmap_uv_right; diff --git a/src/video/gl/gl_painter.cpp b/src/video/gl/gl_painter.cpp index 6ff1d80ec..ecb3cb177 100644 --- a/src/video/gl/gl_painter.cpp +++ b/src/video/gl/gl_painter.cpp @@ -144,7 +144,7 @@ GLPainter::draw_surface_part(const DrawingRequest& request) const SurfacePartRequest* surfacepartrequest = (SurfacePartRequest*) request.request_data; const Surface* surface = surfacepartrequest->surface; - boost::shared_ptr gltexture = boost::dynamic_pointer_cast(surface->get_texture()); + std::shared_ptr gltexture = std::dynamic_pointer_cast(surface->get_texture()); GLSurfaceData *surface_data = reinterpret_cast(surface->get_surface_data()); float uv_width = surface_data->get_uv_right() - surface_data->get_uv_left(); diff --git a/src/video/sdl/sdl_painter.cpp b/src/video/sdl/sdl_painter.cpp index 7f250bb1e..0da8c2860 100644 --- a/src/video/sdl/sdl_painter.cpp +++ b/src/video/sdl/sdl_painter.cpp @@ -59,7 +59,7 @@ void SDLPainter::draw_surface(SDL_Renderer* renderer, const DrawingRequest& request) { const Surface* surface = static_cast(request.request_data)->surface; - boost::shared_ptr sdltexture = boost::dynamic_pointer_cast(surface->get_texture()); + std::shared_ptr sdltexture = std::dynamic_pointer_cast(surface->get_texture()); SDL_Rect dst_rect; dst_rect.x = request.pos.x; @@ -96,7 +96,7 @@ SDLPainter::draw_surface_part(SDL_Renderer* renderer, const DrawingRequest& requ const SurfacePartRequest* surface = (const SurfacePartRequest*) request.request_data; const SurfacePartRequest* surfacepartrequest = (SurfacePartRequest*) request.request_data; - boost::shared_ptr sdltexture = boost::dynamic_pointer_cast(surface->surface->get_texture()); + std::shared_ptr sdltexture = std::dynamic_pointer_cast(surface->surface->get_texture()); SDL_Rect src_rect; src_rect.x = surfacepartrequest->srcrect.p1.x; diff --git a/src/video/surface_ptr.hpp b/src/video/surface_ptr.hpp index c739c56f4..5c35568f0 100644 --- a/src/video/surface_ptr.hpp +++ b/src/video/surface_ptr.hpp @@ -17,10 +17,10 @@ #ifndef HEADER_SUPERTUX_VIDEO_SURFACE_PTR_HPP #define HEADER_SUPERTUX_VIDEO_SURFACE_PTR_HPP -#include +#include class Surface; -typedef boost::shared_ptr SurfacePtr; +typedef std::shared_ptr SurfacePtr; #endif diff --git a/src/video/texture_manager.hpp b/src/video/texture_manager.hpp index 306b40ede..54520e2a2 100644 --- a/src/video/texture_manager.hpp +++ b/src/video/texture_manager.hpp @@ -22,10 +22,10 @@ #include #include +#include #include #include #include -#include #include "util/currenton.hpp" #include "video/glutil.hpp" @@ -55,7 +55,7 @@ public: private: friend class Texture; - typedef std::map > ImageTextures; + typedef std::map > ImageTextures; ImageTextures m_image_textures; typedef std::map Surfaces; diff --git a/src/video/texture_ptr.hpp b/src/video/texture_ptr.hpp index 14321bbb8..1eea17c43 100644 --- a/src/video/texture_ptr.hpp +++ b/src/video/texture_ptr.hpp @@ -17,10 +17,10 @@ #ifndef HEADER_SUPERTUX_VIDEO_TEXTURE_PTR_HPP #define HEADER_SUPERTUX_VIDEO_TEXTURE_PTR_HPP -#include +#include class Texture; -typedef boost::shared_ptr TexturePtr; +typedef std::shared_ptr TexturePtr; #endif -- 2.11.0