mirror of
https://github.com/coop-deluxe/sm64coopdx.git
synced 2024-11-25 13:35:12 +00:00
All vanilla levels can be compiled through DynOS now
This commit is contained in:
parent
c0b0debf0b
commit
32388bf6ff
7 changed files with 39 additions and 9 deletions
|
@ -40,4 +40,3 @@ LevelScript* dynos_level_get(const char* levelName);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -4,6 +4,7 @@ extern "C" {
|
||||||
#include "geo_commands.h"
|
#include "geo_commands.h"
|
||||||
#include "src/game/camera.h"
|
#include "src/game/camera.h"
|
||||||
#include "src/game/envfx_snow.h"
|
#include "src/game/envfx_snow.h"
|
||||||
|
#include "src/game/paintings.h"
|
||||||
}
|
}
|
||||||
|
|
||||||
#pragma GCC diagnostic push
|
#pragma GCC diagnostic push
|
||||||
|
@ -113,6 +114,13 @@ static s64 ParseGeoSymbolArg(GfxData* aGfxData, DataNode<GeoLayout>* aNode, u64&
|
||||||
return (s64) x;
|
return (s64) x;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Complex
|
||||||
|
s32 a;
|
||||||
|
s32 b;
|
||||||
|
if (sscanf(_Arg.begin(), "PAINTING_ID(%d,%d)", &a, &b) == 2) {
|
||||||
|
return PAINTING_ID(a, b);
|
||||||
|
}
|
||||||
|
|
||||||
// Unknown
|
// Unknown
|
||||||
PrintError(" ERROR: Unknown geo arg: %s", _Arg.begin());
|
PrintError(" ERROR: Unknown geo arg: %s", _Arg.begin());
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -661,6 +661,7 @@ static void ParseGfxSymbol(GfxData* aGfxData, DataNode<Gfx>* aNode, Gfx*& aHead,
|
||||||
|
|
||||||
gfx_symbol_2(gsSPCopyLightEXT, false);
|
gfx_symbol_2(gsSPCopyLightEXT, false);
|
||||||
gfx_symbol_2(gsSPFogFactor, false);
|
gfx_symbol_2(gsSPFogFactor, false);
|
||||||
|
gfx_symbol_1(gsDPSetTextureLOD, false);
|
||||||
|
|
||||||
// Special symbols
|
// Special symbols
|
||||||
if (_Symbol == "gsSPTexture") {
|
if (_Symbol == "gsSPTexture") {
|
||||||
|
|
|
@ -9,6 +9,7 @@ extern "C" {
|
||||||
#include "src/game/level_update.h"
|
#include "src/game/level_update.h"
|
||||||
#include "include/dialog_ids.h"
|
#include "include/dialog_ids.h"
|
||||||
#include "levels/scripts.h"
|
#include "levels/scripts.h"
|
||||||
|
#include "src/game/area.h"
|
||||||
}
|
}
|
||||||
|
|
||||||
// Free data pointers, but keep nodes and tokens intact
|
// Free data pointers, but keep nodes and tokens intact
|
||||||
|
@ -658,6 +659,8 @@ s64 DynOS_Lvl_ParseLevelScriptConstants(const String& _Arg, bool* found) {
|
||||||
lvl_constant(TERRAIN_MASK);
|
lvl_constant(TERRAIN_MASK);
|
||||||
|
|
||||||
// Seq ids constants
|
// Seq ids constants
|
||||||
|
lvl_constant(SEQ_BASE_ID);
|
||||||
|
lvl_constant(SEQ_VARIATION);
|
||||||
lvl_constant(SEQ_SOUND_PLAYER);
|
lvl_constant(SEQ_SOUND_PLAYER);
|
||||||
lvl_constant(SEQ_EVENT_CUTSCENE_COLLECT_STAR);
|
lvl_constant(SEQ_EVENT_CUTSCENE_COLLECT_STAR);
|
||||||
lvl_constant(SEQ_MENU_TITLE_SCREEN);
|
lvl_constant(SEQ_MENU_TITLE_SCREEN);
|
||||||
|
@ -1376,6 +1379,18 @@ s64 DynOS_Lvl_ParseLevelScriptConstants(const String& _Arg, bool* found) {
|
||||||
lvl_constant(REGULAR_FACE);
|
lvl_constant(REGULAR_FACE);
|
||||||
lvl_constant(DIZZY_FACE);
|
lvl_constant(DIZZY_FACE);
|
||||||
|
|
||||||
|
// warp transitions
|
||||||
|
lvl_constant(WARP_TRANSITION_FADE_FROM_COLOR);
|
||||||
|
lvl_constant(WARP_TRANSITION_FADE_INTO_COLOR);
|
||||||
|
lvl_constant(WARP_TRANSITION_FADE_FROM_STAR);
|
||||||
|
lvl_constant(WARP_TRANSITION_FADE_INTO_STAR);
|
||||||
|
lvl_constant(WARP_TRANSITION_FADE_FROM_CIRCLE);
|
||||||
|
lvl_constant(WARP_TRANSITION_FADE_INTO_CIRCLE);
|
||||||
|
lvl_constant(WARP_TRANSITION_FADE_FROM_MARIO);
|
||||||
|
lvl_constant(WARP_TRANSITION_FADE_INTO_MARIO);
|
||||||
|
lvl_constant(WARP_TRANSITION_FADE_FROM_BOWSER);
|
||||||
|
lvl_constant(WARP_TRANSITION_FADE_INTO_BOWSER);
|
||||||
|
|
||||||
// vanilla geos
|
// vanilla geos
|
||||||
s32 actorCount = DynOS_Geo_GetActorCount();
|
s32 actorCount = DynOS_Geo_GetActorCount();
|
||||||
for (s32 i = 0; i < actorCount; i++) {
|
for (s32 i = 0; i < actorCount; i++) {
|
||||||
|
@ -1406,6 +1421,7 @@ static LevelScript ParseLevelScriptSymbolArg(GfxData* aGfxData, DataNode<LevelSc
|
||||||
|
|
||||||
// Other constants
|
// Other constants
|
||||||
lvl_constant(NULL);
|
lvl_constant(NULL);
|
||||||
|
lvl_constant(FALSE);
|
||||||
|
|
||||||
// Level Scripts
|
// Level Scripts
|
||||||
for (auto& _Node : aGfxData->mLevelScripts) {
|
for (auto& _Node : aGfxData->mLevelScripts) {
|
||||||
|
@ -1983,7 +1999,6 @@ static void DynOS_Lvl_GeneratePack_Recursive(const SysPath &directory, GfxData *
|
||||||
void DynOS_Lvl_GeneratePack(const SysPath &aPackFolder) {
|
void DynOS_Lvl_GeneratePack(const SysPath &aPackFolder) {
|
||||||
Print("---------- Level pack folder: \"%s\" ----------", aPackFolder.c_str());
|
Print("---------- Level pack folder: \"%s\" ----------", aPackFolder.c_str());
|
||||||
Array<Pair<u64, String>> _ActorsFolders;
|
Array<Pair<u64, String>> _ActorsFolders;
|
||||||
GfxData *_GfxData = New<GfxData>();
|
|
||||||
|
|
||||||
DIR *aPackDir = opendir(aPackFolder.c_str());
|
DIR *aPackDir = opendir(aPackFolder.c_str());
|
||||||
if (aPackDir) {
|
if (aPackDir) {
|
||||||
|
@ -2001,14 +2016,16 @@ void DynOS_Lvl_GeneratePack(const SysPath &aPackFolder) {
|
||||||
// Only parse folders with a 'script.c'
|
// Only parse folders with a 'script.c'
|
||||||
if (!fs_sys_file_exists(fstring("%s/script.c", _Folder.c_str()).c_str())) continue;
|
if (!fs_sys_file_exists(fstring("%s/script.c", _Folder.c_str()).c_str())) continue;
|
||||||
|
|
||||||
|
GfxData *_GfxData = New<GfxData>();
|
||||||
_GfxData->mModelIdentifier = 0;
|
_GfxData->mModelIdentifier = 0;
|
||||||
|
|
||||||
DynOS_Lvl_GeneratePack_Recursive(_Folder, _GfxData);
|
DynOS_Lvl_GeneratePack_Recursive(_Folder, _GfxData);
|
||||||
|
|
||||||
|
// Generate a binary file for each level found in the GfxData
|
||||||
|
DynOS_Lvl_GeneratePack_Internal(aPackFolder, _ActorsFolders, _GfxData);
|
||||||
|
DynOS_Gfx_Free(_GfxData);
|
||||||
|
|
||||||
}
|
}
|
||||||
closedir(aPackDir);
|
closedir(aPackDir);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Generate a binary file for each actor found in the GfxData
|
|
||||||
DynOS_Lvl_GeneratePack_Internal(aPackFolder, _ActorsFolders, _GfxData);
|
|
||||||
|
|
||||||
DynOS_Gfx_Free(_GfxData);
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -226,7 +226,7 @@ s32 DynOS_Level_GetCourse(s32 aLevel) {
|
||||||
|
|
||||||
const void *DynOS_Level_GetScript(s32 aLevel) {
|
const void *DynOS_Level_GetScript(s32 aLevel) {
|
||||||
DynOS_Level_Init();
|
DynOS_Level_Init();
|
||||||
return DynOS_Lvl_Get("level_jrb_entry"); // DO NOT COMMIT
|
return DynOS_Lvl_Get("level_castle_inside_entry"); // DO NOT COMMIT
|
||||||
return sDynosLevelScripts[aLevel];
|
return sDynosLevelScripts[aLevel];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -630,6 +630,11 @@ void DynOS_Lvl_Add(const SysPath &aPackFolder, const char *aLevelName) {
|
||||||
}
|
}
|
||||||
|
|
||||||
LevelScript* DynOS_Lvl_Get(const char* levelName) {
|
LevelScript* DynOS_Lvl_Get(const char* levelName) {
|
||||||
|
static u32 index = 0; // DO NOT COMMIT
|
||||||
|
index = (index + 1) % sDynosCustomLevelScripts.Count(); // DO NOT COMMIT
|
||||||
|
auto& scripts = sDynosCustomLevelScripts[index].second->mLevelScripts; // DO NOT COMMIT
|
||||||
|
return scripts[scripts.Count() - 1]->mData; // DO NOT COMMIT
|
||||||
|
|
||||||
for (s32 i = 0; i < sDynosCustomLevelScripts.Count(); ++i) {
|
for (s32 i = 0; i < sDynosCustomLevelScripts.Count(); ++i) {
|
||||||
if (!strcmp(sDynosCustomLevelScripts[i].first, levelName)) {
|
if (!strcmp(sDynosCustomLevelScripts[i].first, levelName)) {
|
||||||
auto& scripts = sDynosCustomLevelScripts[i].second->mLevelScripts;
|
auto& scripts = sDynosCustomLevelScripts[i].second->mLevelScripts;
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
#include "src/pc/platform.h"
|
#include "src/pc/platform.h"
|
||||||
#include "mod.h"
|
#include "mod.h"
|
||||||
|
|
||||||
#define MAX_MOD_SIZE (2 * 1048576) // 2MB
|
#define MAX_MOD_SIZE (5 * 1048576) // 5MB
|
||||||
#define TMP_DIRECTORY "tmp"
|
#define TMP_DIRECTORY "tmp"
|
||||||
|
|
||||||
struct Mods {
|
struct Mods {
|
||||||
|
|
Loading…
Reference in a new issue