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 marked, shared_ptr 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 //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 _marked; + std::shared_ptr marked; //Holds the graphic for a button that is not selected - std::shared_ptr _unmarked; + std::shared_ptr 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;