Skip to content

Commit

Permalink
Change std::unqiue_ptr to pimpl
Browse files Browse the repository at this point in the history
That way it can never be null, and we don't have to use an explicit call to `new`.
  • Loading branch information
BevapDin authored and kevingranade committed Dec 22, 2019
1 parent b31ae9d commit 0ddca0d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/cata_tiles.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ formatted_text::formatted_text( const std::string &text, const int color,

cata_tiles::cata_tiles( const SDL_Renderer_Ptr &renderer ) :
renderer( renderer ),
minimap( new pixel_minimap( renderer ) )
minimap( renderer )
{
assert( renderer );

Expand Down
3 changes: 2 additions & 1 deletion src/cata_tiles.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#include "enums.h"
#include "weighted_list.h"
#include "point.h"
#include "pimpl.h"

class Creature;
class player;
Expand Down Expand Up @@ -573,7 +574,7 @@ class cata_tiles
*/
bool nv_goggles_activated;

std::unique_ptr<pixel_minimap> minimap;
pimpl<pixel_minimap> minimap;

public:
std::string memory_map_mode = "color_pixel_sepia";
Expand Down

0 comments on commit 0ddca0d

Please sign in to comment.