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
@@ -47,6 +47,7 @@
|
||||
#include "GameLib/RaceMotionData.h"
|
||||
#include "GameLib/FlyingData.h"
|
||||
#include "GameLib/FlyingObjectManager.h"
|
||||
#include "EffectLib/EffectManager.h"
|
||||
#include "GameLib/ItemManager.h"
|
||||
#include "UserInterface/PythonItem.h"
|
||||
#include "UserInterface/StdAfx.h"
|
||||
@@ -503,6 +504,27 @@ int main(int argc, char** argv)
|
||||
CHECK(!CFlyingManager::Instance().RegisterFlyingData(msf));
|
||||
}
|
||||
|
||||
// EffectLib: playersettingmodule.py registered the level-up effect (chrmgr.RegisterEffect → CEffectManager::
|
||||
// RegisterEffect2, including the .mse files the .msf fly data attach by relative name). Created at the
|
||||
// actor, RenderGame's CEffectManager::Render draws its particles as textured, alpha-blended world draws.
|
||||
if (main_instance)
|
||||
{
|
||||
const char* mse = "d:/ymir work/effect/etc/levelup_1/level_up.mse";
|
||||
TPixelPosition here = {};
|
||||
main_instance->NEW_GetPixelPosition(&here);
|
||||
CEffectManager& effects = CEffectManager::Instance();
|
||||
const int index = effects.CreateEffect(mse, D3DXVECTOR3(here.x, -here.y, here.z), D3DXVECTOR3(0, 0, 0));
|
||||
CHECK(index >= 0 && effects.IsAliveEffect(index));
|
||||
auto effect_draw = [] {
|
||||
for (const Render3DDraw& d : Render3DDraws())
|
||||
if (!d.pretransformed && d.alpha_blend && d.texture0.find("effect\\etc\\levelup_1\\") != std::string::npos)
|
||||
return true;
|
||||
return false;
|
||||
};
|
||||
CHECK(pump_until(3, effect_draw));
|
||||
effects.DestroyEffectInstance(index);
|
||||
}
|
||||
|
||||
// item module (PythonItemModule.cpp) over the loaded item_proto: SelectItem + the selected item's fields.
|
||||
CHECK(py("import item\n"
|
||||
"item.SelectItem(19)\n"
|
||||
|
||||
@@ -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