Fix the build after archiving rpg/ui/scene: drop their last live dependents
rpg/ui/scene moved to archive/ earlier left a handful of otherwise-generic systems with dead references into them: - asset/loader/chunk existed solely to load rpg overworld map chunks (tile_t, worldpos_t) - deleted outright, along with its ASSET_LOADER_TYPE_CHUNK entry in assetloader.c/h. - save/slot wrapped party_t/storyflagval_t/map-name/cutscene-path, which is 100% rpg save data - deleted outright (save.c/h, savedevice.c/h and the Linux save backend keep their generic settings/device-discovery logic, just lose the slot read/write pieces that only existed for it). - locale/localemanager.c and test/CMakeLists.txt/test/save/* had a few stray includes and test cases that only existed for the now-gone code. Also restores assets/locale/en_US.po (copied back from archive/assets/) - locale init still needs a real locale file to boot into, even with the asset-moving/archiving done separately. Co-Authored-By: Claude Sonnet 5 <[email protected]>
This commit is contained in:
1 parent
f6b884bf7f
commit
fdfdfa3a66
31 files changed
+292
-1994
No files matched your search
@@ -10,9 +10,6 @@
|
||||
|
||||
#include "savetestfixture.h"
|
||||
#include "assert/assert.h"
|
||||
#include "asset/asset.h"
|
||||
#include "asset/loader/assetloader.h"
|
||||
#include "asset/loader/assetentry.h"
|
||||
#include "util/memory.h"
|
||||
#include "util/string.h"
|
||||
#include <ftw.h>
|
||||
@@ -25,51 +22,6 @@ static char_t SAVE_TEST_FIXTURE_HOME[PATH_MAX];
|
||||
static char_t SAVE_TEST_FIXTURE_REAL_HOME[PATH_MAX];
|
||||
static bool_t SAVE_TEST_FIXTURE_HAD_REAL_HOME;
|
||||
|
||||
static const char_t *SAVE_TEST_FIXTURE_PARTY_JSON =
|
||||
"{\"members\":{\"hero\":{"
|
||||
"\"attack\":10,\"defense\":5,\"magic\":0,\"speed\":10,\"luck\":0,"
|
||||
"\"healthMax\":30,\"mpMax\":10"
|
||||
"}}}";
|
||||
|
||||
static yyjson_doc *SAVE_TEST_FIXTURE_PARTY_DOC = NULL;
|
||||
|
||||
errorret_t saveTestFixturePartyJsonLoadSyncStub(assetloading_t *loading) {
|
||||
loading->entry->data.json = SAVE_TEST_FIXTURE_PARTY_DOC;
|
||||
loading->entry->state = ASSET_ENTRY_STATE_LOADED;
|
||||
errorOk();
|
||||
}
|
||||
|
||||
errorret_t saveTestFixturePartyJsonDisposeStub(assetentry_t *entry) {
|
||||
errorOk();
|
||||
}
|
||||
|
||||
void saveTestFixtureStubPartyAsset(void) {
|
||||
memoryZero(&ASSET, sizeof(ASSET));
|
||||
for(size_t i = 0; i < ASSET_LOADING_COUNT_MAX; i++) {
|
||||
threadMutexInit(&ASSET.loading[i].mutex);
|
||||
}
|
||||
|
||||
if(SAVE_TEST_FIXTURE_PARTY_DOC == NULL) {
|
||||
SAVE_TEST_FIXTURE_PARTY_DOC = yyjson_read(
|
||||
SAVE_TEST_FIXTURE_PARTY_JSON, strlen(SAVE_TEST_FIXTURE_PARTY_JSON), 0
|
||||
);
|
||||
assertNotNull(
|
||||
SAVE_TEST_FIXTURE_PARTY_DOC, "Failed to parse party JSON fixture"
|
||||
);
|
||||
}
|
||||
|
||||
ASSET_LOADER_CALLBACKS[ASSET_LOADER_TYPE_JSON].loadSync =
|
||||
saveTestFixturePartyJsonLoadSyncStub;
|
||||
ASSET_LOADER_CALLBACKS[ASSET_LOADER_TYPE_JSON].dispose =
|
||||
saveTestFixturePartyJsonDisposeStub;
|
||||
}
|
||||
|
||||
void saveTestFixtureUnstubPartyAsset(void) {
|
||||
if(SAVE_TEST_FIXTURE_PARTY_DOC == NULL) return;
|
||||
yyjson_doc_free(SAVE_TEST_FIXTURE_PARTY_DOC);
|
||||
SAVE_TEST_FIXTURE_PARTY_DOC = NULL;
|
||||
}
|
||||
|
||||
static int_t saveTestFixtureRemoveEntry(
|
||||
const char *path,
|
||||
const struct stat *statBuffer,
|
||||
@@ -97,8 +49,6 @@ int saveTestFixtureSetup(void **state) {
|
||||
|
||||
assertTrue(setenv("HOME", SAVE_TEST_FIXTURE_HOME, 1) == 0, "setenv failed");
|
||||
|
||||
saveTestFixtureStubPartyAsset();
|
||||
|
||||
errorret_t ret = saveInit();
|
||||
assertTrue(errorIsOk(ret), "saveInit failed in test fixture");
|
||||
|
||||
@@ -106,8 +56,6 @@ int saveTestFixtureSetup(void **state) {
|
||||
}
|
||||
|
||||
int saveTestFixtureTeardown(void **state) {
|
||||
saveTestFixtureUnstubPartyAsset();
|
||||
|
||||
nftw(
|
||||
SAVE_TEST_FIXTURE_HOME, saveTestFixtureRemoveEntry, 16,
|
||||
FTW_DEPTH | FTW_PHYS
|
||||
|
||||
Reference in new issue
Block a user