Skip to content

Commit

Permalink
include_cpp folder
Browse files Browse the repository at this point in the history
  • Loading branch information
SeekyCt committed Sep 17, 2024
1 parent d2db8b4 commit 701ca2b
Show file tree
Hide file tree
Showing 21 changed files with 18 additions and 5 deletions.
2 changes: 2 additions & 0 deletions .vscode.example/c_cpp_properties.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"name": "Linux",
"includePath": [
"${workspaceFolder}/spm-headers/include",
"${workspaceFolder}/spm-headers/include_cpp",
"${workspaceFolder}/spm-headers/decomp",
"${workspaceFolder}/build/EU0/include"
],
Expand All @@ -27,6 +28,7 @@
"name": "Win32",
"includePath": [
"${workspaceFolder}/spm-headers/include",
"${workspaceFolder}/spm-headers/include_cpp",
"${workspaceFolder}/spm-headers/decomp",
"${workspaceFolder}/build/EU0/include"
],
Expand Down
1 change: 1 addition & 0 deletions configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,7 @@
"-DDECOMP",
f"-DSPM_{config.version.upper()}",
f"-i {SPM_HEADERS}/include",
f"-i {SPM_HEADERS}/include_cpp",
f"-i {SPM_HEADERS}/decomp",
]

Expand Down
10 changes: 7 additions & 3 deletions spm-headers/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,19 @@ It is recommended to use this with [git subrepo](https://github.com/ingydotnet/g

## Decomp

For use in decomp, the `include` and `decomp` folders should be added to the include path, and the preprocessor define `DECOMP` should be used.
For use in decomp, the `include`, `include_cpp` and `decomp` folders should be added to the include path, and the preprocessor define `DECOMP` should be used.

## Mods

For use in mods, the `include` and `mod` folder should be added to the include path and an lst from `linker` should be used. If including your compiler's C++ standard library, the preprocessor define `USE_STL` should be used.
For use in mods, the `include`, `include_cpp` and `mod` folder should be added to the include path and an lst from `linker` should be used. If including your compiler's C++ standard library, the preprocessor define `USE_STL` should be used.

## C

For the cases where C is required (such as m2c or maybe some niche modding cases), omitting the `include_cpp` folder should be all that's neccessary.

# Licensing

All code originally written for this project (everything under the `include`, `decomp` and `linker` directories) is available under the MIT license.
All code originally written for this project (everything under the `include`, `include_cpp`, `decomp` and `linker` directories) is available under the MIT license.

Everything under the `mod` folder is available under the GPLv3 license as it's derived from other GPL code.

Expand Down
7 changes: 7 additions & 0 deletions spm-headers/include/spm/seq_title.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,13 @@
#include <common.h>
#include <spm/seqdrv.h>
#include <wii/mem.h>

#ifdef __cplusplus
#include <nw4r/lyt/arcResourceAccessor.h>
#include <nw4r/lyt/animation.h>
#include <nw4r/lyt/drawInfo.h>
#include <nw4r/lyt/layout.h>
#endif

CPP_WRAPPER(spm::seq_title)

Expand Down Expand Up @@ -41,12 +44,16 @@ typedef struct
/* 0x10 */ u32 heapSize;
/* 0x14 */ void * heapHandle;
/* 0x18 */ MEMAllocator allocator;
#ifdef __cplusplus
/* 0x28 */ nw4r::lyt::ArcResourceAccessor * arcResAccessor;
/* 0x2C */ nw4r::lyt::Layout * layout;
/* 0x30 */ nw4r::lyt::Pane * pushu2Pane;
/* 0x30 */ nw4r::lyt::Pane * pushuBotanPane;
/* 0x38 */ nw4r::lyt::AnimTransform * animations[2]; // 0 start, 1 loop
/* 0x40 */ nw4r::lyt::DrawInfo drawInfo;
#else
/* 0x28 */ u8 cpp_pad[0x94 - 0x28];
#endif
/* 0x94 */ s32 animNum;
/* 0x98 */ f32 animFrame;
} SeqTitleWork;
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
3 changes: 1 addition & 2 deletions tools/decompctx.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,8 @@
root_dir = os.path.abspath(os.path.join(script_dir, ".."))
src_dir = os.path.join(root_dir, "src")
include_dirs = [
os.path.join(root_dir, "include"),
# Add additional include directories here
os.path.join(root_dir, "spm-headers", "include"),
os.path.join(root_dir, "spm-headers", "include_cpp"),
os.path.join(root_dir, "spm-headers", "decomp"),
]

Expand Down

0 comments on commit 701ca2b

Please sign in to comment.