Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
Expand Down
6 changes: 3 additions & 3 deletions src/SB/Core/x/xBehaveGoalSimple.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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;
}
Expand Down Expand Up @@ -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)
{
Expand Down
6 changes: 3 additions & 3 deletions src/SB/Core/x/xBehaveGoalSimple.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
81 changes: 1 addition & 80 deletions src/SB/Core/x/xBehaviour.cpp
Original file line number Diff line number Diff line change
@@ -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<xGoal>::Next()
{
return this->next;
}

WEAK void xListItem<xGoal>::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<xGoal>::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<xGoal>::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();
}
Expand Down
81 changes: 77 additions & 4 deletions src/SB/Core/x/xBehaviour.h
Original file line number Diff line number Diff line change
Expand Up @@ -194,10 +194,22 @@ struct xGoal : xListItem<xGoal>, 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
Expand Down Expand Up @@ -237,4 +249,65 @@ struct xGoal : xListItem<xGoal>, 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<xGoal>::Next()
{
return this->next;
}

void xListItem<xGoal>::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<xGoal>::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<xGoal>::Head()
{
xGoal* node = (xGoal*)this;

if (!node)
{
return node;
}

while (node->prev)
{
node = node->prev;
}

return node;
}
*/

#endif