Skip to content
This repository has been archived by the owner on Jan 12, 2024. It is now read-only.

Commit

Permalink
Added initial load and destroy of object.
Browse files Browse the repository at this point in the history
  • Loading branch information
JaXt0r committed Nov 15, 2023
1 parent 4b06a18 commit 67a088c
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 0 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ list(APPEND PXC_SOURCES
src/ModelScript.cc
src/MorphMesh.cc
src/MultiResolutionMesh.cc
src/SaveGame.cc
src/Texture.cc
src/Vfs.cc
src/World.cc)
Expand Down
16 changes: 16 additions & 0 deletions include/phoenix/cffi/SaveGame.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
// Copyright © 2023. GothicKit Contributors
// SPDX-License-Identifier: MIT
#pragma once
#include "Api.h"

#include <stdint.h>

#ifdef __cplusplus
#include <zenkit/SaveGame.hh>
typedef struct zenkit::unstable::SaveGame PxSaveGame;
#else
typedef struct PxInternal_SaveGame PxSaveGame;
#endif

PXC_API PxSaveGame* pxSaveGameLoad(char const* path);
PXC_API void pxSaveGameDestroy(PxSaveGame* saveGame);
18 changes: 18 additions & 0 deletions src/SaveGame.cc
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
// Copyright © 2023. GothicKit Contributors
// SPDX-License-Identifier: MIT
#include "Prelude.h"

#include <phoenix/cffi/SaveGame.h>
#include <phoenix/texture.hh>

PxSaveGame* pxSaveGameLoad(char const* path) {
auto* saveGame = new PxSaveGame;

saveGame->load(path);
return saveGame;
}

PXC_API void pxSaveGameDestroy(PxSaveGame* saveGame) {
delete saveGame;
}

0 comments on commit 67a088c

Please sign in to comment.