port: EffectLib + EterBase/Utils platform bodies (1:1 40250)
EffectLib's 18 units are copied verbatim (Type.h: drop a comment backslash that clang splices into the next enum line). The remaining Utils stubs get the 40250 bodies, so .msf fly data resolve relative .mse attachments, and CPythonResource registers mde/mdatr as 40250 does. login_flow spawns level_up.mse and sees its particle draws. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
03de3f314a
commit
b69116992c
@@ -2,6 +2,9 @@
|
||||
#include "EterBase/Utils.h"
|
||||
|
||||
#include <cstdio>
|
||||
#include <cstring>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
int main()
|
||||
{
|
||||
@@ -21,5 +24,38 @@ int main()
|
||||
check(fMAX(200.0f, 0.0f) == 200.0f, "fMAX camera floor");
|
||||
check(fMINMAX(2.0f, -5.0f, 9.0f) == 2.0f, "fMINMAX lower");
|
||||
check(fMINMAX(2.0f, 20.0f, 9.0f) == 9.0f, "fMINMAX upper");
|
||||
|
||||
// Path helpers (40250 bodies): CFlyingData::LoadScriptFile resolves a relative attach .mse against
|
||||
// GetOnlyPathName of the .msf unless IsGlobalFileName (a drive letter) says it is already absolute.
|
||||
check(std::string(GetOnlyPathName("d:/ymir work/effect/a.msf")) == "d:/ymir work/effect/", "GetOnlyPathName dir");
|
||||
check(std::string(GetOnlyPathName("a.msf")).empty(), "GetOnlyPathName bare");
|
||||
check(IsGlobalFileName("d:/ymir work/a.mse") && !IsGlobalFileName("etc/a.mse"), "IsGlobalFileName");
|
||||
std::string name;
|
||||
GetOnlyFileName("d:\\ymir work\\a.mse", name);
|
||||
check(name == "a.mse", "GetOnlyFileName backslash");
|
||||
std::string path, stem, ext;
|
||||
GetFilePathNameExtension("d:/x/y.tar.gz", (int) strlen("d:/x/y.tar.gz"), &path, &stem, &ext);
|
||||
check(path == "d:/x/" && stem == "y.tar" && ext == "gz", "GetFilePathNameExtension");
|
||||
ext.clear();
|
||||
GetFileExtension("a/b.mse", 7, &ext);
|
||||
check(ext == "mse", "GetFileExtension");
|
||||
char p[64] = {}, n[64] = {}, e[64] = {};
|
||||
GetFileNameParts("d:/x/y.dds", 10, p, n, e);
|
||||
check(!strcmp(p, "d:/x/") && !strcmp(n, "y") && !strcmp(e, "dds"), "GetFileNameParts");
|
||||
std::vector<std::string> tokens;
|
||||
check(SplitLine("a \"b c\" d", " ", &tokens) && tokens.size() == 3 && tokens[1] == "b c", "SplitLine quotes");
|
||||
std::string except = "a-b-c";
|
||||
StringExceptCharacter(&except, "-");
|
||||
check(except == "abc", "StringExceptCharacter");
|
||||
char indexed[32] = "tex";
|
||||
GetIndexingName(indexed, 12);
|
||||
GetOldIndexingName(indexed, 7);
|
||||
check(!strcmp(indexed, "tex127"), "GetIndexingName/GetOldIndexingName");
|
||||
std::string local;
|
||||
check(GetLocalFileName("D:\\ymir\\", "d:/ymir/a.dds", &local) && local == "a.dds", "GetLocalFileName");
|
||||
int argc = 0;
|
||||
PCHAR* argv = CommandLineToArgv(const_cast<PCHAR>("x \"y z\" w"), &argc);
|
||||
check(argc == 3 && !strcmp(argv[1], "y z"), "CommandLineToArgv");
|
||||
free(argv);
|
||||
return failures ? 1 : 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user