grannysmith-technical/content/decompiled_src/script_load.c

284 lines
16 KiB
C
Raw Normal View History

/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */
/* Script::load(QiString const&) */
void __thiscall Script::load(Script *this,QiString *param_1)
{
Game *this_00;
char cVar1;
char cVar2;
char *pcVar3;
undefined4 uVar4;
QiTimer aQStack_180 [16];
char *apcStack_170 [2];
char acStack_160 [16];
undefined **local_150 [2];
undefined **local_140 [2];
undefined *local_130;
undefined auStack_128 [256];
undefined8 local_28;
undefined8 local_20;
undefined8 local_18;
undefined8 local_10;
long local_8;
*(undefined8 *)(this + 0x58) = 0;
local_8 = ___stack_chk_guard;
unload(this);
QiScript::init((QiScript *)this);
*(Script **)this = this;
QiInputStream::QiInputStream((QiInputStream *)local_150,1);
QiOutputStream::QiOutputStream((QiOutputStream *)local_140,1);
local_20 = 0;
local_150[0] = &PTR__QiMemoryStream_00427560;
local_140[0] = &PTR__QiMemoryStream_00427598;
local_130 = auStack_128;
local_28 = 0x100;
local_18 = 0;
local_10 = 0;
cVar1 = ResMan::load(*(ResMan **)(this + 0x20),param_1,(QiOutputStream *)local_140);
if (cVar1 == '\0') {
pcVar3 = "Could not load script: ";
cVar1 = '\0';
}
else {
QiString::QiString((QiString *)apcStack_170,"");
cVar1 = QiScript::load((QiScript *)this,(QiString *)apcStack_170,(QiInputStream *)local_150,
(int)local_10);
QiString::~QiString((QiString *)apcStack_170);
if (cVar1 != '\0') {
QiString::QiString((QiString *)apcStack_170,"mgCreateImage");
QiScript::registerFunction((QiScript *)this,(QiString *)apcStack_170,FUN_0018297c);
QiString::~QiString((QiString *)apcStack_170);
QiString::QiString((QiString *)apcStack_170,"mgCreateImage");
QiScript::registerFunction((QiScript *)this,(QiString *)apcStack_170,FUN_0018297c);
QiString::~QiString((QiString *)apcStack_170);
QiString::QiString((QiString *)apcStack_170,"mgCreateUi");
QiScript::registerFunction((QiScript *)this,(QiString *)apcStack_170,FUN_00183854);
QiString::~QiString((QiString *)apcStack_170);
QiString::QiString((QiString *)apcStack_170,"mgCreateText");
QiScript::registerFunction((QiScript *)this,(QiString *)apcStack_170,FUN_001831f8);
QiString::~QiString((QiString *)apcStack_170);
QiString::QiString((QiString *)apcStack_170,"mgSetOrigo");
QiScript::registerFunction((QiScript *)this,(QiString *)apcStack_170,FUN_00188a18);
QiString::~QiString((QiString *)apcStack_170);
QiString::QiString((QiString *)apcStack_170,"mgSetCrop");
QiScript::registerFunction((QiScript *)this,(QiString *)apcStack_170,FUN_0018a554);
QiString::~QiString((QiString *)apcStack_170);
QiString::QiString((QiString *)apcStack_170,"mgRadioSelect");
QiScript::registerFunction((QiScript *)this,(QiString *)apcStack_170,FUN_0018a940);
QiString::~QiString((QiString *)apcStack_170);
QiString::QiString((QiString *)apcStack_170,"mgSetUiEnabled");
QiScript::registerFunction((QiScript *)this,(QiString *)apcStack_170,FUN_0018a8d8);
QiString::~QiString((QiString *)apcStack_170);
QiString::QiString((QiString *)apcStack_170,"mgSetUiModal");
QiScript::registerFunction((QiScript *)this,(QiString *)apcStack_170,FUN_0018a870);
QiString::~QiString((QiString *)apcStack_170);
QiString::QiString((QiString *)apcStack_170,"mgSetText");
QiScript::registerFunction((QiScript *)this,(QiString *)apcStack_170,FUN_0018ab18);
QiString::~QiString((QiString *)apcStack_170);
QiString::QiString((QiString *)apcStack_170,"mgSetPos");
QiScript::registerFunction((QiScript *)this,(QiString *)apcStack_170,FUN_00189864);
QiString::~QiString((QiString *)apcStack_170);
QiString::QiString((QiString *)apcStack_170,"mgSetRot");
QiScript::registerFunction((QiScript *)this,(QiString *)apcStack_170,FUN_00189e28);
QiString::~QiString((QiString *)apcStack_170);
QiString::QiString((QiString *)apcStack_170,"mgSetScale");
QiScript::registerFunction((QiScript *)this,(QiString *)apcStack_170,FUN_00189564);
QiString::~QiString((QiString *)apcStack_170);
QiString::QiString((QiString *)apcStack_170,"mgSetAlpha");
QiScript::registerFunction((QiScript *)this,(QiString *)apcStack_170,FUN_00189b50);
QiString::~QiString((QiString *)apcStack_170);
QiString::QiString((QiString *)apcStack_170,"mgSetColor");
QiScript::registerFunction((QiScript *)this,(QiString *)apcStack_170,FUN_0018a100);
QiString::~QiString((QiString *)apcStack_170);
QiString::QiString((QiString *)apcStack_170,"mgGetPos");
QiScript::registerFunction((QiScript *)this,(QiString *)apcStack_170,FUN_0018937c);
QiString::~QiString((QiString *)apcStack_170);
QiString::QiString((QiString *)apcStack_170,"mgGetRot");
QiScript::registerFunction((QiScript *)this,(QiString *)apcStack_170,FUN_00188fd0);
QiString::~QiString((QiString *)apcStack_170);
QiString::QiString((QiString *)apcStack_170,"mgGetScale");
QiScript::registerFunction((QiScript *)this,(QiString *)apcStack_170,FUN_00189194);
QiString::~QiString((QiString *)apcStack_170);
QiString::QiString((QiString *)apcStack_170,"mgGetAlpha");
QiScript::registerFunction((QiScript *)this,(QiString *)apcStack_170,FUN_00188e0c);
QiString::~QiString((QiString *)apcStack_170);
QiString::QiString((QiString *)apcStack_170,"mgGetColor");
QiScript::registerFunction((QiScript *)this,(QiString *)apcStack_170,FUN_00188c18);
QiString::~QiString((QiString *)apcStack_170);
QiString::QiString((QiString *)apcStack_170,"mgIsVisible");
QiScript::registerFunction((QiScript *)this,(QiString *)apcStack_170,FUN_001889b4);
QiString::~QiString((QiString *)apcStack_170);
QiString::QiString((QiString *)apcStack_170,"mgDraw");
QiScript::registerFunction((QiScript *)this,(QiString *)apcStack_170,FUN_0018894c);
QiString::~QiString((QiString *)apcStack_170);
QiString::QiString((QiString *)apcStack_170,"mgGet");
QiScript::registerFunction((QiScript *)this,(QiString *)apcStack_170,FUN_00182578);
QiString::~QiString((QiString *)apcStack_170);
QiString::QiString((QiString *)apcStack_170,"mgSet");
QiScript::registerFunction((QiScript *)this,(QiString *)apcStack_170,FUN_001824d8);
QiString::~QiString((QiString *)apcStack_170);
QiString::QiString((QiString *)apcStack_170,"mgCommand");
QiScript::registerFunction((QiScript *)this,(QiString *)apcStack_170,FUN_00182438);
QiString::~QiString((QiString *)apcStack_170);
QiString::QiString((QiString *)apcStack_170,"mgScriptTime");
QiScript::registerFunction((QiScript *)this,(QiString *)apcStack_170,FUN_0018135c);
QiString::~QiString((QiString *)apcStack_170);
QiString::QiString((QiString *)apcStack_170,"mgScriptFrame");
QiScript::registerFunction((QiScript *)this,(QiString *)apcStack_170,FUN_001813a8);
QiString::~QiString((QiString *)apcStack_170);
QiString::QiString((QiString *)apcStack_170,"mgFullScreenColor");
QiScript::registerFunction((QiScript *)this,(QiString *)apcStack_170,FUN_00182364);
QiString::~QiString((QiString *)apcStack_170);
QiString::QiString((QiString *)apcStack_170,"mgCreateSound");
QiScript::registerFunction((QiScript *)this,(QiString *)apcStack_170,FUN_00183558);
QiString::~QiString((QiString *)apcStack_170);
QiString::QiString((QiString *)apcStack_170,"mgPlaySound");
QiScript::registerFunction((QiScript *)this,(QiString *)apcStack_170,FUN_0018acfc);
QiString::~QiString((QiString *)apcStack_170);
QiString::QiString((QiString *)apcStack_170,"mgIsTouched");
QiScript::registerFunction((QiScript *)this,(QiString *)apcStack_170,FUN_001820a4);
QiString::~QiString((QiString *)apcStack_170);
QiString::QiString((QiString *)apcStack_170,"mgGetLastTouch");
QiScript::registerFunction((QiScript *)this,(QiString *)apcStack_170,FUN_00181328);
QiString::~QiString((QiString *)apcStack_170);
QiString::QiString((QiString *)apcStack_170,"mgGetScreenCoord");
QiScript::registerFunction((QiScript *)this,(QiString *)apcStack_170,FUN_00181f90);
QiString::~QiString((QiString *)apcStack_170);
QiString::QiString((QiString *)apcStack_170,"mgGetLevelInfo");
QiScript::registerFunction((QiScript *)this,(QiString *)apcStack_170,FUN_00181e84);
QiString::~QiString((QiString *)apcStack_170);
QiString::QiString((QiString *)apcStack_170,"mgIsCharacterAvailable");
QiScript::registerFunction((QiScript *)this,(QiString *)apcStack_170,FUN_00181dfc);
QiString::~QiString((QiString *)apcStack_170);
QiString::QiString((QiString *)apcStack_170,"mgCreateCanvas");
QiScript::registerFunction((QiScript *)this,(QiString *)apcStack_170,FUN_00182e9c);
QiString::~QiString((QiString *)apcStack_170);
QiString::QiString((QiString *)apcStack_170,"mgPushCanvas");
QiScript::registerFunction((QiScript *)this,(QiString *)apcStack_170,FUN_0018be74);
QiString::~QiString((QiString *)apcStack_170);
QiString::QiString((QiString *)apcStack_170,"mgPopCanvas");
QiScript::registerFunction((QiScript *)this,(QiString *)apcStack_170,FUN_0018bfc8);
QiString::~QiString((QiString *)apcStack_170);
QiString::QiString((QiString *)apcStack_170,"mgSetCanvasEnabled");
QiScript::registerFunction((QiScript *)this,(QiString *)apcStack_170,FUN_0018b134);
QiString::~QiString((QiString *)apcStack_170);
QiString::QiString((QiString *)apcStack_170,"mgSetCanvasWindow");
QiScript::registerFunction((QiScript *)this,(QiString *)apcStack_170,FUN_0018b090);
QiString::~QiString((QiString *)apcStack_170);
QiString::QiString((QiString *)apcStack_170,"mgSetCanvasMovable");
QiScript::registerFunction((QiScript *)this,(QiString *)apcStack_170,FUN_0018afa8);
QiString::~QiString((QiString *)apcStack_170);
QiString::QiString((QiString *)apcStack_170,"mgGetUiSelectionCount");
QiScript::registerFunction((QiScript *)this,(QiString *)apcStack_170,FUN_0018a830);
QiString::~QiString((QiString *)apcStack_170);
QiString::QiString((QiString *)apcStack_170,"mgGetUiSelectionInfo");
QiScript::registerFunction((QiScript *)this,(QiString *)apcStack_170,FUN_0018a764);
QiString::~QiString((QiString *)apcStack_170);
QiString::QiString((QiString *)apcStack_170,"mgDrawReplay");
QiScript::registerFunction((QiScript *)this,(QiString *)apcStack_170,FUN_0018273c);
QiString::~QiString((QiString *)apcStack_170);
QiString::QiString((QiString *)apcStack_170,"mgGetPose");
QiScript::registerFunction((QiScript *)this,(QiString *)apcStack_170,FUN_00181b30);
QiString::~QiString((QiString *)apcStack_170);
QiString::QiString((QiString *)apcStack_170,"mgSetPose");
QiScript::registerFunction((QiScript *)this,(QiString *)apcStack_170,FUN_00181c58);
QiString::~QiString((QiString *)apcStack_170);
QiString::QiString((QiString *)apcStack_170,"mgGetVelocity");
QiScript::registerFunction((QiScript *)this,(QiString *)apcStack_170,FUN_001840d8);
QiString::~QiString((QiString *)apcStack_170);
QiString::QiString((QiString *)apcStack_170,"mgSetVelocity");
QiScript::registerFunction((QiScript *)this,(QiString *)apcStack_170,FUN_00183f30);
QiString::~QiString((QiString *)apcStack_170);
QiString::QiString((QiString *)apcStack_170,"mgSetFilter");
QiScript::registerFunction((QiScript *)this,(QiString *)apcStack_170,FUN_001846e8);
QiString::~QiString((QiString *)apcStack_170);
QiString::QiString((QiString *)apcStack_170,"mgSetDynamic");
QiScript::registerFunction((QiScript *)this,(QiString *)apcStack_170,FUN_00183c8c);
QiString::~QiString((QiString *)apcStack_170);
QiString::QiString((QiString *)apcStack_170,"mgMove");
QiScript::registerFunction((QiScript *)this,(QiString *)apcStack_170,FUN_0018438c);
QiString::~QiString((QiString *)apcStack_170);
QiString::QiString((QiString *)apcStack_170,"mgRotate");
QiScript::registerFunction((QiScript *)this,(QiString *)apcStack_170,FUN_00183dc4);
QiString::~QiString((QiString *)apcStack_170);
QiString::QiString((QiString *)apcStack_170,"mgGetDistanceBetweenBodies");
QiScript::registerFunction((QiScript *)this,(QiString *)apcStack_170,FUN_00184508);
QiString::~QiString((QiString *)apcStack_170);
QiString::QiString((QiString *)apcStack_170,"mgGetDistanceToPoint");
QiScript::registerFunction((QiScript *)this,(QiString *)apcStack_170,FUN_00184234);
QiString::~QiString((QiString *)apcStack_170);
QiString::QiString((QiString *)apcStack_170,"mgInSensor");
QiScript::registerFunction((QiScript *)this,(QiString *)apcStack_170,FUN_0018193c);
QiString::~QiString((QiString *)apcStack_170);
QiString::QiString((QiString *)apcStack_170,"mgBreakJoint");
QiScript::registerFunction((QiScript *)this,(QiString *)apcStack_170,FUN_0018180c);
QiString::~QiString((QiString *)apcStack_170);
QiString::QiString((QiString *)apcStack_170,"mgSetSensorEnabled");
QiScript::registerFunction((QiScript *)this,(QiString *)apcStack_170,FUN_001816c8);
QiString::~QiString((QiString *)apcStack_170);
QiString::QiString((QiString *)apcStack_170,"mgIsGrabbed");
QiScript::registerFunction((QiScript *)this,(QiString *)apcStack_170,FUN_00181500);
QiString::~QiString((QiString *)apcStack_170);
QiString::QiString((QiString *)apcStack_170,"mgIsBroken");
QiScript::registerFunction((QiScript *)this,(QiString *)apcStack_170,FUN_001813b8);
QiString::~QiString((QiString *)apcStack_170);
QiString::QiString((QiString *)apcStack_170,"mgCreateEffect");
QiScript::registerFunction((QiScript *)this,(QiString *)apcStack_170,FUN_0018c074);
QiString::~QiString((QiString *)apcStack_170);
QiString::QiString((QiString *)apcStack_170,"mgParticle");
QiScript::registerFunction((QiScript *)this,(QiString *)apcStack_170,FUN_0018b49c);
QiString::~QiString((QiString *)apcStack_170);
QiString::QiString((QiString *)apcStack_170,"mgRnd");
QiScript::registerFunction((QiScript *)this,(QiString *)apcStack_170,FUN_001812d4);
QiString::~QiString((QiString *)apcStack_170);
QiString::QiString((QiString *)apcStack_170,"mgParticlePoof");
QiScript::registerFunction((QiScript *)this,(QiString *)apcStack_170,FUN_0018b2c4);
QiString::~QiString((QiString *)apcStack_170);
QiString::QiString((QiString *)apcStack_170,"mgCameraShake");
QiScript::registerFunction((QiScript *)this,(QiString *)apcStack_170,FUN_00181268);
QiString::~QiString((QiString *)apcStack_170);
QiTimer::QiTimer(aQStack_180);
QiString::QiString((QiString *)apcStack_170,"init");
cVar2 = QiScript::hasFunction((QiScript *)this,(QiString *)apcStack_170);
QiString::~QiString((QiString *)apcStack_170);
if (cVar2 != '\0') {
QiString::QiString((QiString *)apcStack_170,"init()");
QiScript::execute((QiScript *)this,(QiString *)apcStack_170);
QiString::~QiString((QiString *)apcStack_170);
}
uVar4 = QiTimer::getTime(aQStack_180);
this[0x28] = (Script)0x1;
*(undefined4 *)(this + 0x48) = uVar4;
QiTimer::reset((QiTimer *)(this + 0x30));
*(undefined4 *)(this + 0x44) = 0;
*(undefined4 *)(this + 0x40) = 0;
goto LAB_00185e24;
}
pcVar3 = "Error compiling script: ";
}
this_00 = gGame;
operator+(pcVar3,param_1);
if (apcStack_170[0] == (char *)0x0) {
apcStack_170[0] = acStack_160;
}
Game::logE(this_00,apcStack_170[0]);
QiString::~QiString((QiString *)apcStack_170);
LAB_00185e24:
local_150[0] = &PTR__QiMemoryStream_00427560;
local_140[0] = &PTR__QiMemoryStream_00427598;
if (local_130 != auStack_128) {
QiFree(local_130);
}
QiOutputStream::~QiOutputStream((QiOutputStream *)local_140);
QiInputStream::~QiInputStream((QiInputStream *)local_150);
if (local_8 == ___stack_chk_guard) {
return;
}
/* WARNING: Subroutine does not return */
__stack_chk_fail(cVar1);
}