isle-portable/ISLE/isleapp.h
Anonymous Maarten 196259c6c9
Some checks failed
Build / Current ${{ matrix.toolchain.name }} (map[clang-tidy:true d3drm-from-wine:true dx5-libs:false msys-env:mingw-w64-i686 msystem:mingw32 name:msys2 mingw32 shell:msys2 {0} werror:true]) (push) Has been cancelled
Build / Current ${{ matrix.toolchain.name }} (map[clang-tidy:true d3drm-from-wine:true dx5-libs:false msys-env:mingw-w64-x86_64 msystem:mingw64 name:msys2 mingw64 shell:msys2 {0} werror:true]) (push) Has been cancelled
Build / Current ${{ matrix.toolchain.name }} (map[d3drm-from-wine:false dx5-libs:true name:MSVC (32-bit) setup-cmake:true setup-msvc:true setup-ninja:true shell:sh vc-arch:amd64_x86]) (push) Has been cancelled
Build / Current ${{ matrix.toolchain.name }} (map[d3drm-from-wine:true dx5-libs:false name:MSVC (64-bit) setup-cmake:true setup-msvc:true setup-ninja:true shell:sh vc-arch:amd64]) (push) Has been cancelled
Format / C++ (push) Has been cancelled
Naming / C++ (push) Has been cancelled
Parse cli arguments + log with SDL_Log (#30)
* cmake: copy DLL dependencies to output path

This also copies SDL3.dll from an external path when using system
dependencies.

* Only include <SDL3/SDL.h>

* isle: parse cli argument (--ini for custom ini path)

* Use SDL_CreateWIndowWithProperties to create SDL window

Less branching => Clearer code

* Log mxdirectx failure using SDL_Log + E_NOINTERFACE

* Fix d3drm32.def for msvc

* Define D3DRM_WINE when using d3drm from wine

* Ignore failed assertions from d3drm unimplemented functions

* inparser will/should create libiniparser.lib for static libraries and iniparser.lib for a shared library
2024-06-26 11:24:40 -07:00

84 lines
2.2 KiB
C++

#ifndef ISLEAPP_H
#define ISLEAPP_H
#include "legoutils.h"
#include "mxtypes.h"
#include "mxvideoparam.h"
#include <SDL3/SDL_mouse.h>
#include <SDL3/SDL_video.h>
#include <windows.h>
// SIZE 0x8c
class IsleApp {
public:
IsleApp();
~IsleApp();
void Close();
MxS32 SetupLegoOmni();
void SetupVideoFlags(
MxS32 fullScreen,
MxS32 flipSurfaces,
MxS32 backBuffers,
MxS32 using8bit,
MxS32 using16bit,
MxS32 param_6,
MxS32 param_7,
MxS32 wideViewAngle,
char* deviceId
);
MxResult SetupWindow();
void LoadConfig();
void Tick();
void SetupCursor(Cursor p_cursor);
static MxU8 MapMouseButtonFlagsToModifier(SDL_MouseButtonFlags p_flags);
inline SDL_Window* GetWindowHandle() { return m_windowHandle; }
inline MxLong GetFrameDelta() { return m_frameDelta; }
inline MxS32 GetFullScreen() { return m_fullScreen; }
inline SDL_Cursor* GetCursorCurrent() { return m_cursorCurrent; }
inline SDL_Cursor* GetCursorBusy() { return m_cursorBusy; }
inline SDL_Cursor* GetCursorNo() { return m_cursorNo; }
inline MxS32 GetDrawCursor() { return m_drawCursor; }
inline void SetWindowActive(MxS32 p_windowActive) { m_windowActive = p_windowActive; }
MxResult ParseArguments(int argc, char** argv);
private:
char* m_hdPath; // 0x00
char* m_cdPath; // 0x04
char* m_deviceId; // 0x08
char* m_savePath; // 0x0c
MxS32 m_fullScreen; // 0x10
MxS32 m_flipSurfaces; // 0x14
MxS32 m_backBuffersInVram; // 0x18
MxS32 m_using8bit; // 0x1c
MxS32 m_using16bit; // 0x20
MxS32 m_unk0x24; // 0x24
MxS32 m_use3dSound; // 0x28
MxS32 m_useMusic; // 0x2c
MxS32 m_useJoystick; // 0x30
MxS32 m_joystickIndex; // 0x34
MxS32 m_wideViewAngle; // 0x38
MxS32 m_islandQuality; // 0x3c
MxS32 m_islandTexture; // 0x40
MxS32 m_gameStarted; // 0x44
MxLong m_frameDelta; // 0x48
MxVideoParam m_videoParam; // 0x4c
MxS32 m_windowActive; // 0x70
SDL_Window* m_windowHandle; // 0x74
MxS32 m_drawCursor; // 0x78
SDL_Cursor* m_cursorArrow; // 0x7c
SDL_Cursor* m_cursorBusy; // 0x80
SDL_Cursor* m_cursorNo; // 0x84
SDL_Cursor* m_cursorCurrent; // 0x88
char* m_iniPath;
};
#endif // ISLEAPP_H