git repos / blockattack-game

commit 78ab168e

sago007 · 2015-11-14 22:02
78ab168ed39f8f8a85269198ad3f84654a242854 patch · browse files
parent 33f4e975a1f923c8b330bf0802069dca1fbf6c4f

Ask scons to use c++11

Changed files

M SConstruct before
M source/code/MenuSystem.cpp before
M source/code/MenuSystem.h before
diff --git a/SConstruct b/SConstruct index 5b55781..eebed40 100644 --- a/SConstruct +++ b/SConstruct
@@ -7,6 +7,7 @@ opts.Add('sharedir', 'Directory to use to store data file', '$prefix/share/block
opts.Add('bindir', 'Directory to use to store data file', '$prefix/bin')
opts.Add('mandir', 'Directory to use to store data file', '$prefix/share/man')
opts.Add('CXX', 'C++ compiler to use', os.environ['CXX'])
+opts.Add('CXXFLAGS', 'C++ flags', "-std=c++11")
# Copy Build Environment #
diff --git a/source/code/MenuSystem.cpp b/source/code/MenuSystem.cpp index 74fb373..d53b1b4 100644 --- a/source/code/MenuSystem.cpp +++ b/source/code/MenuSystem.cpp
@@ -55,8 +55,8 @@ ButtonGfx standardButton;
void ButtonGfx::setSurfaces(shared_ptr<CppSdl::CppSdlImageHolder> marked, shared_ptr<CppSdl::CppSdlImageHolder> unmarked)
{
- ButtonGfx::_marked = marked;
- ButtonGfx::_unmarked = unmarked;
+ this->marked = marked;
+ this->unmarked = unmarked;
xsize=(marked)->GetWidth();
ysize=(marked)->GetHeight();
if(verboseLevel)
@@ -117,9 +117,9 @@ void Button::drawTo(SDL_Surface **surface)
//cout << "Painting button: " << label << " at: " << x << "," << y << endl;
#endif
if (marked)
- gfx->_marked->PaintTo(*surface,x,y);
+ gfx->marked->PaintTo(*surface,x,y);
else
- gfx->_unmarked->PaintTo(*surface,x,y);
+ gfx->unmarked->PaintTo(*surface,x,y);
//int stringx = x + (ButtonGfx::xsize)/2 - ButtonGfx::ttf->getTextWidth(label)/2;
//int stringy = y + (ButtonGfx::ysize)/2 - ButtonGfx::ttf->getTextHeight()/2;
//ButtonGfx::ttf->writeText(label,surface,stringx,stringy);
diff --git a/source/code/MenuSystem.h b/source/code/MenuSystem.h index 67ba7a6..b0afee4 100644 --- a/source/code/MenuSystem.h +++ b/source/code/MenuSystem.h
@@ -33,13 +33,12 @@ http://blockattack.sf.net
#include <memory>
//The ButtonGfx object hold common media for all buttons, so we can reskin them by only changeing one pointer
-class ButtonGfx
+struct ButtonGfx
{
-public:
//Holds the graphic for a button that is selected
- std::shared_ptr<CppSdl::CppSdlImageHolder> _marked;
+ std::shared_ptr<CppSdl::CppSdlImageHolder> marked;
//Holds the graphic for a button that is not selected
- std::shared_ptr<CppSdl::CppSdlImageHolder> _unmarked;
+ std::shared_ptr<CppSdl::CppSdlImageHolder> unmarked;
//The size of the buttons, so we don't have to ask w and h from the SDL Surfaces each time
int xsize;
int ysize;