diff --git a/src/framework/core/application.h b/src/framework/core/application.h index fc9944fc..9f57ac34 100644 --- a/src/framework/core/application.h +++ b/src/framework/core/application.h @@ -68,8 +68,8 @@ protected: std::string m_appCompactName; std::string m_appVersion; std::string m_startupOptions; - bool m_running = false; - bool m_stopping = false; + stdext::boolean m_running; + stdext::boolean m_stopping; stdext::boolean m_terminated; }; diff --git a/src/framework/core/eventdispatcher.h b/src/framework/core/eventdispatcher.h index dbe3361e..0ff483cd 100644 --- a/src/framework/core/eventdispatcher.h +++ b/src/framework/core/eventdispatcher.h @@ -40,7 +40,7 @@ public: private: std::list m_eventList; int m_pollEventsSize; - bool m_disabled = false; + stdext::boolean m_disabled; std::priority_queue, lessScheduledEvent> m_scheduledEventList; }; diff --git a/src/framework/core/graphicalapplication.h b/src/framework/core/graphicalapplication.h index 2feadc82..3fc4fc9f 100644 --- a/src/framework/core/graphicalapplication.h +++ b/src/framework/core/graphicalapplication.h @@ -60,8 +60,8 @@ protected: void inputEvent(const InputEvent& event); private: - bool m_onInputEvent = false; - bool m_mustRepaint = false; + stdext::boolean m_onInputEvent; + stdext::boolean m_mustRepaint; AdaptativeFrameCounter m_backgroundFrameCounter; AdaptativeFrameCounter m_foregroundFrameCounter; TexturePtr m_foreground; diff --git a/src/framework/core/module.h b/src/framework/core/module.h index 75c4b26b..bf3eb866 100644 --- a/src/framework/core/module.h +++ b/src/framework/core/module.h @@ -63,10 +63,10 @@ protected: friend class ModuleManager; private: - bool m_loaded = false; - bool m_autoLoad = false; - bool m_reloadable = false; - bool m_sandboxed = false; + stdext::boolean m_loaded; + stdext::boolean m_autoLoad; + stdext::boolean m_reloadable; + stdext::boolean m_sandboxed; int m_autoLoadPriority; int m_sandboxEnv; std::tuple m_onLoadFunc; diff --git a/src/framework/core/resourcemanager.h b/src/framework/core/resourcemanager.h index d970899c..89a39f05 100644 --- a/src/framework/core/resourcemanager.h +++ b/src/framework/core/resourcemanager.h @@ -72,7 +72,7 @@ public: private: std::string m_workDir; std::string m_writeDir; - bool m_hasSearchPath = false; + stdext::boolean m_hasSearchPath; std::deque m_searchPaths; }; diff --git a/src/framework/core/timer.h b/src/framework/core/timer.h index fe338cb1..5a2b82c1 100644 --- a/src/framework/core/timer.h +++ b/src/framework/core/timer.h @@ -41,7 +41,7 @@ public: private: ticks_t m_startTicks; - bool m_stopped = false; + stdext::boolean m_stopped; }; #endif diff --git a/src/framework/graphics/cachedtext.h b/src/framework/graphics/cachedtext.h index 7fed574f..4db2f07b 100644 --- a/src/framework/graphics/cachedtext.h +++ b/src/framework/graphics/cachedtext.h @@ -48,7 +48,7 @@ private: std::string m_text; Size m_textSize; - bool m_textMustRecache = true; + stdext::boolean m_textMustRecache; CoordsBuffer m_textCoordsBuffer; Rect m_textCachedScreenCoords; BitmapFontPtr m_font; diff --git a/src/framework/graphics/framebuffer.h b/src/framework/graphics/framebuffer.h index 22c24303..4645313f 100644 --- a/src/framework/graphics/framebuffer.h +++ b/src/framework/graphics/framebuffer.h @@ -61,8 +61,8 @@ private: Size m_oldViewportSize; uint m_fbo; uint m_prevBoundFbo; - bool m_backuping = true; - bool m_smooth = true; + stdext::boolean m_backuping; + stdext::boolean m_smooth; static uint boundFbo; }; diff --git a/src/framework/graphics/graphics.h b/src/framework/graphics/graphics.h index f02521a7..c817c659 100644 --- a/src/framework/graphics/graphics.h +++ b/src/framework/graphics/graphics.h @@ -77,16 +77,16 @@ private: int m_maxTextureSize; int m_alphaBits; - bool m_ok = false; - bool m_useDrawArrays = true; - bool m_useFBO = true; - bool m_useHardwareBuffers = false; - bool m_useBilinearFiltering = true; - bool m_useNonPowerOfTwoTextures = true; - bool m_useMipmaps = true; - bool m_useHardwareMipmaps = true; - bool m_useClampToEdge = true; - bool m_cacheBackbuffer = true; + stdext::boolean m_ok; + stdext::boolean m_useDrawArrays; + stdext::boolean m_useFBO; + stdext::boolean m_useHardwareBuffers; + stdext::boolean m_useBilinearFiltering; + stdext::boolean m_useNonPowerOfTwoTextures; + stdext::boolean m_useMipmaps; + stdext::boolean m_useHardwareMipmaps; + stdext::boolean m_useClampToEdge; + stdext::boolean m_cacheBackbuffer; PainterEngine m_prefferedPainterEngine; PainterEngine m_selectedPainterEngine; }; diff --git a/src/framework/graphics/painterogl1.h b/src/framework/graphics/painterogl1.h index 995eebcd..0d0bc1d0 100644 --- a/src/framework/graphics/painterogl1.h +++ b/src/framework/graphics/painterogl1.h @@ -72,7 +72,7 @@ private: void updateGlTextureState(); GLenum m_matrixMode; - bool m_textureEnabled = false; + stdext::boolean m_textureEnabled; }; extern PainterOGL1 *g_painterOGL1; diff --git a/src/framework/graphics/texture.h b/src/framework/graphics/texture.h index e87b3607..6498183c 100644 --- a/src/framework/graphics/texture.h +++ b/src/framework/graphics/texture.h @@ -63,10 +63,10 @@ protected: Size m_size; Size m_glSize; Matrix3 m_transformMatrix; - bool m_hasMipmaps = false; - bool m_smooth = false; - bool m_upsideDown = false; - bool m_repeat = false; + stdext::boolean m_hasMipmaps; + stdext::boolean m_smooth; + stdext::boolean m_upsideDown; + stdext::boolean m_repeat; }; #endif diff --git a/src/framework/platform/platformwindow.h b/src/framework/platform/platformwindow.h index df9af277..989af504 100644 --- a/src/framework/platform/platformwindow.h +++ b/src/framework/platform/platformwindow.h @@ -111,11 +111,11 @@ protected: InputEvent m_inputEvent; stdext::boolean m_mouseButtonStates[4]; - bool m_created = false; - bool m_visible = false; - bool m_focused = false; - bool m_fullscreen = false; - bool m_maximized = false; + stdext::boolean m_created; + stdext::boolean m_visible; + stdext::boolean m_focused; + stdext::boolean m_fullscreen; + stdext::boolean m_maximized; std::function m_onClose; OnResizeCallback m_onResize; diff --git a/src/framework/sound/soundmanager.h b/src/framework/sound/soundmanager.h index 7a9c2108..b5b3a78f 100644 --- a/src/framework/sound/soundmanager.h +++ b/src/framework/sound/soundmanager.h @@ -61,8 +61,8 @@ private: SoundSourcePtr m_musicSource; ALCdevice *m_device; ALCcontext *m_context; - bool m_musicEnabled = false; - bool m_soundEnabled = false; + stdext::boolean m_musicEnabled; + stdext::boolean m_soundEnabled; std::string m_currentMusic; }; diff --git a/src/framework/sound/streamsoundsource.h b/src/framework/sound/streamsoundsource.h index 86c2143d..8c9fc693 100644 --- a/src/framework/sound/streamsoundsource.h +++ b/src/framework/sound/streamsoundsource.h @@ -56,7 +56,7 @@ private: SoundFilePtr m_soundFile; std::array m_buffers; DownMix m_downMix; - bool m_looping = false; + stdext::boolean m_looping; }; #endif diff --git a/src/framework/stdext/attrib_storage.h b/src/framework/stdext/attrib_storage.h index 029029bc..d203573c 100644 --- a/src/framework/stdext/attrib_storage.h +++ b/src/framework/stdext/attrib_storage.h @@ -34,6 +34,7 @@ namespace stdext { class attrib_storage { public: + attrib_storage() : m_attribs(nullptr), m_size(0) { } ~attrib_storage() { if(m_attribs) delete[] m_attribs; } template @@ -74,8 +75,8 @@ public: } private: - std::tuple* m_attribs = nullptr; - uint8 m_size = 0; + std::tuple* m_attribs; + uint8 m_size; }; // restore memory alignment diff --git a/src/framework/stdext/compiler.h b/src/framework/stdext/compiler.h index e09521c9..061dcf7a 100644 --- a/src/framework/stdext/compiler.h +++ b/src/framework/stdext/compiler.h @@ -27,8 +27,8 @@ // clang is supported #undef _GLIBCXX_USE_FLOAT128 #elif defined(__GNUC__) - #if !(__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 7)) - #error "Sorry, you need gcc 4.7 or greater to compile." + #if !(__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) + #error "Sorry, you need gcc 4.6 or greater to compile." #endif #else #error "Compiler not supported." diff --git a/src/framework/ui/uiboxlayout.h b/src/framework/ui/uiboxlayout.h index 9965c1c3..833d019b 100644 --- a/src/framework/ui/uiboxlayout.h +++ b/src/framework/ui/uiboxlayout.h @@ -41,7 +41,7 @@ public: bool isUIBoxLayout() { return true; } protected: - bool m_fitChildren = false; + stdext::boolean m_fitChildren; int m_spacing; }; diff --git a/src/framework/ui/uigridlayout.h b/src/framework/ui/uigridlayout.h index 7d299c73..6891ee7f 100644 --- a/src/framework/ui/uigridlayout.h +++ b/src/framework/ui/uigridlayout.h @@ -55,9 +55,9 @@ private: int m_cellSpacing; int m_numColumns; int m_numLines; - bool m_autoSpacing = false; - bool m_fitChildren = false; - bool m_flow = false; + stdext::boolean m_autoSpacing; + stdext::boolean m_fitChildren; + stdext::boolean m_flow; }; #endif diff --git a/src/framework/ui/uihorizontallayout.h b/src/framework/ui/uihorizontallayout.h index a23a1fcf..d7410d66 100644 --- a/src/framework/ui/uihorizontallayout.h +++ b/src/framework/ui/uihorizontallayout.h @@ -39,7 +39,7 @@ public: protected: bool internalUpdate(); - bool m_alignRight = false; + stdext::boolean m_alignRight; }; #endif diff --git a/src/framework/ui/uilayout.h b/src/framework/ui/uilayout.h index 5187e559..25e7dd6a 100644 --- a/src/framework/ui/uilayout.h +++ b/src/framework/ui/uilayout.h @@ -58,8 +58,8 @@ protected: virtual bool internalUpdate() = 0; int m_updateDisabled; - bool m_updating = false; - bool m_updateScheduled = false; + stdext::boolean m_updating; + stdext::boolean m_updateScheduled; UIWidgetPtr m_parentWidget; }; diff --git a/src/framework/ui/uimanager.h b/src/framework/ui/uimanager.h index 31f63ba4..2c25ef93 100644 --- a/src/framework/ui/uimanager.h +++ b/src/framework/ui/uimanager.h @@ -82,8 +82,8 @@ private: UIWidgetPtr m_draggingWidget; UIWidgetPtr m_hoveredWidget; UIWidgetPtr m_pressedWidget; - bool m_hoverUpdateScheduled = false; - bool m_drawDebugBoxes = false; + stdext::boolean m_hoverUpdateScheduled; + stdext::boolean m_drawDebugBoxes; std::unordered_map m_styles; UIWidgetList m_destroyedWidgets; ScheduledEventPtr m_checkEvent; diff --git a/src/otclient/creatures.cpp b/src/otclient/creatures.cpp index e7276617..091969e6 100644 --- a/src/otclient/creatures.cpp +++ b/src/otclient/creatures.cpp @@ -98,6 +98,7 @@ bool Creatures::m_loadCreatureBuffer(TiXmlElement* attrib, const CreatureTypePtr return true; Outfit out; + out.setCategory(ThingCategoryCreature); int32 type; if(!attrib->Attribute("type").empty()) type = attrib->readType("type"); diff --git a/src/otclient/map.cpp b/src/otclient/map.cpp index 0c60380b..68da1704 100644 --- a/src/otclient/map.cpp +++ b/src/otclient/map.cpp @@ -122,7 +122,7 @@ void Map::loadOtbm(const std::string& fileName) setHouseFile(fileName.substr(0, fileName.rfind('/') + 1) + tmp); break; default: - stdext::throw_exception(stdext::format("Invalid attribute '%c'", attribute)); + stdext::throw_exception(stdext::format("Invalid attribute '%d'", (int)attribute)); } } diff --git a/src/otclient/map.h b/src/otclient/map.h index 7d3cf4d1..31d2be6c 100644 --- a/src/otclient/map.h +++ b/src/otclient/map.h @@ -129,7 +129,6 @@ enum clientVersion_t CLIENT_VERSION_960 = 40 }; - enum { OTCM_SIGNATURE = 0x4D43544F, OTCM_VERSION = 1