mirror of
https://github.com/isledecomp/isle-portable.git
synced 2025-05-07 19:50:56 -04:00
Refactor utility/decomp headers (#318)
This commit is contained in:
parent
3b30607337
commit
a7194266b3
21 changed files with 42 additions and 32 deletions
.github/workflows
CMakeLists.txtCONTRIBUTING.mdLEGO1
mxatomidcounter.hmxcompositepresenter.hmxdiskstreamcontroller.hmxnotificationmanager.h
mxstl
mxstreamcontroller.hmxstreamlist.hmxticklemanager.hrealtime
tgl/d3drm
viewmanager
util
1
.github/workflows/format.yml
vendored
1
.github/workflows/format.yml
vendored
|
@ -17,6 +17,7 @@ jobs:
|
||||||
--style=file \
|
--style=file \
|
||||||
ISLE/*.cpp ISLE/*.h \
|
ISLE/*.cpp ISLE/*.h \
|
||||||
LEGO1/*.cpp LEGO1/*.h \
|
LEGO1/*.cpp LEGO1/*.h \
|
||||||
|
LEGO1/mxstl/*.h \
|
||||||
LEGO1/realtime/*.cpp LEGO1/realtime/*.h \
|
LEGO1/realtime/*.cpp LEGO1/realtime/*.h \
|
||||||
LEGO1/tgl/*.h \
|
LEGO1/tgl/*.h \
|
||||||
LEGO1/tgl/d3drm/*.cpp LEGO1/tgl/d3drm/*.h \
|
LEGO1/tgl/d3drm/*.cpp LEGO1/tgl/d3drm/*.h \
|
||||||
|
|
|
@ -230,6 +230,8 @@ if (MINGW)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Additional include directories
|
# Additional include directories
|
||||||
|
|
||||||
|
target_include_directories(lego1 PRIVATE "${CMAKE_SOURCE_DIR}/util")
|
||||||
target_include_directories(lego1 PUBLIC "${CMAKE_SOURCE_DIR}/3rdparty/vec")
|
target_include_directories(lego1 PUBLIC "${CMAKE_SOURCE_DIR}/3rdparty/vec")
|
||||||
target_include_directories(lego1 PRIVATE "${CMAKE_SOURCE_DIR}/3rdparty/flic")
|
target_include_directories(lego1 PRIVATE "${CMAKE_SOURCE_DIR}/3rdparty/flic")
|
||||||
target_include_directories(lego1 PRIVATE "${CMAKE_SOURCE_DIR}/3rdparty/smk")
|
target_include_directories(lego1 PRIVATE "${CMAKE_SOURCE_DIR}/3rdparty/smk")
|
||||||
|
@ -264,6 +266,8 @@ if (ISLE_BUILD_APP)
|
||||||
ISLE/define.cpp
|
ISLE/define.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
|
target_include_directories(isle PRIVATE "${CMAKE_SOURCE_DIR}/util")
|
||||||
|
|
||||||
# Include LEGO1 headers in ISLE
|
# Include LEGO1 headers in ISLE
|
||||||
target_include_directories(isle PRIVATE "${CMAKE_SOURCE_DIR}/LEGO1")
|
target_include_directories(isle PRIVATE "${CMAKE_SOURCE_DIR}/LEGO1")
|
||||||
|
|
||||||
|
|
|
@ -27,6 +27,7 @@ This repository currently has only one goal: accuracy to the original executable
|
||||||
* [`ISLE`](/ISLE): Decompilation of `ISLE.EXE`. It depends on some code in `LEGO1`.
|
* [`ISLE`](/ISLE): Decompilation of `ISLE.EXE`. It depends on some code in `LEGO1`.
|
||||||
* [`LEGO1`](/LEGO1): Decompilation of `LEGO1.DLL`. This folder contains code from Mindscape's custom in-house engine called **Omni** (file pattern: `mx*`), the LEGO Island-specific extensions for Omni and the game's code (file pattern: `lego*`) as well as several utility libraries developed by Mindscape.
|
* [`LEGO1`](/LEGO1): Decompilation of `LEGO1.DLL`. This folder contains code from Mindscape's custom in-house engine called **Omni** (file pattern: `mx*`), the LEGO Island-specific extensions for Omni and the game's code (file pattern: `lego*`) as well as several utility libraries developed by Mindscape.
|
||||||
* [`tools`](/tools): A set of tools aiding in the decompilation effort.
|
* [`tools`](/tools): A set of tools aiding in the decompilation effort.
|
||||||
|
* [`util`](/util): Utility headers aiding in the decompilation effort.
|
||||||
|
|
||||||
## Tooling
|
## Tooling
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
#ifndef MXATOMIDCOUNTER_H
|
#ifndef MXATOMIDCOUNTER_H
|
||||||
#define MXATOMIDCOUNTER_H
|
#define MXATOMIDCOUNTER_H
|
||||||
|
|
||||||
#include "compat.h" // STL
|
#include "mxstl/stlcompat.h"
|
||||||
#include "mxstring.h"
|
#include "mxstring.h"
|
||||||
|
|
||||||
// Counts the number of existing MxAtomId objects based
|
// Counts the number of existing MxAtomId objects based
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
#ifndef MXCOMPOSITEPRESENTER_H
|
#ifndef MXCOMPOSITEPRESENTER_H
|
||||||
#define MXCOMPOSITEPRESENTER_H
|
#define MXCOMPOSITEPRESENTER_H
|
||||||
|
|
||||||
#include "compat.h" // STL
|
|
||||||
#include "mxpresenter.h"
|
#include "mxpresenter.h"
|
||||||
|
#include "mxstl/stlcompat.h"
|
||||||
|
|
||||||
class MxCompositePresenterList : public list<MxPresenter*> {};
|
class MxCompositePresenterList : public list<MxPresenter*> {};
|
||||||
|
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
#ifndef MXDISKSTREAMCONTROLLER_H
|
#ifndef MXDISKSTREAMCONTROLLER_H
|
||||||
#define MXDISKSTREAMCONTROLLER_H
|
#define MXDISKSTREAMCONTROLLER_H
|
||||||
|
|
||||||
#include "compat.h" // STL
|
|
||||||
#include "decomp.h"
|
#include "decomp.h"
|
||||||
#include "mxdsbuffer.h"
|
#include "mxdsbuffer.h"
|
||||||
|
#include "mxstl/stlcompat.h"
|
||||||
#include "mxstreamcontroller.h"
|
#include "mxstreamcontroller.h"
|
||||||
#include "mxtypes.h"
|
#include "mxtypes.h"
|
||||||
|
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
#ifndef MXNOTIFICATIONMANAGER_H
|
#ifndef MXNOTIFICATIONMANAGER_H
|
||||||
#define MXNOTIFICATIONMANAGER_H
|
#define MXNOTIFICATIONMANAGER_H
|
||||||
|
|
||||||
#include "compat.h"
|
|
||||||
#include "mxcore.h"
|
#include "mxcore.h"
|
||||||
#include "mxcriticalsection.h"
|
#include "mxcriticalsection.h"
|
||||||
#include "mxnotificationparam.h"
|
#include "mxnotificationparam.h"
|
||||||
|
#include "mxstl/stlcompat.h"
|
||||||
#include "mxtypes.h"
|
#include "mxtypes.h"
|
||||||
|
|
||||||
class MxNotification {
|
class MxNotification {
|
||||||
|
|
18
LEGO1/mxstl/stlcompat.h
Normal file
18
LEGO1/mxstl/stlcompat.h
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
#ifndef STLCOMPAT_H
|
||||||
|
#define STLCOMPAT_H
|
||||||
|
|
||||||
|
#include "compat.h"
|
||||||
|
|
||||||
|
#if defined(_MSC_VER) && _MSC_VER <= MSVC420_VERSION
|
||||||
|
// Disable "nonstandard extension used : 'bool'" warning spam
|
||||||
|
#pragma warning(disable : 4237)
|
||||||
|
#include "mxstl.h"
|
||||||
|
#else
|
||||||
|
#include <algorithm>
|
||||||
|
#include <list>
|
||||||
|
#include <set>
|
||||||
|
using std::list;
|
||||||
|
using std::set;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif // STLCOMPAT_H
|
|
@ -1,13 +1,13 @@
|
||||||
#ifndef MXSTREAMCONTROLLER_H
|
#ifndef MXSTREAMCONTROLLER_H
|
||||||
#define MXSTREAMCONTROLLER_H
|
#define MXSTREAMCONTROLLER_H
|
||||||
|
|
||||||
#include "compat.h" // STL
|
|
||||||
#include "decomp.h"
|
#include "decomp.h"
|
||||||
#include "mxatomid.h"
|
#include "mxatomid.h"
|
||||||
#include "mxcore.h"
|
#include "mxcore.h"
|
||||||
#include "mxcriticalsection.h"
|
#include "mxcriticalsection.h"
|
||||||
#include "mxdsaction.h"
|
#include "mxdsaction.h"
|
||||||
#include "mxdsobject.h"
|
#include "mxdsobject.h"
|
||||||
|
#include "mxstl/stlcompat.h"
|
||||||
#include "mxstreamlist.h"
|
#include "mxstreamlist.h"
|
||||||
#include "mxstreamprovider.h"
|
#include "mxstreamprovider.h"
|
||||||
|
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
#ifndef MXSTREAMLIST_H
|
#ifndef MXSTREAMLIST_H
|
||||||
#define MXSTREAMLIST_H
|
#define MXSTREAMLIST_H
|
||||||
|
|
||||||
#include "compat.h" // STL
|
|
||||||
#include "mxdsaction.h"
|
#include "mxdsaction.h"
|
||||||
#include "mxdssubscriber.h"
|
#include "mxdssubscriber.h"
|
||||||
#include "mxnextactiondatastart.h"
|
#include "mxnextactiondatastart.h"
|
||||||
|
#include "mxstl/stlcompat.h"
|
||||||
|
|
||||||
template <class T>
|
template <class T>
|
||||||
class MxStreamList : public list<T> {};
|
class MxStreamList : public list<T> {};
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
#ifndef MXTICKLEMANAGER_H
|
#ifndef MXTICKLEMANAGER_H
|
||||||
#define MXTICKLEMANAGER_H
|
#define MXTICKLEMANAGER_H
|
||||||
|
|
||||||
#include "compat.h"
|
|
||||||
#include "mxcore.h"
|
#include "mxcore.h"
|
||||||
|
#include "mxstl/stlcompat.h"
|
||||||
#include "mxtypes.h"
|
#include "mxtypes.h"
|
||||||
|
|
||||||
class MxTickleClient {
|
class MxTickleClient {
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
|
|
||||||
#include "matrix.h"
|
#include "matrix.h"
|
||||||
|
|
||||||
#include "../decomp.h"
|
#include "decomp.h"
|
||||||
#include "math.h"
|
#include "math.h"
|
||||||
|
|
||||||
#include <memory.h>
|
#include <memory.h>
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#include "orientableroi.h"
|
#include "orientableroi.h"
|
||||||
|
|
||||||
#include "../decomp.h"
|
#include "decomp.h"
|
||||||
|
|
||||||
DECOMP_SIZE_ASSERT(OrientableROI, 0xdc)
|
DECOMP_SIZE_ASSERT(OrientableROI, 0xdc)
|
||||||
|
|
||||||
|
|
|
@ -3,9 +3,9 @@
|
||||||
|
|
||||||
// ROI stands for Real-time Object Instance.
|
// ROI stands for Real-time Object Instance.
|
||||||
|
|
||||||
#include "../compat.h"
|
#include "../mxstl/stlcompat.h"
|
||||||
#include "../mxstl.h"
|
|
||||||
#include "../realtime/realtime.h"
|
#include "../realtime/realtime.h"
|
||||||
|
#include "compat.h"
|
||||||
#include "lodlist.h"
|
#include "lodlist.h"
|
||||||
#include "vector.h"
|
#include "vector.h"
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
|
|
||||||
#include "vector.h"
|
#include "vector.h"
|
||||||
|
|
||||||
#include "../decomp.h"
|
#include "decomp.h"
|
||||||
|
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
#include <memory.h>
|
#include <memory.h>
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
|
|
||||||
#include "../../decomp.h"
|
|
||||||
#include "../tgl.h"
|
#include "../tgl.h"
|
||||||
|
#include "decomp.h"
|
||||||
|
|
||||||
#include <d3drm.h>
|
#include <d3drm.h>
|
||||||
|
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
#ifndef VIEWLODLIST_H
|
#ifndef VIEWLODLIST_H
|
||||||
#define VIEWLODLIST_H
|
#define VIEWLODLIST_H
|
||||||
|
|
||||||
#include "../compat.h"
|
|
||||||
#include "../realtime/lodlist.h"
|
#include "../realtime/lodlist.h"
|
||||||
#include "assert.h"
|
#include "assert.h"
|
||||||
|
#include "compat.h"
|
||||||
|
|
||||||
#pragma warning(disable : 4786)
|
#pragma warning(disable : 4786)
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#include "viewroi.h"
|
#include "viewroi.h"
|
||||||
|
|
||||||
#include "../decomp.h"
|
#include "decomp.h"
|
||||||
|
|
||||||
DECOMP_SIZE_ASSERT(ViewROI, 0xe0)
|
DECOMP_SIZE_ASSERT(ViewROI, 0xe0)
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#ifndef ISLECOMPAT_H
|
#ifndef COMPAT_H
|
||||||
#define ISLECOMPAT_H
|
#define COMPAT_H
|
||||||
|
|
||||||
// Various macros to enable compiling with other/newer compilers.
|
// Various macros to enable compiling with other/newer compilers.
|
||||||
|
|
||||||
|
@ -11,9 +11,6 @@
|
||||||
#define COMPAT_CONST
|
#define COMPAT_CONST
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// DIsable "nonstandard extension used : 'bool'" warning spam
|
|
||||||
#pragma warning(disable : 4237)
|
|
||||||
|
|
||||||
// Disable "identifier was truncated to '255' characters" warning.
|
// Disable "identifier was truncated to '255' characters" warning.
|
||||||
// Impossible to avoid this if using STL map or set.
|
// Impossible to avoid this if using STL map or set.
|
||||||
// This removes most (but not all) occurrences of the warning.
|
// This removes most (but not all) occurrences of the warning.
|
||||||
|
@ -21,17 +18,6 @@
|
||||||
|
|
||||||
#define MSVC420_VERSION 1020
|
#define MSVC420_VERSION 1020
|
||||||
|
|
||||||
// STL compatibility.
|
|
||||||
#if defined(_MSC_VER) && _MSC_VER <= MSVC420_VERSION
|
|
||||||
#include "mxstl.h"
|
|
||||||
#else
|
|
||||||
#include <algorithm>
|
|
||||||
#include <list>
|
|
||||||
#include <set>
|
|
||||||
using std::list;
|
|
||||||
using std::set;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// We use `override` so newer compilers can tell us our vtables are valid,
|
// We use `override` so newer compilers can tell us our vtables are valid,
|
||||||
// however this keyword was added in C++11, so we define it as empty for
|
// however this keyword was added in C++11, so we define it as empty for
|
||||||
// compatibility with older compilers.
|
// compatibility with older compilers.
|
||||||
|
@ -39,4 +25,4 @@ using std::set;
|
||||||
#define override
|
#define override
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif // ISLECOMPAT_H
|
#endif // COMPAT_H
|
Loading…
Add table
Add a link
Reference in a new issue