diff --git a/CMakeLists.txt b/CMakeLists.txt index 278ae162..159b5281 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -35,7 +35,8 @@ INCLUDE_DIRECTORIES( ${YAMLCPP_INCLUDE_DIRS} ${PHYSFS_INCLUDE_DIRS} ${GMP_INCLUDE_DIR} - ${PNG_INCLUDE_DIRS}) + ${PNG_INCLUDE_DIRS} + "${CMAKE_CURRENT_SOURCE_DIR}/src/framework") LINK_DIRECTORIES( ${Boost_LIBRARY_DIRS} @@ -55,30 +56,34 @@ SET(SOURCES # game sources src/main.cpp src/menustate.cpp - src/mainmenu.cpp src/teststate.cpp # game net src/net/protocoltibia87.cpp -# framework sources - src/framework/image.cpp - src/framework/borderedimage.cpp - src/framework/dispatcher.cpp - src/framework/framebuffer.cpp - src/framework/font.cpp - src/framework/fonts.cpp - src/framework/textureloader.cpp - src/framework/texture.cpp - src/framework/textures.cpp - src/framework/configs.cpp - src/framework/resources.cpp - src/framework/engine.cpp - src/framework/graphics.cpp - src/framework/logger.cpp - src/framework/util.cpp - -# ui +# framework core + src/framework/core/dispatcher.cpp + src/framework/core/configs.cpp + src/framework/core/resources.cpp + src/framework/core/engine.cpp + +# framework utilities + src/framework/util/util.cpp + src/framework/util/logger.cpp + src/framework/util/rsa.cpp + +# framework graphics + src/framework/graphics/image.cpp + src/framework/graphics/borderedimage.cpp + src/framework/graphics/framebuffer.cpp + src/framework/graphics/font.cpp + src/framework/graphics/fonts.cpp + src/framework/graphics/textureloader.cpp + src/framework/graphics/texture.cpp + src/framework/graphics/textures.cpp + src/framework/graphics/graphics.cpp + +# framework ui src/framework/ui/anchorlayout.cpp src/framework/ui/uielement.cpp src/framework/ui/uielementskin.cpp @@ -93,21 +98,19 @@ SET(SOURCES src/framework/ui/uitextedit.cpp src/framework/ui/uitexteditskin.cpp -# network +# framework net src/framework/net/connection.cpp src/framework/net/connections.cpp src/framework/net/protocol.cpp src/framework/net/networkmessage.cpp - -# util - src/framework/util/rsa.cpp) +) IF(WIN32) - SET(SOURCES ${SOURCES} src/framework/win32platform.cpp) + SET(SOURCES ${SOURCES} src/framework/platform/win32platform.cpp) SET(ADDITIONAL_LIBRARIES ws2_32) ADD_DEFINITIONS(-D_WIN32_WINNT=0x0501) ELSE(WIN32) - SET(SOURCES ${SOURCES} src/framework/x11platform.cpp) + SET(SOURCES ${SOURCES} src/framework/platform/x11platform.cpp) SET(ADDITIONAL_LIBRARIES pthread GLU) ENDIF(WIN32) diff --git a/src/framework/configs.cpp b/src/framework/core/configs.cpp similarity index 100% rename from src/framework/configs.cpp rename to src/framework/core/configs.cpp diff --git a/src/framework/configs.h b/src/framework/core/configs.h similarity index 100% rename from src/framework/configs.h rename to src/framework/core/configs.h diff --git a/src/framework/dispatcher.cpp b/src/framework/core/dispatcher.cpp similarity index 100% rename from src/framework/dispatcher.cpp rename to src/framework/core/dispatcher.cpp diff --git a/src/framework/dispatcher.h b/src/framework/core/dispatcher.h similarity index 96% rename from src/framework/dispatcher.h rename to src/framework/core/dispatcher.h index 5aa8205b..6fa2f558 100644 --- a/src/framework/dispatcher.h +++ b/src/framework/core/dispatcher.h @@ -50,9 +50,13 @@ class Dispatcher public: Dispatcher() { } + /// Execute scheduled events void poll(int ticks); + /// Add an event void addTask(const Callback& callback); + + /// Schedula an event void scheduleTask(const Callback& callback, int delay); private: diff --git a/src/framework/engine.cpp b/src/framework/core/engine.cpp similarity index 97% rename from src/framework/engine.cpp rename to src/framework/core/engine.cpp index c89229a1..e992b392 100644 --- a/src/framework/engine.cpp +++ b/src/framework/core/engine.cpp @@ -23,12 +23,10 @@ #include "engine.h" -#include "fonts.h" +#include "graphics/fonts.h" #include "platform.h" -#include "graphics.h" -#include "input.h" +#include "graphics/graphics.h" #include "configs.h" -#include "gamestate.h" #include "dispatcher.h" #include "net/connections.h" #include "ui/uicontainer.h" diff --git a/src/framework/engine.h b/src/framework/core/engine.h similarity index 97% rename from src/framework/engine.h rename to src/framework/core/engine.h index 5a85634f..f0762569 100644 --- a/src/framework/engine.h +++ b/src/framework/core/engine.h @@ -26,11 +26,7 @@ #define ENGINE_H #include "prerequisites.h" -#include "size.h" - -struct InputEvent; - -class GameState; +#include "gamestate.h" class Engine { diff --git a/src/framework/gamestate.h b/src/framework/core/gamestate.h similarity index 98% rename from src/framework/gamestate.h rename to src/framework/core/gamestate.h index 37fdd939..23662feb 100644 --- a/src/framework/gamestate.h +++ b/src/framework/core/gamestate.h @@ -25,8 +25,8 @@ #ifndef GAMESTATE_H #define GAMESTATE_H +#include "prerequisites.h" #include "input.h" -#include "size.h" struct InputEvent; diff --git a/src/framework/input.h b/src/framework/core/input.h similarity index 98% rename from src/framework/input.h rename to src/framework/core/input.h index 4f74b765..c20a4f73 100644 --- a/src/framework/input.h +++ b/src/framework/core/input.h @@ -190,7 +190,9 @@ enum EEvent { EV_MOUSE_MOVE }; -struct KeyEvent { +struct InputEvent { + EEvent type; + Point mousePos; char keychar; uchar keycode; bool ctrl; @@ -198,16 +200,4 @@ struct KeyEvent { bool alt; }; -struct MouseEvent { - int x, y; -}; - -struct InputEvent { - EEvent type; - union { - KeyEvent key; - MouseEvent mouse; - }; -}; - #endif // INPUT_H diff --git a/src/framework/platform.h b/src/framework/core/platform.h similarity index 100% rename from src/framework/platform.h rename to src/framework/core/platform.h diff --git a/src/framework/resources.cpp b/src/framework/core/resources.cpp similarity index 100% rename from src/framework/resources.cpp rename to src/framework/core/resources.cpp diff --git a/src/framework/resources.h b/src/framework/core/resources.h similarity index 100% rename from src/framework/resources.h rename to src/framework/core/resources.h diff --git a/src/framework/borderedimage.cpp b/src/framework/graphics/borderedimage.cpp similarity index 100% rename from src/framework/borderedimage.cpp rename to src/framework/graphics/borderedimage.cpp diff --git a/src/framework/borderedimage.h b/src/framework/graphics/borderedimage.h similarity index 99% rename from src/framework/borderedimage.h rename to src/framework/graphics/borderedimage.h index d186db17..dfb6ea31 100644 --- a/src/framework/borderedimage.h +++ b/src/framework/graphics/borderedimage.h @@ -27,7 +27,6 @@ #include "prerequisites.h" #include "image.h" -#include "rect.h" #include "texture.h" class BorderedImage : public Image diff --git a/src/framework/font.cpp b/src/framework/graphics/font.cpp similarity index 99% rename from src/framework/font.cpp rename to src/framework/graphics/font.cpp index 4192fac6..56825a58 100644 --- a/src/framework/font.cpp +++ b/src/framework/graphics/font.cpp @@ -23,7 +23,7 @@ #include "font.h" -#include "resources.h" +#include "core/resources.h" #include "textures.h" #include "graphics.h" diff --git a/src/framework/font.h b/src/framework/graphics/font.h similarity index 98% rename from src/framework/font.h rename to src/framework/graphics/font.h index 12d71ee7..82382676 100644 --- a/src/framework/font.h +++ b/src/framework/graphics/font.h @@ -26,9 +26,7 @@ #define FONT_H #include "prerequisites.h" -#include "color.h" #include "texture.h" -#include "rect.h" enum EAlign { ALIGN_TOP = 1 << 0, diff --git a/src/framework/fonts.cpp b/src/framework/graphics/fonts.cpp similarity index 98% rename from src/framework/fonts.cpp rename to src/framework/graphics/fonts.cpp index 09007daa..0966493a 100644 --- a/src/framework/fonts.cpp +++ b/src/framework/graphics/fonts.cpp @@ -24,7 +24,7 @@ #include "fonts.h" #include "font.h" -#include "resources.h" +#include "core/resources.h" Fonts g_fonts; Font *g_defaultFont = NULL; diff --git a/src/framework/fonts.h b/src/framework/graphics/fonts.h similarity index 100% rename from src/framework/fonts.h rename to src/framework/graphics/fonts.h diff --git a/src/framework/framebuffer.cpp b/src/framework/graphics/framebuffer.cpp similarity index 99% rename from src/framework/framebuffer.cpp rename to src/framework/graphics/framebuffer.cpp index a846b553..67722fbf 100644 --- a/src/framework/framebuffer.cpp +++ b/src/framework/graphics/framebuffer.cpp @@ -22,7 +22,7 @@ */ #include "framebuffer.h" -#include "platform.h" +#include "core/platform.h" #include "graphics.h" #include diff --git a/src/framework/framebuffer.h b/src/framework/graphics/framebuffer.h similarity index 100% rename from src/framework/framebuffer.h rename to src/framework/graphics/framebuffer.h diff --git a/src/framework/graphics.cpp b/src/framework/graphics/graphics.cpp similarity index 99% rename from src/framework/graphics.cpp rename to src/framework/graphics/graphics.cpp index d44b1923..8f737171 100644 --- a/src/framework/graphics.cpp +++ b/src/framework/graphics/graphics.cpp @@ -23,7 +23,6 @@ #include "graphics.h" -#include "logger.h" #include "texture.h" #include diff --git a/src/framework/graphics.h b/src/framework/graphics/graphics.h similarity index 98% rename from src/framework/graphics.h rename to src/framework/graphics/graphics.h index 92fa133f..697d2149 100644 --- a/src/framework/graphics.h +++ b/src/framework/graphics/graphics.h @@ -26,9 +26,6 @@ #define GRAPHICS_H #include "prerequisites.h" -#include "rect.h" -#include "size.h" -#include "color.h" class Texture; diff --git a/src/framework/image.cpp b/src/framework/graphics/image.cpp similarity index 100% rename from src/framework/image.cpp rename to src/framework/graphics/image.cpp diff --git a/src/framework/image.h b/src/framework/graphics/image.h similarity index 98% rename from src/framework/image.h rename to src/framework/graphics/image.h index b63875d7..e7fae308 100644 --- a/src/framework/image.h +++ b/src/framework/graphics/image.h @@ -27,7 +27,6 @@ #include "prerequisites.h" #include "texture.h" -#include "rect.h" class Image { diff --git a/src/framework/texture.cpp b/src/framework/graphics/texture.cpp similarity index 100% rename from src/framework/texture.cpp rename to src/framework/graphics/texture.cpp diff --git a/src/framework/texture.h b/src/framework/graphics/texture.h similarity index 96% rename from src/framework/texture.h rename to src/framework/graphics/texture.h index e80112af..eafdb835 100644 --- a/src/framework/texture.h +++ b/src/framework/graphics/texture.h @@ -26,7 +26,6 @@ #define TEXTURE_H #include "prerequisites.h" -#include "size.h" class Textures; @@ -40,10 +39,14 @@ public: /// Enable texture bilinear filter (smooth scaled textures) void enableBilinearFilter(); - const Size& getSize() const { return m_size; } + /// Get OpenGL texture id uint getTextureId() const { return m_textureId; } + + /// Copy pixels from OpenGL texture uchar *getPixels(); + const Size& getSize() const { return m_size; } + private: uint m_textureId; Size m_size; diff --git a/src/framework/textureloader.cpp b/src/framework/graphics/textureloader.cpp similarity index 100% rename from src/framework/textureloader.cpp rename to src/framework/graphics/textureloader.cpp diff --git a/src/framework/textureloader.h b/src/framework/graphics/textureloader.h similarity index 100% rename from src/framework/textureloader.h rename to src/framework/graphics/textureloader.h diff --git a/src/framework/textures.cpp b/src/framework/graphics/textures.cpp similarity index 98% rename from src/framework/textures.cpp rename to src/framework/graphics/textures.cpp index 3fc3db3b..77d919cb 100644 --- a/src/framework/textures.cpp +++ b/src/framework/graphics/textures.cpp @@ -23,7 +23,7 @@ #include "textures.h" -#include "resources.h" +#include "core/resources.h" #include "textureloader.h" Textures g_textures; diff --git a/src/framework/textures.h b/src/framework/graphics/textures.h similarity index 96% rename from src/framework/textures.h rename to src/framework/graphics/textures.h index e16991b4..161a11e2 100644 --- a/src/framework/textures.h +++ b/src/framework/graphics/textures.h @@ -39,7 +39,7 @@ public: TexturePtr get(const std::string& textureFile); private: - typedef std::map TexturesMap; + typedef std::map TexturesMap; TexturesMap m_texturesMap; }; diff --git a/src/framework/net/connection.h b/src/framework/net/connection.h index 53bb03f4..50301074 100644 --- a/src/framework/net/connection.h +++ b/src/framework/net/connection.h @@ -24,7 +24,7 @@ #ifndef CONNECTION_H #define CONNECTION_H -#include "../prerequisites.h" +#include "prerequisites.h" #include diff --git a/src/framework/net/connections.h b/src/framework/net/connections.h index c22b452b..0063086c 100644 --- a/src/framework/net/connections.h +++ b/src/framework/net/connections.h @@ -24,7 +24,7 @@ #ifndef CONNECTIONS_H #define CONNECTIONS_H -#include "../prerequisites.h" +#include "prerequisites.h" #include "connection.h" diff --git a/src/framework/net/networkmessage.h b/src/framework/net/networkmessage.h index 29d75e08..5365ab55 100644 --- a/src/framework/net/networkmessage.h +++ b/src/framework/net/networkmessage.h @@ -24,7 +24,7 @@ #ifndef NETWORKMESSAGE_H #define NETWORKMESSAGE_H -#include "../prerequisites.h" +#include "prerequisites.h" class Rsa; diff --git a/src/framework/net/protocol.h b/src/framework/net/protocol.h index 38539a79..169471a9 100644 --- a/src/framework/net/protocol.h +++ b/src/framework/net/protocol.h @@ -24,7 +24,7 @@ #ifndef PROTOCOL_H #define PROTOCOL_H -#include "../prerequisites.h" +#include "prerequisites.h" #include "connection.h" class Protocol diff --git a/src/framework/win32platform.cpp b/src/framework/platform/win32platform.cpp similarity index 96% rename from src/framework/win32platform.cpp rename to src/framework/platform/win32platform.cpp index a799983c..6fca51dd 100644 --- a/src/framework/win32platform.cpp +++ b/src/framework/platform/win32platform.cpp @@ -23,7 +23,6 @@ #include "platform.h" #include "engine.h" -#include "size.h" #include #include diff --git a/src/framework/x11platform.cpp b/src/framework/platform/x11platform.cpp similarity index 97% rename from src/framework/x11platform.cpp rename to src/framework/platform/x11platform.cpp index a4021596..2e6da100 100644 --- a/src/framework/x11platform.cpp +++ b/src/framework/platform/x11platform.cpp @@ -22,11 +22,8 @@ */ -#include "platform.h" -#include "engine.h" -#include "input.h" -#include "logger.h" -#include "size.h" +#include "core/platform.h" +#include "core/engine.h" #include #include @@ -327,12 +324,12 @@ void Platform::poll() char buf[32]; int len; - inputEvent.key.ctrl = (event.xkey.state & ControlMask); - inputEvent.key.shift = (event.xkey.state & ShiftMask); - inputEvent.key.alt = (event.xkey.state & Mod1Mask); + inputEvent.ctrl = (event.xkey.state & ControlMask); + inputEvent.shift = (event.xkey.state & ShiftMask); + inputEvent.alt = (event.xkey.state & Mod1Mask); // fire enter text event - if(event.type == KeyPress && !inputEvent.key.ctrl && !inputEvent.key.alt) { + if(event.type == KeyPress && !inputEvent.ctrl && !inputEvent.alt) { if(x11.xic) { // with xim we can get latin1 input correctly Status status; len = XmbLookupString(x11.xic, &event.xkey, buf, sizeof(buf), &keysym, &status); @@ -349,8 +346,8 @@ void Platform::poll() ) { //logDebug("char: %c code: %d", buf[0], (uchar)buf[0]); inputEvent.type = EV_TEXT_ENTER; - inputEvent.key.keychar = buf[0]; - inputEvent.key.keycode = KC_UNKNOWN; + inputEvent.keychar = buf[0]; + inputEvent.keycode = KC_UNKNOWN; g_engine.onInputEvent(inputEvent); } } @@ -361,9 +358,9 @@ void Platform::poll() // fire key up/down event if(x11.keyMap.find(keysym) != x11.keyMap.end()) { - inputEvent.key.keycode = x11.keyMap[keysym]; + inputEvent.keycode = x11.keyMap[keysym]; inputEvent.type = (event.type == KeyPress) ? EV_KEY_DOWN : EV_KEY_UP; - inputEvent.key.keychar = (len > 0) ? buf[0] : 0; + inputEvent.keychar = (len > 0) ? buf[0] : 0; g_engine.onInputEvent(inputEvent); } break; @@ -392,8 +389,7 @@ void Platform::poll() case MotionNotify: inputEvent.type = EV_MOUSE_MOVE; - inputEvent.mouse.x = event.xbutton.x; - inputEvent.mouse.y = event.xbutton.y; + inputEvent.mousePos = Point(event.xbutton.x, event.xbutton.y); g_engine.onInputEvent(inputEvent); break; diff --git a/src/framework/prerequisites.h b/src/framework/prerequisites.h index 866fb5a3..224fb6e7 100644 --- a/src/framework/prerequisites.h +++ b/src/framework/prerequisites.h @@ -69,10 +69,12 @@ typedef int8_t int8; // yaml #include -// internal logger -#include "logger.h" - -// additional utilities -#include "util.h" +// common utilities +#include "util/util.h" +#include "util/logger.h" +#include "util/color.h" +#include "util/point.h" +#include "util/size.h" +#include "util/rect.h" #endif // PREREQUISITES_H diff --git a/src/framework/ui/anchorlayout.h b/src/framework/ui/anchorlayout.h index ec3594a7..f217067c 100644 --- a/src/framework/ui/anchorlayout.h +++ b/src/framework/ui/anchorlayout.h @@ -25,8 +25,7 @@ #ifndef ANCHORLAYOUT_H #define ANCHORLAYOUT_H -#include "../prerequisites.h" -#include "../rect.h" +#include "prerequisites.h" #include "uiconstants.h" enum EAnchorType { diff --git a/src/framework/ui/ui.h b/src/framework/ui/ui.h index 27d4d11c..44a4c351 100644 --- a/src/framework/ui/ui.h +++ b/src/framework/ui/ui.h @@ -25,7 +25,7 @@ #ifndef UI_H #define UI_H -#include "../prerequisites.h" +#include "prerequisites.h" #include "uiconstants.h" #include "uielement.h" diff --git a/src/framework/ui/uibutton.cpp b/src/framework/ui/uibutton.cpp index 3e0a4960..935fe3df 100644 --- a/src/framework/ui/uibutton.cpp +++ b/src/framework/ui/uibutton.cpp @@ -23,8 +23,8 @@ #include "uibutton.h" -#include "../fonts.h" -#include "../font.h" +#include "graphics/fonts.h" +#include "graphics/font.h" void UIButton::load(const YAML::Node& node) { @@ -42,11 +42,11 @@ void UIButton::render() bool UIButton::onInputEvent(const InputEvent& event) { if(event.type == EV_MOUSE_LDOWN && - getRect().contains(Point(event.mouse.x, event.mouse.y))) { + getRect().contains(event.mousePos)) { m_state = UI::ButtonDown; } else if(m_state == UI::ButtonDown && event.type == EV_MOUSE_LUP) { m_state = UI::ButtonUp; - if(getRect().contains(Point(event.mouse.x, event.mouse.y))) { + if(getRect().contains(event.mousePos)) { if(m_buttonClickCallback) m_buttonClickCallback(); } diff --git a/src/framework/ui/uibutton.h b/src/framework/ui/uibutton.h index 59ff7f65..fa4dd59b 100644 --- a/src/framework/ui/uibutton.h +++ b/src/framework/ui/uibutton.h @@ -25,9 +25,9 @@ #ifndef UIBUTTON_H #define UIBUTTON_H -#include "../prerequisites.h" +#include "prerequisites.h" #include "uielement.h" -#include "../borderedimage.h" +#include "graphics/borderedimage.h" typedef std::function Callback; diff --git a/src/framework/ui/uibuttonskin.h b/src/framework/ui/uibuttonskin.h index 8caaa0d3..5b2f2222 100644 --- a/src/framework/ui/uibuttonskin.h +++ b/src/framework/ui/uibuttonskin.h @@ -25,7 +25,7 @@ #ifndef UIBUTTONSKIN_H #define UIBUTTONSKIN_H -#include "../prerequisites.h" +#include "prerequisites.h" #include "uiconstants.h" #include "uielementskin.h" diff --git a/src/framework/ui/uicontainer.cpp b/src/framework/ui/uicontainer.cpp index 880b7f7f..6ed80dc5 100644 --- a/src/framework/ui/uicontainer.cpp +++ b/src/framework/ui/uicontainer.cpp @@ -23,7 +23,7 @@ #include "uicontainer.h" -#include "../resources.h" +#include "core/resources.h" #include "uibutton.h" #include "uipanel.h" #include "uilabel.h" diff --git a/src/framework/ui/uicontainer.h b/src/framework/ui/uicontainer.h index c2efd7a9..8b1f5c43 100644 --- a/src/framework/ui/uicontainer.h +++ b/src/framework/ui/uicontainer.h @@ -25,11 +25,8 @@ #ifndef UICONTAINER_H #define UICONTAINER_H -//TODO: make includes paths, so this will be cleaner -#include "../prerequisites.h" +#include "prerequisites.h" #include "uielement.h" -#include "../point.h" -#include "../rect.h" class UIContainer : public UIElement { diff --git a/src/framework/ui/uielement.h b/src/framework/ui/uielement.h index 29b139c1..2c9c7e61 100644 --- a/src/framework/ui/uielement.h +++ b/src/framework/ui/uielement.h @@ -25,9 +25,8 @@ #ifndef UIELEMENT_H #define UIELEMENT_H -#include "../prerequisites.h" -#include "../input.h" -#include "../rect.h" +#include "prerequisites.h" +#include "core/input.h" #include "uiconstants.h" #include "anchorlayout.h" diff --git a/src/framework/ui/uielementskin.cpp b/src/framework/ui/uielementskin.cpp index f5b5928b..cbd50f31 100644 --- a/src/framework/ui/uielementskin.cpp +++ b/src/framework/ui/uielementskin.cpp @@ -24,8 +24,8 @@ #include "uielementskin.h" #include "uielement.h" -#include "../borderedimage.h" -#include "../textures.h" +#include "graphics/borderedimage.h" +#include "graphics/textures.h" #include "uiskins.h" void UIElementSkin::draw(UIElement *element) diff --git a/src/framework/ui/uielementskin.h b/src/framework/ui/uielementskin.h index cd24f39a..190a7057 100644 --- a/src/framework/ui/uielementskin.h +++ b/src/framework/ui/uielementskin.h @@ -25,10 +25,9 @@ #ifndef UIELEMENTSKIN_H #define UIELEMENTSKIN_H -#include "../prerequisites.h" +#include "prerequisites.h" #include "uiconstants.h" -#include "../image.h" -#include "../rect.h" +#include "graphics/image.h" class UIElement; diff --git a/src/framework/ui/uilabel.cpp b/src/framework/ui/uilabel.cpp index 15283864..89c7c6a3 100644 --- a/src/framework/ui/uilabel.cpp +++ b/src/framework/ui/uilabel.cpp @@ -23,7 +23,7 @@ #include "uilabel.h" -#include "../fonts.h" +#include "graphics/fonts.h" UILabel::UILabel(const std::string& text, Font* font) : UIElement(UI::Label), diff --git a/src/framework/ui/uilabel.h b/src/framework/ui/uilabel.h index 2aab2e3b..6b8bd9a6 100644 --- a/src/framework/ui/uilabel.h +++ b/src/framework/ui/uilabel.h @@ -25,7 +25,7 @@ #ifndef UILABEL_H #define UILABEL_H -#include "../prerequisites.h" +#include "prerequisites.h" #include "uielement.h" class Font; diff --git a/src/framework/ui/uipanel.h b/src/framework/ui/uipanel.h index d4f6126d..c78bcb66 100644 --- a/src/framework/ui/uipanel.h +++ b/src/framework/ui/uipanel.h @@ -25,9 +25,9 @@ #ifndef UIPANEL_H #define UIPANEL_H -#include "../prerequisites.h" +#include "prerequisites.h" #include "uicontainer.h" -#include "../borderedimage.h" +#include "graphics/borderedimage.h" class UIPanel : public UIContainer { diff --git a/src/framework/ui/uiskins.cpp b/src/framework/ui/uiskins.cpp index ee296b0d..b7befb1e 100644 --- a/src/framework/ui/uiskins.cpp +++ b/src/framework/ui/uiskins.cpp @@ -23,8 +23,8 @@ #include "uiskins.h" -#include "../resources.h" -#include "../textures.h" +#include "core/resources.h" +#include "graphics/textures.h" #include "uielementskin.h" #include "uibuttonskin.h" #include "uiwindowskin.h" diff --git a/src/framework/ui/uiskins.h b/src/framework/ui/uiskins.h index d240e133..1590ae43 100644 --- a/src/framework/ui/uiskins.h +++ b/src/framework/ui/uiskins.h @@ -25,9 +25,9 @@ #ifndef UISKIN_H #define UISKIN_H -#include "../prerequisites.h" +#include "prerequisites.h" #include "uicontainer.h" -#include "../texture.h" +#include "graphics/texture.h" class UIElementSkin; diff --git a/src/framework/ui/uitextedit.cpp b/src/framework/ui/uitextedit.cpp index 9da68902..c5014e15 100644 --- a/src/framework/ui/uitextedit.cpp +++ b/src/framework/ui/uitextedit.cpp @@ -23,7 +23,7 @@ #include "uitextedit.h" -#include "../fonts.h" +#include "graphics/fonts.h" UITextEdit::UITextEdit(Font* font) : UIElement(UI::TextEdit), diff --git a/src/framework/ui/uitextedit.h b/src/framework/ui/uitextedit.h index 7ada3721..056f554b 100644 --- a/src/framework/ui/uitextedit.h +++ b/src/framework/ui/uitextedit.h @@ -25,7 +25,7 @@ #ifndef UITEXTEDIT_H #define UITEXTEDIT_H -#include "../prerequisites.h" +#include "prerequisites.h" #include "uielement.h" class Font; diff --git a/src/framework/ui/uitexteditskin.h b/src/framework/ui/uitexteditskin.h index 7e79e2cf..29433158 100644 --- a/src/framework/ui/uitexteditskin.h +++ b/src/framework/ui/uitexteditskin.h @@ -25,7 +25,7 @@ #ifndef UITEXTEDITSKIN_H #define UITEXTEDITSKIN_H -#include "../prerequisites.h" +#include "prerequisites.h" #include "uiconstants.h" #include "uielementskin.h" diff --git a/src/framework/ui/uiwindow.h b/src/framework/ui/uiwindow.h index bdd3953a..a3f8a84e 100644 --- a/src/framework/ui/uiwindow.h +++ b/src/framework/ui/uiwindow.h @@ -25,7 +25,7 @@ #ifndef UIWINDOW_H #define UIWINDOW_H -#include "../prerequisites.h" +#include "prerequisites.h" #include "uicontainer.h" class UIWindow : public UIContainer diff --git a/src/framework/ui/uiwindowskin.cpp b/src/framework/ui/uiwindowskin.cpp index e2cfe348..fbb9ceb9 100644 --- a/src/framework/ui/uiwindowskin.cpp +++ b/src/framework/ui/uiwindowskin.cpp @@ -23,7 +23,7 @@ #include "uiwindowskin.h" #include "uiwindow.h" -#include "../fonts.h" +#include "graphics/fonts.h" void UIWindowSkin::draw(UIElement* element) { diff --git a/src/framework/ui/uiwindowskin.h b/src/framework/ui/uiwindowskin.h index 09f917db..29c5fe06 100644 --- a/src/framework/ui/uiwindowskin.h +++ b/src/framework/ui/uiwindowskin.h @@ -24,10 +24,10 @@ #ifndef UIWINDOWSKIN_H #define UIWINDOWSKIN_H -#include "../prerequisites.h" +#include "prerequisites.h" #include "uiconstants.h" #include "uielementskin.h" -#include "../font.h" +#include "graphics/font.h" class UIWindowSkin : public UIElementSkin { diff --git a/src/framework/color.h b/src/framework/util/color.h similarity index 100% rename from src/framework/color.h rename to src/framework/util/color.h diff --git a/src/framework/logger.cpp b/src/framework/util/logger.cpp similarity index 100% rename from src/framework/logger.cpp rename to src/framework/util/logger.cpp diff --git a/src/framework/logger.h b/src/framework/util/logger.h similarity index 100% rename from src/framework/logger.h rename to src/framework/util/logger.h diff --git a/src/framework/point.h b/src/framework/util/point.h similarity index 100% rename from src/framework/point.h rename to src/framework/util/point.h diff --git a/src/framework/rect.h b/src/framework/util/rect.h similarity index 99% rename from src/framework/rect.h rename to src/framework/util/rect.h index 44c12018..ce574d61 100644 --- a/src/framework/rect.h +++ b/src/framework/util/rect.h @@ -26,8 +26,6 @@ #define RECT_H #include "prerequisites.h" -#include "point.h" -#include "size.h" template class TPoint; diff --git a/src/framework/util/rsa.h b/src/framework/util/rsa.h index b7308d1a..6f8f401f 100644 --- a/src/framework/util/rsa.h +++ b/src/framework/util/rsa.h @@ -24,7 +24,7 @@ #ifndef RSA_H #define RSA_H -#include "../prerequisites.h" +#include "prerequisites.h" #include diff --git a/src/framework/size.h b/src/framework/util/size.h similarity index 100% rename from src/framework/size.h rename to src/framework/util/size.h diff --git a/src/framework/util.cpp b/src/framework/util/util.cpp similarity index 100% rename from src/framework/util.cpp rename to src/framework/util/util.cpp diff --git a/src/framework/util.h b/src/framework/util/util.h similarity index 100% rename from src/framework/util.h rename to src/framework/util/util.h diff --git a/src/main.cpp b/src/main.cpp index 0badcbe1..d2ae7282 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -22,14 +22,14 @@ */ -#include "framework/engine.h" -#include "framework/configs.h" -#include "framework/resources.h" -#include "framework/platform.h" +#include "core/engine.h" +#include "core/configs.h" +#include "core/resources.h" +#include "core/platform.h" +#include "core/dispatcher.h" #include "menustate.h" #include "teststate.h" -#include "framework/dispatcher.h" -#include "framework/ui/uiskins.h" +#include "ui/uiskins.h" /// Catches signals so we can exit nicely void signal_handler(int sig) diff --git a/src/menustate.cpp b/src/menustate.cpp index 0b2d9af0..a1c4a462 100644 --- a/src/menustate.cpp +++ b/src/menustate.cpp @@ -23,18 +23,15 @@ #include "menustate.h" -#include "framework/framebuffer.h" -#include "framework/graphics.h" -#include "framework/textures.h" -#include "framework/logger.h" -#include "framework/engine.h" -#include "framework/rect.h" -#include "framework/fonts.h" -#include "framework/input.h" -#include "framework/dispatcher.h" -#include "framework/ui/ui.h" -#include "framework/net/connections.h" -#include "framework/borderedimage.h" +#include "graphics/framebuffer.h" +#include "graphics/graphics.h" +#include "graphics/textures.h" +#include "core/engine.h" +#include "graphics/fonts.h" +#include "core/dispatcher.h" +#include "ui/ui.h" +#include "net/connections.h" +#include "graphics/borderedimage.h" void MenuState::onEnter() diff --git a/src/menustate.h b/src/menustate.h index 686e8569..b71896b4 100644 --- a/src/menustate.h +++ b/src/menustate.h @@ -25,10 +25,10 @@ #ifndef MENUSTATE_H #define MENUSTATE_H -#include "framework/gamestate.h" -#include "framework/texture.h" -#include "framework/net/connection.h" -#include "framework/ui/uipanel.h" +#include "core/gamestate.h" +#include "graphics/texture.h" +#include "net/connection.h" +#include "ui/uipanel.h" class MenuState : public GameState { diff --git a/src/net/protocoltibia87.cpp b/src/net/protocoltibia87.cpp index 8947bf7b..d7f2f83b 100644 --- a/src/net/protocoltibia87.cpp +++ b/src/net/protocoltibia87.cpp @@ -22,7 +22,7 @@ */ #include "protocoltibia87.h" -#include "../framework/util/rsa.h" +#include "util/rsa.h" const char* ProtocolTibia87::rsa = "4673033022358411862216018001503683214873298680851934467521055526294025873980576" "6860224610646919605860206328024326703361630109888417839241959507572247284807035" diff --git a/src/net/protocoltibia87.h b/src/net/protocoltibia87.h index ddf06651..358aef84 100644 --- a/src/net/protocoltibia87.h +++ b/src/net/protocoltibia87.h @@ -24,8 +24,8 @@ #ifndef PROTOCOLTIBIA87_H #define PROTOCOLTIBIA87_H -#include "../framework/prerequisites.h" -#include "../framework/net/protocol.h" +#include "prerequisites.h" +#include "net/protocol.h" class ProtocolTibia87 : public Protocol { diff --git a/src/teststate.cpp b/src/teststate.cpp index fe4ac451..091045e4 100644 --- a/src/teststate.cpp +++ b/src/teststate.cpp @@ -23,13 +23,9 @@ #include "teststate.h" -#include "framework/graphics.h" -#include "framework/logger.h" -#include "framework/engine.h" -#include "framework/input.h" - -#include "framework/net/connections.h" - +#include "graphics/graphics.h" +#include "core/engine.h" +#include "net/connections.h" #include "net/protocoltibia87.h" void TestState::onEnter() diff --git a/src/teststate.h b/src/teststate.h index 9cf69a92..8ea12e95 100644 --- a/src/teststate.h +++ b/src/teststate.h @@ -25,7 +25,7 @@ #ifndef TESTSTATE_H #define TESTSTATE_H -#include "framework/gamestate.h" +#include "core/gamestate.h" #include "net/protocoltibia87.h" class TestState : public GameState