summaryrefslogtreecommitdiffstats
path: root/tools/statepropbuilder/apps/spbuilder/code/sp/engine/platform.cpp
diff options
context:
space:
mode:
authorSvxy <aidan61605@gmail.com>2023-05-31 23:31:32 +0200
committerSvxy <aidan61605@gmail.com>2023-05-31 23:31:32 +0200
commiteb4b3404aa00220d659e532151dab13d642c17a3 (patch)
tree7e1107c4995489a26c4007e41b53ea8d00ab2134 /tools/statepropbuilder/apps/spbuilder/code/sp/engine/platform.cpp
downloadThe-Simpsons-Hit-and-Run-eb4b3404aa00220d659e532151dab13d642c17a3.tar
The-Simpsons-Hit-and-Run-eb4b3404aa00220d659e532151dab13d642c17a3.tar.gz
The-Simpsons-Hit-and-Run-eb4b3404aa00220d659e532151dab13d642c17a3.tar.bz2
The-Simpsons-Hit-and-Run-eb4b3404aa00220d659e532151dab13d642c17a3.tar.lz
The-Simpsons-Hit-and-Run-eb4b3404aa00220d659e532151dab13d642c17a3.tar.xz
The-Simpsons-Hit-and-Run-eb4b3404aa00220d659e532151dab13d642c17a3.tar.zst
The-Simpsons-Hit-and-Run-eb4b3404aa00220d659e532151dab13d642c17a3.zip
Diffstat (limited to 'tools/statepropbuilder/apps/spbuilder/code/sp/engine/platform.cpp')
-rw-r--r--tools/statepropbuilder/apps/spbuilder/code/sp/engine/platform.cpp94
1 files changed, 94 insertions, 0 deletions
diff --git a/tools/statepropbuilder/apps/spbuilder/code/sp/engine/platform.cpp b/tools/statepropbuilder/apps/spbuilder/code/sp/engine/platform.cpp
new file mode 100644
index 0000000..c27a39e
--- /dev/null
+++ b/tools/statepropbuilder/apps/spbuilder/code/sp/engine/platform.cpp
@@ -0,0 +1,94 @@
+/*
+ * sp/engine/platform.cpp
+ */
+
+
+#include <sp/interface/platform.hpp>
+
+#include <radmemory.hpp>
+#include <radplatform.hpp>
+#include <radtime.hpp>
+#include <radfile.hpp>
+#include <radthread.hpp>
+
+#include <p3d/utility.hpp>
+
+
+extern HINSTANCE SPHInstance;
+
+//---------------------------------------------------------------------------
+// SPPlatform - DLL interface
+//---------------------------------------------------------------------------
+
+int SP_CALLCONV SPPlatformOpen(HWND hwnd)
+{
+ // ftt thread init
+ radThreadInitialize();
+
+ // ftt memory init
+ radMemoryInitialize();
+
+ // ftt platform init
+ radPlatformInitialize(hwnd, SPHInstance);
+
+ // ftt time init
+ radTimeInitialize();
+
+ // ftt file init
+ radFileInitialize();
+
+ // p3d platform init
+ tPlatform* platform = tPlatform::Create(SPHInstance);
+ if (platform == 0)
+ return -1;
+
+ // game project create
+ /*
+ if (g_SPProject == 0)
+ {
+ g_SPProject = SP_PROC_NEWPROJECT();
+ P3DASSERT(g_SPProject != 0);
+ if (g_SPProject == 0)
+ return -1;
+ g_SPProject->AddRef();
+ g_SPProject->ProjectInit();
+ }
+ */
+
+ return 0;
+}
+
+int SP_CALLCONV SPPlatformClose()
+{
+ // destroy game project
+ //tRefCounted::Release(g_SPProject);
+
+ // destroy workspace
+ //tRefCounted::Release(g_SPWorkspace);
+
+ // p3d platform destroy
+ if (p3d::platform != 0)
+ {
+ tPlatform::Destroy(p3d::platform);
+ }
+
+ // ftt file destroy
+ radFileTerminate();
+
+ // ftt time destroy
+ radTimeTerminate();
+
+ // ftt platform destroy
+ radPlatformTerminate();
+
+ // ftt memory destroy
+ radMemoryTerminate();
+
+ // ftt thread destroy
+ radThreadTerminate();
+
+ return 0;
+}
+
+
+// End of file.