diff --git a/configure.py b/configure.py index 3f345ce07..2263e2fe7 100644 --- a/configure.py +++ b/configure.py @@ -560,8 +560,8 @@ def MatchingFor(*versions): Object(NonMatching, "SB/Game/zNPCTypeAmbient.cpp"), Object(NonMatching, "SB/Game/zNPCTypeTiki.cpp"), Object(NonMatching, "SB/Core/x/xBehaveMgr.cpp"), - Object(NonMatching, "SB/Core/x/xBehaviour.cpp"), # breaks build (weak functions) - Object(NonMatching, "SB/Core/x/xBehaveGoalSimple.cpp"), # breaks build (weak functions) + Object(Matching, "SB/Core/x/xBehaviour.cpp", extra_cflags=["-sym on"]), + Object(Matching, "SB/Core/x/xBehaveGoalSimple.cpp", extra_cflags=["-sym on"]), Object(NonMatching, "SB/Core/x/xSkyDome.cpp"), Object(Matching, "SB/Core/x/xRMemData.cpp", extra_cflags=["-sym on"]), Object(Matching, "SB/Core/x/xFactory.cpp"), diff --git a/src/SB/Core/x/xBehaveGoalSimple.cpp b/src/SB/Core/x/xBehaveGoalSimple.cpp index 972c52896..b41bbc006 100644 --- a/src/SB/Core/x/xBehaveGoalSimple.cpp +++ b/src/SB/Core/x/xBehaveGoalSimple.cpp @@ -6,7 +6,7 @@ void xGoalSimple_RegisterTypes(xFactory* fac) fac->RegItemType('GSM\x01', GOALCreate_Generic, GOALDestroy_Generic); } -xFactoryInst* GOALCreate_Generic(S32 who, RyzMemGrow* growCtxt, void*) +static xFactoryInst* GOALCreate_Generic(S32 who, RyzMemGrow* growCtxt, void*) { xGoal* goal = NULL; @@ -27,7 +27,7 @@ xFactoryInst* GOALCreate_Generic(S32 who, RyzMemGrow* growCtxt, void*) return goal; } -void GOALDestroy_Generic(xFactoryInst* item) +static void GOALDestroy_Generic(xFactoryInst* item) { delete item; } @@ -73,7 +73,7 @@ S32 xGoalGeneric::Resume(F32 dt, void* updCtxt) } S32 xGoalGeneric::SysEvent(xBase* from, xBase* to, U32 toEvent, const F32* toParam, - xBase* toParamWidget, S32* handled) + xBase* toParamWidget, S32* handled) { if (this->fun_sysevent) { diff --git a/src/SB/Core/x/xBehaveGoalSimple.h b/src/SB/Core/x/xBehaveGoalSimple.h index 350a6e29d..860e26345 100644 --- a/src/SB/Core/x/xBehaveGoalSimple.h +++ b/src/SB/Core/x/xBehaveGoalSimple.h @@ -48,11 +48,11 @@ struct xGoalGeneric : xGoal virtual S32 Suspend(F32 dt, void* updCtxt); virtual S32 Resume(F32 dt, void* updCtxt); virtual S32 SysEvent(xBase* from, xBase* to, U32 toEvent, const F32* toParam, - xBase* toParamWidget, S32* handled); + xBase* toParamWidget, S32* handled); }; void xGoalSimple_RegisterTypes(xFactory* fac); -xFactoryInst* GOALCreate_Generic(S32 who, RyzMemGrow* growCtxt, void* dat); -void GOALDestroy_Generic(xFactoryInst* item); +static xFactoryInst* GOALCreate_Generic(S32 who, RyzMemGrow* growCtxt, void* dat); +static void GOALDestroy_Generic(xFactoryInst* item); #endif diff --git a/src/SB/Core/x/xBehaviour.cpp b/src/SB/Core/x/xBehaviour.cpp index a6e4e7e30..1754c7d22 100644 --- a/src/SB/Core/x/xBehaviour.cpp +++ b/src/SB/Core/x/xBehaviour.cpp @@ -1,85 +1,6 @@ #include "xBehaviour.h" -WEAK void xGoal::SetPsyche(xPsyche* psyche) -{ - this->psyche = psyche; -} - -WEAK const char* xGoal::Name() -{ - return NULL; -} - -WEAK void xGoal::SetState(en_GOALSTATE state) -{ - this->stat = state; -} - -WEAK en_GOALSTATE xGoal::GetState() const -{ - return this->stat; -} - -WEAK xGoal* xListItem::Next() -{ - return this->next; -} - -WEAK void xListItem::Insert(xGoal* list) -{ - xGoal* node = (xGoal*)this; - - node->prev = list; - node->next = list->next; - - if (list->next) - { - list->next->prev = node; - } - - list->next = node; -} - -WEAK xGoal* xListItem::RemHead(xGoal** listhead) -{ - if (*listhead == NULL) - { - return NULL; - } - - xGoal* oldhead = (*listhead)->Head(); - - if (!oldhead) - { - *listhead = NULL; - } - else - { - *listhead = oldhead->Next(); - oldhead->Remove(); - } - - return oldhead; -} - -WEAK xGoal* xListItem::Head() -{ - xGoal* node = (xGoal*)this; - - if (!node) - { - return node; - } - - while (node->prev) - { - node = node->prev; - } - - return node; -} - -WEAK xBase* xGoal::GetOwner() const +xBase* xGoal::GetOwner() const { return this->psyche->GetClient(); } diff --git a/src/SB/Core/x/xBehaviour.h b/src/SB/Core/x/xBehaviour.h index eb0999b25..7895be32a 100644 --- a/src/SB/Core/x/xBehaviour.h +++ b/src/SB/Core/x/xBehaviour.h @@ -194,10 +194,22 @@ struct xGoal : xListItem, xFactoryInst return flg_able; } - void SetPsyche(xPsyche* psyche); - const char* Name(); - void SetState(en_GOALSTATE state); - en_GOALSTATE GetState() const; + void SetPsyche(xPsyche* psyche) + { + this->psyche = psyche; + } + const char* Name() + { + return NULL; + } + void SetState(en_GOALSTATE state) + { + this->stat = state; + } + en_GOALSTATE GetState() const + { + return this->stat; + } xBase* GetOwner() const; // vtable @@ -237,4 +249,65 @@ struct xGoal : xListItem, xFactoryInst ~xGoal(); // prevents implicit destructors from being generated in subclasses of xGoal }; +/* TODO: get these to weakly link into other files without causing redefinitions in xBehaviour +xGoal* xListItem::Next() +{ + return this->next; +} + +void xListItem::Insert(xGoal* list) +{ + xGoal* node = (xGoal*)this; + + node->prev = list; + node->next = list->next; + + if (list->next) + { + list->next->prev = node; + } + + list->next = node; +} + +xGoal* xListItem::RemHead(xGoal** listhead) +{ + if (*listhead == NULL) + { + return NULL; + } + + xGoal* oldhead = (*listhead)->Head(); + + if (!oldhead) + { + *listhead = NULL; + } + else + { + *listhead = oldhead->Next(); + oldhead->Remove(); + } + + return oldhead; +} + +xGoal* xListItem::Head() +{ + xGoal* node = (xGoal*)this; + + if (!node) + { + return node; + } + + while (node->prev) + { + node = node->prev; + } + + return node; +} + */ + #endif