Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 14 additions & 8 deletions engine/includes/adapters/desktopadaptor.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ class DesktopAdaptor : public PlatformAdaptor {

void destroy() override;

bool isActive() const override;

bool key(Input::KeyCode code) const override;
bool keyPressed(Input::KeyCode code) const override;
bool keyReleased(Input::KeyCode code) const override;
Expand All @@ -45,17 +47,13 @@ class DesktopAdaptor : public PlatformAdaptor {
Vector4 joystickThumbs(int index) const override;
Vector2 joystickTriggers(int index) const override;

void *pluginLoad(const char *name) override;

bool pluginUnload(void *plugin) override;

void *pluginAddress(void *plugin, const TString &name) override;

TString locationLocalDir() const override;

void syncConfiguration(VariantMap &map) const override;

protected:
static void windowFocusCallback(GLFWwindow *, int focused);

static void toggleFullscreen(GLFWwindow *window);

static void keyCallback(GLFWwindow *, int, int, int, int);
Expand All @@ -71,20 +69,28 @@ class DesktopAdaptor : public PlatformAdaptor {
static void errorCallback(int error, const char *description);

protected:
GLFWwindow *m_pWindow;
GLFWmonitor *m_pMonitor;
GLFWwindow *m_window;
GLFWmonitor *m_monitor;

bool m_noOpenGL;

static TString s_appConfig;
static TString s_inputString;

static std::unordered_map<int32_t, int32_t> s_keys;
static std::unordered_map<int32_t, int32_t> s_mouseButtons;

static Vector4 s_mousePosition;
static Vector4 s_oldMousePosition;

static float s_mouseScrollDelta;

static int32_t s_width;
static int32_t s_height;

static bool s_windowed;
static bool s_vSync;
static bool s_appActive;
};

#endif // DESKTOPADAPTOR_H
4 changes: 4 additions & 0 deletions engine/includes/adapters/mobileadaptor.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ class MobileAdaptor : public PlatformAdaptor {

void destroy() override;

bool isActive() const override;

TString locationLocalDir() const override;

uint32_t screenWidth() const override;
Expand Down Expand Up @@ -58,6 +60,8 @@ class MobileAdaptor : public PlatformAdaptor {
static float s_mouseScrollDelta;

static bool s_mouseLocked;

static bool s_appActive;
};

#endif // MOBILEADAPTOR_H
9 changes: 2 additions & 7 deletions engine/includes/adapters/platformadaptor.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,9 @@ class ENGINE_EXPORT PlatformAdaptor {

virtual void destroy() = 0;

virtual uint32_t screenWidth() const = 0;
virtual bool isActive() const = 0;

virtual uint32_t screenWidth() const = 0;
virtual uint32_t screenHeight() const = 0;

virtual bool key(Input::KeyCode code) const;
Expand Down Expand Up @@ -53,12 +54,6 @@ class ENGINE_EXPORT PlatformAdaptor {
virtual uint32_t touchState(int index) const;
virtual Vector4 touchPosition(int index) const;

virtual void *pluginLoad(const char *name);

virtual bool pluginUnload(void *plugin);

virtual void *pluginAddress(void *plugin, const TString &name);

virtual TString locationLocalDir() const;

virtual void syncConfiguration(VariantMap &map) const;
Expand Down
3 changes: 0 additions & 3 deletions engine/includes/components/nativebehaviour.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@ class ENGINE_EXPORT NativeBehaviour : public Component {

virtual void update();

protected:
void setSystem(ObjectSystem *system) override;

};

#endif // NATIVEBEHAVIOUR_H
2 changes: 2 additions & 0 deletions engine/includes/components/world.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
#include "system.h"
#include "scene.h"

class Camera;

typedef bool (*RayCastCallback)(System *system, World *graph, const Ray &ray, float maxDistance, Ray::Hit *hit);

class ENGINE_EXPORT World : public Object {
Expand Down
4 changes: 4 additions & 0 deletions engine/includes/editor/editorplatform.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ class ENGINE_EXPORT EditorPlatform : public PlatformAdaptor {

void destroy() override {}

bool isActive() const override;

bool key(Input::KeyCode) const override;
bool keyPressed(Input::KeyCode) const override;
bool keyReleased(Input::KeyCode) const override;
Expand Down Expand Up @@ -83,6 +85,8 @@ class ENGINE_EXPORT EditorPlatform : public PlatformAdaptor {

bool m_mouseLock;

static bool s_appActive;

};

#endif // EDITORPLATFORM_H
1 change: 0 additions & 1 deletion engine/includes/editor/viewport/viewport.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ class ENGINE_EXPORT Viewport : public QWidget {

int gridCell();

bool isGamePaused() const;
void setGamePaused(bool pause);

bool isLiveUpdate() const;
Expand Down
13 changes: 4 additions & 9 deletions engine/includes/engine.h
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,6 @@ class ENGINE_EXPORT Engine : public ObjectSystem {

static void setGameMode(bool flag);

static TString locationAppDir();

static TString locationAppConfig();

static bool loadTranslator(const TString &table);
Expand All @@ -108,10 +106,6 @@ class ENGINE_EXPORT Engine : public ObjectSystem {

static void addModule(Module *module);

static TString applicationName();

static TString organizationName();

static bool setPlatformAdaptor(PlatformAdaptor *platform);

static Actor *composeActor(const TString &component, const TString &name, Object *parent = nullptr);
Expand All @@ -123,16 +117,17 @@ class ENGINE_EXPORT Engine : public ObjectSystem {

Object::ObjectList getAllObjectsByType(const TString &type) const override;

void addNativeBehaviour(NativeBehaviour *native);
void removeNativeBehaviour(NativeBehaviour *native);

private:
friend class System;
friend class NativeBehaviour;

bool event(Event *event) override;

static void addSystem(System *system);
static void removeSystem(System *system);

static void addNativeBehaviour(NativeBehaviour *native);
static void removeNativeBehaviour(NativeBehaviour *native);
};

#endif // ENGINE_H
Loading
Loading