refactoring paths and includes
This commit is contained in:
parent
792d661dad
commit
1f78f93096
|
@ -35,7 +35,8 @@ INCLUDE_DIRECTORIES(
|
||||||
${YAMLCPP_INCLUDE_DIRS}
|
${YAMLCPP_INCLUDE_DIRS}
|
||||||
${PHYSFS_INCLUDE_DIRS}
|
${PHYSFS_INCLUDE_DIRS}
|
||||||
${GMP_INCLUDE_DIR}
|
${GMP_INCLUDE_DIR}
|
||||||
${PNG_INCLUDE_DIRS})
|
${PNG_INCLUDE_DIRS}
|
||||||
|
"${CMAKE_CURRENT_SOURCE_DIR}/src/framework")
|
||||||
|
|
||||||
LINK_DIRECTORIES(
|
LINK_DIRECTORIES(
|
||||||
${Boost_LIBRARY_DIRS}
|
${Boost_LIBRARY_DIRS}
|
||||||
|
@ -55,30 +56,34 @@ SET(SOURCES
|
||||||
# game sources
|
# game sources
|
||||||
src/main.cpp
|
src/main.cpp
|
||||||
src/menustate.cpp
|
src/menustate.cpp
|
||||||
src/mainmenu.cpp
|
|
||||||
src/teststate.cpp
|
src/teststate.cpp
|
||||||
|
|
||||||
# game net
|
# game net
|
||||||
src/net/protocoltibia87.cpp
|
src/net/protocoltibia87.cpp
|
||||||
|
|
||||||
# framework sources
|
# framework core
|
||||||
src/framework/image.cpp
|
src/framework/core/dispatcher.cpp
|
||||||
src/framework/borderedimage.cpp
|
src/framework/core/configs.cpp
|
||||||
src/framework/dispatcher.cpp
|
src/framework/core/resources.cpp
|
||||||
src/framework/framebuffer.cpp
|
src/framework/core/engine.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 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/anchorlayout.cpp
|
||||||
src/framework/ui/uielement.cpp
|
src/framework/ui/uielement.cpp
|
||||||
src/framework/ui/uielementskin.cpp
|
src/framework/ui/uielementskin.cpp
|
||||||
|
@ -93,21 +98,19 @@ SET(SOURCES
|
||||||
src/framework/ui/uitextedit.cpp
|
src/framework/ui/uitextedit.cpp
|
||||||
src/framework/ui/uitexteditskin.cpp
|
src/framework/ui/uitexteditskin.cpp
|
||||||
|
|
||||||
# network
|
# framework net
|
||||||
src/framework/net/connection.cpp
|
src/framework/net/connection.cpp
|
||||||
src/framework/net/connections.cpp
|
src/framework/net/connections.cpp
|
||||||
src/framework/net/protocol.cpp
|
src/framework/net/protocol.cpp
|
||||||
src/framework/net/networkmessage.cpp
|
src/framework/net/networkmessage.cpp
|
||||||
|
)
|
||||||
# util
|
|
||||||
src/framework/util/rsa.cpp)
|
|
||||||
|
|
||||||
IF(WIN32)
|
IF(WIN32)
|
||||||
SET(SOURCES ${SOURCES} src/framework/win32platform.cpp)
|
SET(SOURCES ${SOURCES} src/framework/platform/win32platform.cpp)
|
||||||
SET(ADDITIONAL_LIBRARIES ws2_32)
|
SET(ADDITIONAL_LIBRARIES ws2_32)
|
||||||
ADD_DEFINITIONS(-D_WIN32_WINNT=0x0501)
|
ADD_DEFINITIONS(-D_WIN32_WINNT=0x0501)
|
||||||
ELSE(WIN32)
|
ELSE(WIN32)
|
||||||
SET(SOURCES ${SOURCES} src/framework/x11platform.cpp)
|
SET(SOURCES ${SOURCES} src/framework/platform/x11platform.cpp)
|
||||||
SET(ADDITIONAL_LIBRARIES pthread GLU)
|
SET(ADDITIONAL_LIBRARIES pthread GLU)
|
||||||
ENDIF(WIN32)
|
ENDIF(WIN32)
|
||||||
|
|
||||||
|
|
|
@ -50,9 +50,13 @@ class Dispatcher
|
||||||
public:
|
public:
|
||||||
Dispatcher() { }
|
Dispatcher() { }
|
||||||
|
|
||||||
|
/// Execute scheduled events
|
||||||
void poll(int ticks);
|
void poll(int ticks);
|
||||||
|
|
||||||
|
/// Add an event
|
||||||
void addTask(const Callback& callback);
|
void addTask(const Callback& callback);
|
||||||
|
|
||||||
|
/// Schedula an event
|
||||||
void scheduleTask(const Callback& callback, int delay);
|
void scheduleTask(const Callback& callback, int delay);
|
||||||
|
|
||||||
private:
|
private:
|
|
@ -23,12 +23,10 @@
|
||||||
|
|
||||||
|
|
||||||
#include "engine.h"
|
#include "engine.h"
|
||||||
#include "fonts.h"
|
#include "graphics/fonts.h"
|
||||||
#include "platform.h"
|
#include "platform.h"
|
||||||
#include "graphics.h"
|
#include "graphics/graphics.h"
|
||||||
#include "input.h"
|
|
||||||
#include "configs.h"
|
#include "configs.h"
|
||||||
#include "gamestate.h"
|
|
||||||
#include "dispatcher.h"
|
#include "dispatcher.h"
|
||||||
#include "net/connections.h"
|
#include "net/connections.h"
|
||||||
#include "ui/uicontainer.h"
|
#include "ui/uicontainer.h"
|
|
@ -26,11 +26,7 @@
|
||||||
#define ENGINE_H
|
#define ENGINE_H
|
||||||
|
|
||||||
#include "prerequisites.h"
|
#include "prerequisites.h"
|
||||||
#include "size.h"
|
#include "gamestate.h"
|
||||||
|
|
||||||
struct InputEvent;
|
|
||||||
|
|
||||||
class GameState;
|
|
||||||
|
|
||||||
class Engine
|
class Engine
|
||||||
{
|
{
|
|
@ -25,8 +25,8 @@
|
||||||
#ifndef GAMESTATE_H
|
#ifndef GAMESTATE_H
|
||||||
#define GAMESTATE_H
|
#define GAMESTATE_H
|
||||||
|
|
||||||
|
#include "prerequisites.h"
|
||||||
#include "input.h"
|
#include "input.h"
|
||||||
#include "size.h"
|
|
||||||
|
|
||||||
struct InputEvent;
|
struct InputEvent;
|
||||||
|
|
|
@ -190,7 +190,9 @@ enum EEvent {
|
||||||
EV_MOUSE_MOVE
|
EV_MOUSE_MOVE
|
||||||
};
|
};
|
||||||
|
|
||||||
struct KeyEvent {
|
struct InputEvent {
|
||||||
|
EEvent type;
|
||||||
|
Point mousePos;
|
||||||
char keychar;
|
char keychar;
|
||||||
uchar keycode;
|
uchar keycode;
|
||||||
bool ctrl;
|
bool ctrl;
|
||||||
|
@ -198,16 +200,4 @@ struct KeyEvent {
|
||||||
bool alt;
|
bool alt;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct MouseEvent {
|
|
||||||
int x, y;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct InputEvent {
|
|
||||||
EEvent type;
|
|
||||||
union {
|
|
||||||
KeyEvent key;
|
|
||||||
MouseEvent mouse;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif // INPUT_H
|
#endif // INPUT_H
|
|
@ -27,7 +27,6 @@
|
||||||
|
|
||||||
#include "prerequisites.h"
|
#include "prerequisites.h"
|
||||||
#include "image.h"
|
#include "image.h"
|
||||||
#include "rect.h"
|
|
||||||
#include "texture.h"
|
#include "texture.h"
|
||||||
|
|
||||||
class BorderedImage : public Image
|
class BorderedImage : public Image
|
|
@ -23,7 +23,7 @@
|
||||||
|
|
||||||
|
|
||||||
#include "font.h"
|
#include "font.h"
|
||||||
#include "resources.h"
|
#include "core/resources.h"
|
||||||
#include "textures.h"
|
#include "textures.h"
|
||||||
#include "graphics.h"
|
#include "graphics.h"
|
||||||
|
|
|
@ -26,9 +26,7 @@
|
||||||
#define FONT_H
|
#define FONT_H
|
||||||
|
|
||||||
#include "prerequisites.h"
|
#include "prerequisites.h"
|
||||||
#include "color.h"
|
|
||||||
#include "texture.h"
|
#include "texture.h"
|
||||||
#include "rect.h"
|
|
||||||
|
|
||||||
enum EAlign {
|
enum EAlign {
|
||||||
ALIGN_TOP = 1 << 0,
|
ALIGN_TOP = 1 << 0,
|
|
@ -24,7 +24,7 @@
|
||||||
|
|
||||||
#include "fonts.h"
|
#include "fonts.h"
|
||||||
#include "font.h"
|
#include "font.h"
|
||||||
#include "resources.h"
|
#include "core/resources.h"
|
||||||
|
|
||||||
Fonts g_fonts;
|
Fonts g_fonts;
|
||||||
Font *g_defaultFont = NULL;
|
Font *g_defaultFont = NULL;
|
|
@ -22,7 +22,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "framebuffer.h"
|
#include "framebuffer.h"
|
||||||
#include "platform.h"
|
#include "core/platform.h"
|
||||||
#include "graphics.h"
|
#include "graphics.h"
|
||||||
|
|
||||||
#include <GL/gl.h>
|
#include <GL/gl.h>
|
|
@ -23,7 +23,6 @@
|
||||||
|
|
||||||
|
|
||||||
#include "graphics.h"
|
#include "graphics.h"
|
||||||
#include "logger.h"
|
|
||||||
#include "texture.h"
|
#include "texture.h"
|
||||||
|
|
||||||
#include <GL/gl.h>
|
#include <GL/gl.h>
|
|
@ -26,9 +26,6 @@
|
||||||
#define GRAPHICS_H
|
#define GRAPHICS_H
|
||||||
|
|
||||||
#include "prerequisites.h"
|
#include "prerequisites.h"
|
||||||
#include "rect.h"
|
|
||||||
#include "size.h"
|
|
||||||
#include "color.h"
|
|
||||||
|
|
||||||
class Texture;
|
class Texture;
|
||||||
|
|
|
@ -27,7 +27,6 @@
|
||||||
|
|
||||||
#include "prerequisites.h"
|
#include "prerequisites.h"
|
||||||
#include "texture.h"
|
#include "texture.h"
|
||||||
#include "rect.h"
|
|
||||||
|
|
||||||
class Image
|
class Image
|
||||||
{
|
{
|
|
@ -26,7 +26,6 @@
|
||||||
#define TEXTURE_H
|
#define TEXTURE_H
|
||||||
|
|
||||||
#include "prerequisites.h"
|
#include "prerequisites.h"
|
||||||
#include "size.h"
|
|
||||||
|
|
||||||
class Textures;
|
class Textures;
|
||||||
|
|
||||||
|
@ -40,10 +39,14 @@ public:
|
||||||
/// Enable texture bilinear filter (smooth scaled textures)
|
/// Enable texture bilinear filter (smooth scaled textures)
|
||||||
void enableBilinearFilter();
|
void enableBilinearFilter();
|
||||||
|
|
||||||
const Size& getSize() const { return m_size; }
|
/// Get OpenGL texture id
|
||||||
uint getTextureId() const { return m_textureId; }
|
uint getTextureId() const { return m_textureId; }
|
||||||
|
|
||||||
|
/// Copy pixels from OpenGL texture
|
||||||
uchar *getPixels();
|
uchar *getPixels();
|
||||||
|
|
||||||
|
const Size& getSize() const { return m_size; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
uint m_textureId;
|
uint m_textureId;
|
||||||
Size m_size;
|
Size m_size;
|
|
@ -23,7 +23,7 @@
|
||||||
|
|
||||||
|
|
||||||
#include "textures.h"
|
#include "textures.h"
|
||||||
#include "resources.h"
|
#include "core/resources.h"
|
||||||
#include "textureloader.h"
|
#include "textureloader.h"
|
||||||
|
|
||||||
Textures g_textures;
|
Textures g_textures;
|
|
@ -39,7 +39,7 @@ public:
|
||||||
TexturePtr get(const std::string& textureFile);
|
TexturePtr get(const std::string& textureFile);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
typedef std::map<std::string, TextureWeakPtr > TexturesMap;
|
typedef std::map<std::string, TextureWeakPtr> TexturesMap;
|
||||||
TexturesMap m_texturesMap;
|
TexturesMap m_texturesMap;
|
||||||
};
|
};
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
#ifndef CONNECTION_H
|
#ifndef CONNECTION_H
|
||||||
#define CONNECTION_H
|
#define CONNECTION_H
|
||||||
|
|
||||||
#include "../prerequisites.h"
|
#include "prerequisites.h"
|
||||||
|
|
||||||
#include <boost/asio.hpp>
|
#include <boost/asio.hpp>
|
||||||
|
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
#ifndef CONNECTIONS_H
|
#ifndef CONNECTIONS_H
|
||||||
#define CONNECTIONS_H
|
#define CONNECTIONS_H
|
||||||
|
|
||||||
#include "../prerequisites.h"
|
#include "prerequisites.h"
|
||||||
|
|
||||||
#include "connection.h"
|
#include "connection.h"
|
||||||
|
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
#ifndef NETWORKMESSAGE_H
|
#ifndef NETWORKMESSAGE_H
|
||||||
#define NETWORKMESSAGE_H
|
#define NETWORKMESSAGE_H
|
||||||
|
|
||||||
#include "../prerequisites.h"
|
#include "prerequisites.h"
|
||||||
|
|
||||||
class Rsa;
|
class Rsa;
|
||||||
|
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
#ifndef PROTOCOL_H
|
#ifndef PROTOCOL_H
|
||||||
#define PROTOCOL_H
|
#define PROTOCOL_H
|
||||||
|
|
||||||
#include "../prerequisites.h"
|
#include "prerequisites.h"
|
||||||
#include "connection.h"
|
#include "connection.h"
|
||||||
|
|
||||||
class Protocol
|
class Protocol
|
||||||
|
|
|
@ -23,7 +23,6 @@
|
||||||
|
|
||||||
#include "platform.h"
|
#include "platform.h"
|
||||||
#include "engine.h"
|
#include "engine.h"
|
||||||
#include "size.h"
|
|
||||||
|
|
||||||
#include <dir.h>
|
#include <dir.h>
|
||||||
#include <physfs.h>
|
#include <physfs.h>
|
|
@ -22,11 +22,8 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#include "platform.h"
|
#include "core/platform.h"
|
||||||
#include "engine.h"
|
#include "core/engine.h"
|
||||||
#include "input.h"
|
|
||||||
#include "logger.h"
|
|
||||||
#include "size.h"
|
|
||||||
|
|
||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
|
@ -327,12 +324,12 @@ void Platform::poll()
|
||||||
char buf[32];
|
char buf[32];
|
||||||
int len;
|
int len;
|
||||||
|
|
||||||
inputEvent.key.ctrl = (event.xkey.state & ControlMask);
|
inputEvent.ctrl = (event.xkey.state & ControlMask);
|
||||||
inputEvent.key.shift = (event.xkey.state & ShiftMask);
|
inputEvent.shift = (event.xkey.state & ShiftMask);
|
||||||
inputEvent.key.alt = (event.xkey.state & Mod1Mask);
|
inputEvent.alt = (event.xkey.state & Mod1Mask);
|
||||||
|
|
||||||
// fire enter text event
|
// 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
|
if(x11.xic) { // with xim we can get latin1 input correctly
|
||||||
Status status;
|
Status status;
|
||||||
len = XmbLookupString(x11.xic, &event.xkey, buf, sizeof(buf), &keysym, &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]);
|
//logDebug("char: %c code: %d", buf[0], (uchar)buf[0]);
|
||||||
inputEvent.type = EV_TEXT_ENTER;
|
inputEvent.type = EV_TEXT_ENTER;
|
||||||
inputEvent.key.keychar = buf[0];
|
inputEvent.keychar = buf[0];
|
||||||
inputEvent.key.keycode = KC_UNKNOWN;
|
inputEvent.keycode = KC_UNKNOWN;
|
||||||
g_engine.onInputEvent(inputEvent);
|
g_engine.onInputEvent(inputEvent);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -361,9 +358,9 @@ void Platform::poll()
|
||||||
|
|
||||||
// fire key up/down event
|
// fire key up/down event
|
||||||
if(x11.keyMap.find(keysym) != x11.keyMap.end()) {
|
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.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);
|
g_engine.onInputEvent(inputEvent);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -392,8 +389,7 @@ void Platform::poll()
|
||||||
|
|
||||||
case MotionNotify:
|
case MotionNotify:
|
||||||
inputEvent.type = EV_MOUSE_MOVE;
|
inputEvent.type = EV_MOUSE_MOVE;
|
||||||
inputEvent.mouse.x = event.xbutton.x;
|
inputEvent.mousePos = Point(event.xbutton.x, event.xbutton.y);
|
||||||
inputEvent.mouse.y = event.xbutton.y;
|
|
||||||
g_engine.onInputEvent(inputEvent);
|
g_engine.onInputEvent(inputEvent);
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -69,10 +69,12 @@ typedef int8_t int8;
|
||||||
// yaml
|
// yaml
|
||||||
#include <yaml-cpp/yaml.h>
|
#include <yaml-cpp/yaml.h>
|
||||||
|
|
||||||
// internal logger
|
// common utilities
|
||||||
#include "logger.h"
|
#include "util/util.h"
|
||||||
|
#include "util/logger.h"
|
||||||
// additional utilities
|
#include "util/color.h"
|
||||||
#include "util.h"
|
#include "util/point.h"
|
||||||
|
#include "util/size.h"
|
||||||
|
#include "util/rect.h"
|
||||||
|
|
||||||
#endif // PREREQUISITES_H
|
#endif // PREREQUISITES_H
|
||||||
|
|
|
@ -25,8 +25,7 @@
|
||||||
#ifndef ANCHORLAYOUT_H
|
#ifndef ANCHORLAYOUT_H
|
||||||
#define ANCHORLAYOUT_H
|
#define ANCHORLAYOUT_H
|
||||||
|
|
||||||
#include "../prerequisites.h"
|
#include "prerequisites.h"
|
||||||
#include "../rect.h"
|
|
||||||
#include "uiconstants.h"
|
#include "uiconstants.h"
|
||||||
|
|
||||||
enum EAnchorType {
|
enum EAnchorType {
|
||||||
|
|
|
@ -25,7 +25,7 @@
|
||||||
#ifndef UI_H
|
#ifndef UI_H
|
||||||
#define UI_H
|
#define UI_H
|
||||||
|
|
||||||
#include "../prerequisites.h"
|
#include "prerequisites.h"
|
||||||
|
|
||||||
#include "uiconstants.h"
|
#include "uiconstants.h"
|
||||||
#include "uielement.h"
|
#include "uielement.h"
|
||||||
|
|
|
@ -23,8 +23,8 @@
|
||||||
|
|
||||||
|
|
||||||
#include "uibutton.h"
|
#include "uibutton.h"
|
||||||
#include "../fonts.h"
|
#include "graphics/fonts.h"
|
||||||
#include "../font.h"
|
#include "graphics/font.h"
|
||||||
|
|
||||||
void UIButton::load(const YAML::Node& node)
|
void UIButton::load(const YAML::Node& node)
|
||||||
{
|
{
|
||||||
|
@ -42,11 +42,11 @@ void UIButton::render()
|
||||||
bool UIButton::onInputEvent(const InputEvent& event)
|
bool UIButton::onInputEvent(const InputEvent& event)
|
||||||
{
|
{
|
||||||
if(event.type == EV_MOUSE_LDOWN &&
|
if(event.type == EV_MOUSE_LDOWN &&
|
||||||
getRect().contains(Point(event.mouse.x, event.mouse.y))) {
|
getRect().contains(event.mousePos)) {
|
||||||
m_state = UI::ButtonDown;
|
m_state = UI::ButtonDown;
|
||||||
} else if(m_state == UI::ButtonDown && event.type == EV_MOUSE_LUP) {
|
} else if(m_state == UI::ButtonDown && event.type == EV_MOUSE_LUP) {
|
||||||
m_state = UI::ButtonUp;
|
m_state = UI::ButtonUp;
|
||||||
if(getRect().contains(Point(event.mouse.x, event.mouse.y))) {
|
if(getRect().contains(event.mousePos)) {
|
||||||
if(m_buttonClickCallback)
|
if(m_buttonClickCallback)
|
||||||
m_buttonClickCallback();
|
m_buttonClickCallback();
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,9 +25,9 @@
|
||||||
#ifndef UIBUTTON_H
|
#ifndef UIBUTTON_H
|
||||||
#define UIBUTTON_H
|
#define UIBUTTON_H
|
||||||
|
|
||||||
#include "../prerequisites.h"
|
#include "prerequisites.h"
|
||||||
#include "uielement.h"
|
#include "uielement.h"
|
||||||
#include "../borderedimage.h"
|
#include "graphics/borderedimage.h"
|
||||||
|
|
||||||
typedef std::function<void()> Callback;
|
typedef std::function<void()> Callback;
|
||||||
|
|
||||||
|
|
|
@ -25,7 +25,7 @@
|
||||||
#ifndef UIBUTTONSKIN_H
|
#ifndef UIBUTTONSKIN_H
|
||||||
#define UIBUTTONSKIN_H
|
#define UIBUTTONSKIN_H
|
||||||
|
|
||||||
#include "../prerequisites.h"
|
#include "prerequisites.h"
|
||||||
#include "uiconstants.h"
|
#include "uiconstants.h"
|
||||||
#include "uielementskin.h"
|
#include "uielementskin.h"
|
||||||
|
|
||||||
|
|
|
@ -23,7 +23,7 @@
|
||||||
|
|
||||||
|
|
||||||
#include "uicontainer.h"
|
#include "uicontainer.h"
|
||||||
#include "../resources.h"
|
#include "core/resources.h"
|
||||||
#include "uibutton.h"
|
#include "uibutton.h"
|
||||||
#include "uipanel.h"
|
#include "uipanel.h"
|
||||||
#include "uilabel.h"
|
#include "uilabel.h"
|
||||||
|
|
|
@ -25,11 +25,8 @@
|
||||||
#ifndef UICONTAINER_H
|
#ifndef UICONTAINER_H
|
||||||
#define UICONTAINER_H
|
#define UICONTAINER_H
|
||||||
|
|
||||||
//TODO: make includes paths, so this will be cleaner
|
#include "prerequisites.h"
|
||||||
#include "../prerequisites.h"
|
|
||||||
#include "uielement.h"
|
#include "uielement.h"
|
||||||
#include "../point.h"
|
|
||||||
#include "../rect.h"
|
|
||||||
|
|
||||||
class UIContainer : public UIElement
|
class UIContainer : public UIElement
|
||||||
{
|
{
|
||||||
|
|
|
@ -25,9 +25,8 @@
|
||||||
#ifndef UIELEMENT_H
|
#ifndef UIELEMENT_H
|
||||||
#define UIELEMENT_H
|
#define UIELEMENT_H
|
||||||
|
|
||||||
#include "../prerequisites.h"
|
#include "prerequisites.h"
|
||||||
#include "../input.h"
|
#include "core/input.h"
|
||||||
#include "../rect.h"
|
|
||||||
#include "uiconstants.h"
|
#include "uiconstants.h"
|
||||||
#include "anchorlayout.h"
|
#include "anchorlayout.h"
|
||||||
|
|
||||||
|
|
|
@ -24,8 +24,8 @@
|
||||||
|
|
||||||
#include "uielementskin.h"
|
#include "uielementskin.h"
|
||||||
#include "uielement.h"
|
#include "uielement.h"
|
||||||
#include "../borderedimage.h"
|
#include "graphics/borderedimage.h"
|
||||||
#include "../textures.h"
|
#include "graphics/textures.h"
|
||||||
#include "uiskins.h"
|
#include "uiskins.h"
|
||||||
|
|
||||||
void UIElementSkin::draw(UIElement *element)
|
void UIElementSkin::draw(UIElement *element)
|
||||||
|
|
|
@ -25,10 +25,9 @@
|
||||||
#ifndef UIELEMENTSKIN_H
|
#ifndef UIELEMENTSKIN_H
|
||||||
#define UIELEMENTSKIN_H
|
#define UIELEMENTSKIN_H
|
||||||
|
|
||||||
#include "../prerequisites.h"
|
#include "prerequisites.h"
|
||||||
#include "uiconstants.h"
|
#include "uiconstants.h"
|
||||||
#include "../image.h"
|
#include "graphics/image.h"
|
||||||
#include "../rect.h"
|
|
||||||
|
|
||||||
class UIElement;
|
class UIElement;
|
||||||
|
|
||||||
|
|
|
@ -23,7 +23,7 @@
|
||||||
|
|
||||||
|
|
||||||
#include "uilabel.h"
|
#include "uilabel.h"
|
||||||
#include "../fonts.h"
|
#include "graphics/fonts.h"
|
||||||
|
|
||||||
UILabel::UILabel(const std::string& text, Font* font) :
|
UILabel::UILabel(const std::string& text, Font* font) :
|
||||||
UIElement(UI::Label),
|
UIElement(UI::Label),
|
||||||
|
|
|
@ -25,7 +25,7 @@
|
||||||
#ifndef UILABEL_H
|
#ifndef UILABEL_H
|
||||||
#define UILABEL_H
|
#define UILABEL_H
|
||||||
|
|
||||||
#include "../prerequisites.h"
|
#include "prerequisites.h"
|
||||||
#include "uielement.h"
|
#include "uielement.h"
|
||||||
|
|
||||||
class Font;
|
class Font;
|
||||||
|
|
|
@ -25,9 +25,9 @@
|
||||||
#ifndef UIPANEL_H
|
#ifndef UIPANEL_H
|
||||||
#define UIPANEL_H
|
#define UIPANEL_H
|
||||||
|
|
||||||
#include "../prerequisites.h"
|
#include "prerequisites.h"
|
||||||
#include "uicontainer.h"
|
#include "uicontainer.h"
|
||||||
#include "../borderedimage.h"
|
#include "graphics/borderedimage.h"
|
||||||
|
|
||||||
class UIPanel : public UIContainer
|
class UIPanel : public UIContainer
|
||||||
{
|
{
|
||||||
|
|
|
@ -23,8 +23,8 @@
|
||||||
|
|
||||||
|
|
||||||
#include "uiskins.h"
|
#include "uiskins.h"
|
||||||
#include "../resources.h"
|
#include "core/resources.h"
|
||||||
#include "../textures.h"
|
#include "graphics/textures.h"
|
||||||
#include "uielementskin.h"
|
#include "uielementskin.h"
|
||||||
#include "uibuttonskin.h"
|
#include "uibuttonskin.h"
|
||||||
#include "uiwindowskin.h"
|
#include "uiwindowskin.h"
|
||||||
|
|
|
@ -25,9 +25,9 @@
|
||||||
#ifndef UISKIN_H
|
#ifndef UISKIN_H
|
||||||
#define UISKIN_H
|
#define UISKIN_H
|
||||||
|
|
||||||
#include "../prerequisites.h"
|
#include "prerequisites.h"
|
||||||
#include "uicontainer.h"
|
#include "uicontainer.h"
|
||||||
#include "../texture.h"
|
#include "graphics/texture.h"
|
||||||
|
|
||||||
class UIElementSkin;
|
class UIElementSkin;
|
||||||
|
|
||||||
|
|
|
@ -23,7 +23,7 @@
|
||||||
|
|
||||||
|
|
||||||
#include "uitextedit.h"
|
#include "uitextedit.h"
|
||||||
#include "../fonts.h"
|
#include "graphics/fonts.h"
|
||||||
|
|
||||||
UITextEdit::UITextEdit(Font* font) :
|
UITextEdit::UITextEdit(Font* font) :
|
||||||
UIElement(UI::TextEdit),
|
UIElement(UI::TextEdit),
|
||||||
|
|
|
@ -25,7 +25,7 @@
|
||||||
#ifndef UITEXTEDIT_H
|
#ifndef UITEXTEDIT_H
|
||||||
#define UITEXTEDIT_H
|
#define UITEXTEDIT_H
|
||||||
|
|
||||||
#include "../prerequisites.h"
|
#include "prerequisites.h"
|
||||||
#include "uielement.h"
|
#include "uielement.h"
|
||||||
|
|
||||||
class Font;
|
class Font;
|
||||||
|
|
|
@ -25,7 +25,7 @@
|
||||||
#ifndef UITEXTEDITSKIN_H
|
#ifndef UITEXTEDITSKIN_H
|
||||||
#define UITEXTEDITSKIN_H
|
#define UITEXTEDITSKIN_H
|
||||||
|
|
||||||
#include "../prerequisites.h"
|
#include "prerequisites.h"
|
||||||
#include "uiconstants.h"
|
#include "uiconstants.h"
|
||||||
#include "uielementskin.h"
|
#include "uielementskin.h"
|
||||||
|
|
||||||
|
|
|
@ -25,7 +25,7 @@
|
||||||
#ifndef UIWINDOW_H
|
#ifndef UIWINDOW_H
|
||||||
#define UIWINDOW_H
|
#define UIWINDOW_H
|
||||||
|
|
||||||
#include "../prerequisites.h"
|
#include "prerequisites.h"
|
||||||
#include "uicontainer.h"
|
#include "uicontainer.h"
|
||||||
|
|
||||||
class UIWindow : public UIContainer
|
class UIWindow : public UIContainer
|
||||||
|
|
|
@ -23,7 +23,7 @@
|
||||||
|
|
||||||
#include "uiwindowskin.h"
|
#include "uiwindowskin.h"
|
||||||
#include "uiwindow.h"
|
#include "uiwindow.h"
|
||||||
#include "../fonts.h"
|
#include "graphics/fonts.h"
|
||||||
|
|
||||||
void UIWindowSkin::draw(UIElement* element)
|
void UIWindowSkin::draw(UIElement* element)
|
||||||
{
|
{
|
||||||
|
|
|
@ -24,10 +24,10 @@
|
||||||
#ifndef UIWINDOWSKIN_H
|
#ifndef UIWINDOWSKIN_H
|
||||||
#define UIWINDOWSKIN_H
|
#define UIWINDOWSKIN_H
|
||||||
|
|
||||||
#include "../prerequisites.h"
|
#include "prerequisites.h"
|
||||||
#include "uiconstants.h"
|
#include "uiconstants.h"
|
||||||
#include "uielementskin.h"
|
#include "uielementskin.h"
|
||||||
#include "../font.h"
|
#include "graphics/font.h"
|
||||||
|
|
||||||
class UIWindowSkin : public UIElementSkin
|
class UIWindowSkin : public UIElementSkin
|
||||||
{
|
{
|
||||||
|
|
|
@ -26,8 +26,6 @@
|
||||||
#define RECT_H
|
#define RECT_H
|
||||||
|
|
||||||
#include "prerequisites.h"
|
#include "prerequisites.h"
|
||||||
#include "point.h"
|
|
||||||
#include "size.h"
|
|
||||||
|
|
||||||
template <class T>
|
template <class T>
|
||||||
class TPoint;
|
class TPoint;
|
|
@ -24,7 +24,7 @@
|
||||||
#ifndef RSA_H
|
#ifndef RSA_H
|
||||||
#define RSA_H
|
#define RSA_H
|
||||||
|
|
||||||
#include "../prerequisites.h"
|
#include "prerequisites.h"
|
||||||
|
|
||||||
#include <gmp.h>
|
#include <gmp.h>
|
||||||
|
|
||||||
|
|
12
src/main.cpp
12
src/main.cpp
|
@ -22,14 +22,14 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#include "framework/engine.h"
|
#include "core/engine.h"
|
||||||
#include "framework/configs.h"
|
#include "core/configs.h"
|
||||||
#include "framework/resources.h"
|
#include "core/resources.h"
|
||||||
#include "framework/platform.h"
|
#include "core/platform.h"
|
||||||
|
#include "core/dispatcher.h"
|
||||||
#include "menustate.h"
|
#include "menustate.h"
|
||||||
#include "teststate.h"
|
#include "teststate.h"
|
||||||
#include "framework/dispatcher.h"
|
#include "ui/uiskins.h"
|
||||||
#include "framework/ui/uiskins.h"
|
|
||||||
|
|
||||||
/// Catches signals so we can exit nicely
|
/// Catches signals so we can exit nicely
|
||||||
void signal_handler(int sig)
|
void signal_handler(int sig)
|
||||||
|
|
|
@ -23,18 +23,15 @@
|
||||||
|
|
||||||
|
|
||||||
#include "menustate.h"
|
#include "menustate.h"
|
||||||
#include "framework/framebuffer.h"
|
#include "graphics/framebuffer.h"
|
||||||
#include "framework/graphics.h"
|
#include "graphics/graphics.h"
|
||||||
#include "framework/textures.h"
|
#include "graphics/textures.h"
|
||||||
#include "framework/logger.h"
|
#include "core/engine.h"
|
||||||
#include "framework/engine.h"
|
#include "graphics/fonts.h"
|
||||||
#include "framework/rect.h"
|
#include "core/dispatcher.h"
|
||||||
#include "framework/fonts.h"
|
#include "ui/ui.h"
|
||||||
#include "framework/input.h"
|
#include "net/connections.h"
|
||||||
#include "framework/dispatcher.h"
|
#include "graphics/borderedimage.h"
|
||||||
#include "framework/ui/ui.h"
|
|
||||||
#include "framework/net/connections.h"
|
|
||||||
#include "framework/borderedimage.h"
|
|
||||||
|
|
||||||
|
|
||||||
void MenuState::onEnter()
|
void MenuState::onEnter()
|
||||||
|
|
|
@ -25,10 +25,10 @@
|
||||||
#ifndef MENUSTATE_H
|
#ifndef MENUSTATE_H
|
||||||
#define MENUSTATE_H
|
#define MENUSTATE_H
|
||||||
|
|
||||||
#include "framework/gamestate.h"
|
#include "core/gamestate.h"
|
||||||
#include "framework/texture.h"
|
#include "graphics/texture.h"
|
||||||
#include "framework/net/connection.h"
|
#include "net/connection.h"
|
||||||
#include "framework/ui/uipanel.h"
|
#include "ui/uipanel.h"
|
||||||
|
|
||||||
class MenuState : public GameState
|
class MenuState : public GameState
|
||||||
{
|
{
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "protocoltibia87.h"
|
#include "protocoltibia87.h"
|
||||||
#include "../framework/util/rsa.h"
|
#include "util/rsa.h"
|
||||||
|
|
||||||
const char* ProtocolTibia87::rsa = "4673033022358411862216018001503683214873298680851934467521055526294025873980576"
|
const char* ProtocolTibia87::rsa = "4673033022358411862216018001503683214873298680851934467521055526294025873980576"
|
||||||
"6860224610646919605860206328024326703361630109888417839241959507572247284807035"
|
"6860224610646919605860206328024326703361630109888417839241959507572247284807035"
|
||||||
|
|
|
@ -24,8 +24,8 @@
|
||||||
#ifndef PROTOCOLTIBIA87_H
|
#ifndef PROTOCOLTIBIA87_H
|
||||||
#define PROTOCOLTIBIA87_H
|
#define PROTOCOLTIBIA87_H
|
||||||
|
|
||||||
#include "../framework/prerequisites.h"
|
#include "prerequisites.h"
|
||||||
#include "../framework/net/protocol.h"
|
#include "net/protocol.h"
|
||||||
|
|
||||||
class ProtocolTibia87 : public Protocol
|
class ProtocolTibia87 : public Protocol
|
||||||
{
|
{
|
||||||
|
|
|
@ -23,13 +23,9 @@
|
||||||
|
|
||||||
|
|
||||||
#include "teststate.h"
|
#include "teststate.h"
|
||||||
#include "framework/graphics.h"
|
#include "graphics/graphics.h"
|
||||||
#include "framework/logger.h"
|
#include "core/engine.h"
|
||||||
#include "framework/engine.h"
|
#include "net/connections.h"
|
||||||
#include "framework/input.h"
|
|
||||||
|
|
||||||
#include "framework/net/connections.h"
|
|
||||||
|
|
||||||
#include "net/protocoltibia87.h"
|
#include "net/protocoltibia87.h"
|
||||||
|
|
||||||
void TestState::onEnter()
|
void TestState::onEnter()
|
||||||
|
|
|
@ -25,7 +25,7 @@
|
||||||
#ifndef TESTSTATE_H
|
#ifndef TESTSTATE_H
|
||||||
#define TESTSTATE_H
|
#define TESTSTATE_H
|
||||||
|
|
||||||
#include "framework/gamestate.h"
|
#include "core/gamestate.h"
|
||||||
#include "net/protocoltibia87.h"
|
#include "net/protocoltibia87.h"
|
||||||
|
|
||||||
class TestState : public GameState
|
class TestState : public GameState
|
||||||
|
|
Loading…
Reference in New Issue