diff --git a/src/framework/CMakeLists.txt b/src/framework/CMakeLists.txt index 5c44d9c1..c65aeed3 100644 --- a/src/framework/CMakeLists.txt +++ b/src/framework/CMakeLists.txt @@ -21,8 +21,8 @@ IF(CMAKE_SIZEOF_VOID_P EQUAL 8) ELSE() SET(ARCH_FLAGS "-m32 -march=i686 -mtune=generic") ENDIF() -SET(WARNS_FLAGS "-Wall -Wextra -Werror -Wno-unused-parameter -Wno-unused-but-set-variable") -SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CXX_WARNS} ${ARCH_FLAGS} -std=gnu++0x -pipe") +SET(WARNS_FLAGS "-Wall -Wextra -Werror -Wno-unused-parameter -Wno-unused-but-set-variable -Wno-unused-variable") +SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${WARNS_FLAGS} ${ARCH_FLAGS} -std=gnu++0x -pipe") SET(CMAKE_CXX_FLAGS_DEBUG "-O0 -ggdb") SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O1 -ggdb -fno-omit-frame-pointer") SET(CMAKE_CXX_FLAGS_RELEASE "-O2") diff --git a/src/framework/stdext/cast.h b/src/framework/stdext/cast.h index ca0dca1a..025d0275 100644 --- a/src/framework/stdext/cast.h +++ b/src/framework/stdext/cast.h @@ -93,7 +93,7 @@ public: void update_what() { m_what = format("failed to cast value of type '%s' to type '%s'", demangle_type(), demangle_type()); } - virtual const char* what() { return m_what.c_str(); } + virtual const char* what() const throw() { return m_what.c_str(); } private: std::string m_what; }; diff --git a/src/otclient/core/animatedtext.cpp b/src/otclient/core/animatedtext.cpp index 910e3679..aa4ed8d7 100644 --- a/src/otclient/core/animatedtext.cpp +++ b/src/otclient/core/animatedtext.cpp @@ -32,7 +32,7 @@ AnimatedText::AnimatedText() m_cachedText.setAlign(Fw::AlignLeft); } -void AnimatedText::draw(const Point& dest, const Rect& visibleRect) +void AnimatedText::drawText(const Point& dest, const Rect& visibleRect) { Point p = dest; Size textSize = m_cachedText.getTextSize(); diff --git a/src/otclient/core/animatedtext.h b/src/otclient/core/animatedtext.h index cba58891..2a1cd1aa 100644 --- a/src/otclient/core/animatedtext.h +++ b/src/otclient/core/animatedtext.h @@ -33,7 +33,7 @@ class AnimatedText : public Thing public: AnimatedText(); - void draw(const Point& dest, const Rect& visibleRect); + void drawText(const Point& dest, const Rect& visibleRect); void startAnimation(); void setColor(int color); diff --git a/src/otclient/core/mapview.cpp b/src/otclient/core/mapview.cpp index dc9cded2..73975a8f 100644 --- a/src/otclient/core/mapview.cpp +++ b/src/otclient/core/mapview.cpp @@ -177,7 +177,7 @@ void MapView::draw(const Rect& rect) p.x = p.x * horizontalStretchFactor; p.y = p.y * verticalStretchFactor; p += rect.topLeft(); - staticText->draw(p, rect); + staticText->drawText(p, rect); } for(const AnimatedTextPtr& animatedText : g_map.getAnimatedTexts()) { @@ -195,7 +195,7 @@ void MapView::draw(const Rect& rect) p.x = p.x * horizontalStretchFactor; p.y = p.y * verticalStretchFactor; p += rect.topLeft(); - animatedText->draw(p, rect); + animatedText->drawText(p, rect); } } else if(m_viewMode > NEAR_VIEW) { // draw a cross in the center instead of our creature diff --git a/src/otclient/core/statictext.cpp b/src/otclient/core/statictext.cpp index 71e4ba56..1f187d1f 100644 --- a/src/otclient/core/statictext.cpp +++ b/src/otclient/core/statictext.cpp @@ -32,7 +32,7 @@ StaticText::StaticText() m_cachedText.setAlign(Fw::AlignCenter); } -void StaticText::draw(const Point& dest, const Rect& parentRect) +void StaticText::drawText(const Point& dest, const Rect& parentRect) { Size textSize = m_cachedText.getTextSize(); Rect rect = Rect(dest - Point(textSize.width() / 2, textSize.height()) + Point(20, 5), textSize); diff --git a/src/otclient/core/statictext.h b/src/otclient/core/statictext.h index 66ae774e..0036dbcc 100644 --- a/src/otclient/core/statictext.h +++ b/src/otclient/core/statictext.h @@ -33,7 +33,7 @@ class StaticText : public Thing public: StaticText(); - void draw(const Point& dest, const Rect& parentRect); + void drawText(const Point& dest, const Rect& parentRect); std::string getName() { return m_name; } Otc::SpeakType getMessageType() { return m_messageType; } diff --git a/src/otclient/core/thingtype.h b/src/otclient/core/thingtype.h index e396271a..3864904e 100644 --- a/src/otclient/core/thingtype.h +++ b/src/otclient/core/thingtype.h @@ -27,8 +27,9 @@ #include #include -struct ThingType +class ThingType { +public: enum Dimension { Width = 0, Height,