Remove rpg, ui, editor and scene subfolders; split scripts by platform
Delete src/dusk/rpg, src/dusk/ui, the animation/keyframe modules, the scene subfolders, the chunk asset loader and ./editor, and strip the dependent save slot, scene type, engine and test code so the main binary and tests build again. Add scene/node.c/.h skeleton and move build scripts into scripts/<platform>/. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
This commit is contained in:
1 parent
3948607b1e
commit
31ee7989de
464 files changed
+70
-33009
No files matched your search
@@ -15,19 +15,6 @@
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
// saveSlotInit() seeds the party roster via partyInit(), which loads
|
||||
// party.jsonc through the real asset system - stub it out (see
|
||||
// savetestfixture.h) rather than needing a real asset bundle here.
|
||||
static int assetGroupSetup(void **state) {
|
||||
saveTestFixtureStubPartyAsset();
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int assetGroupTeardown(void **state) {
|
||||
saveTestFixtureUnstubPartyAsset();
|
||||
return 0;
|
||||
}
|
||||
|
||||
// ============================================================
|
||||
// Helpers - wrap the writeInit/readInit macros (which can only be used
|
||||
// inside a function returning errorret_t) so tests can call them plainly.
|
||||
@@ -156,12 +143,6 @@ static void test_saveSlotReadJSON_roundTrip(void **state) {
|
||||
SAVE.slot.cachedData.name, "Hero", sizeof(SAVE.slot.cachedData.name)
|
||||
);
|
||||
SAVE.slot.cachedData.playerLevel = 42;
|
||||
// An in-use slot (non-empty name) requires a non-empty map name too -
|
||||
// see saveSlotNewGame/requireStrMin("mapName", 1) in saveSlotVer1ReadJSON.
|
||||
stringCopy(
|
||||
SAVE.slot.cachedData.mapName, "overworld",
|
||||
sizeof(SAVE.slot.cachedData.mapName)
|
||||
);
|
||||
|
||||
char_t *json;
|
||||
size_t len;
|
||||
@@ -178,7 +159,6 @@ static void test_saveSlotReadJSON_roundTrip(void **state) {
|
||||
|
||||
assert_true(stringEquals(read.cachedData.name, "Hero"));
|
||||
assert_int_equal(read.cachedData.playerLevel, 42);
|
||||
assert_true(stringEquals(read.cachedData.mapName, "overworld"));
|
||||
assert_true(read.cachedData.time.time == writtenTime.time);
|
||||
|
||||
// version/dataType are struct-only bookkeeping, never serialized - the
|
||||
@@ -199,33 +179,18 @@ static void test_saveSlotReadJSON_blankSlot_shortCircuits(void **state) {
|
||||
|
||||
// No "name" key (or an empty one) means a blank/never-used slot (see
|
||||
// saveSlotInUse) - the reader returns right after reading that, without
|
||||
// needing or validating time/mapName/partyMembers/partyOrder at all, so
|
||||
// needing or validating time at all, so
|
||||
// this succeeds despite omitting fields that would otherwise be required.
|
||||
errorret_t ret = slotFromJSON(&slot, "{\"version\":1}");
|
||||
assert_true(errorIsOk(ret));
|
||||
|
||||
assert_int_equal(slot.cachedData.name[0], '\0');
|
||||
assert_int_equal(slot.cachedData.mapName[0], '\0');
|
||||
// Not readInt32's own default of 1 - the early return happens before
|
||||
// playerLevel is ever read, leaving the zero-init saveSlotCurrentReadJSON
|
||||
// seeds ver1 with (see the memoryZero in saveSlotCurrentReadJSON).
|
||||
assert_int_equal(slot.cachedData.playerLevel, 0);
|
||||
}
|
||||
|
||||
static void test_saveSlotReadJSON_inUseMissingMapName_errors(void **state) {
|
||||
saveslot_t slot;
|
||||
|
||||
// "name" is present (in use) but "mapName" is missing - a real save
|
||||
// (via saveSlotNewGame) always has both, so this is corrupt.
|
||||
errorret_t ret = slotFromJSON(
|
||||
&slot,
|
||||
"{\"version\":1,\"name\":\"Hero\","
|
||||
"\"time\":{\"time\":1.0,\"timeZone\":0.0,\"offsetTime\":0.0}}"
|
||||
);
|
||||
assert_true(errorIsNotOk(ret));
|
||||
errorCatch(ret);
|
||||
}
|
||||
|
||||
static void test_saveSlotReadJSON_missingTimeKey_errors(void **state) {
|
||||
saveslot_t slot;
|
||||
|
||||
@@ -302,7 +267,6 @@ int main(void) {
|
||||
cmocka_unit_test(test_saveSlotReadJSON_nullAsserts),
|
||||
cmocka_unit_test(test_saveSlotReadJSON_roundTrip),
|
||||
cmocka_unit_test(test_saveSlotReadJSON_blankSlot_shortCircuits),
|
||||
cmocka_unit_test(test_saveSlotReadJSON_inUseMissingMapName_errors),
|
||||
cmocka_unit_test(test_saveSlotReadJSON_missingTimeKey_errors),
|
||||
cmocka_unit_test(test_saveSlotReadJSON_nameTooLong_errors),
|
||||
cmocka_unit_test(test_saveSlotReadJSON_nonObjectRoot_errors),
|
||||
@@ -310,5 +274,5 @@ int main(void) {
|
||||
cmocka_unit_test(test_saveSlotReadJSON_versionMismatch_errors),
|
||||
};
|
||||
|
||||
return cmocka_run_group_tests(tests, assetGroupSetup, assetGroupTeardown);
|
||||
return cmocka_run_group_tests(tests, NULL, NULL);
|
||||
}
|
||||
Reference in new issue
Block a user