Skip to content

Commit

Permalink
- remove lots of unneeded SAVE_CODE and SAVE_DATA declarations.
Browse files Browse the repository at this point in the history
Everything ported to VMFunctions can now be saved natively and the DECISIONs never get stored in serialized pointers.
  • Loading branch information
coelckers committed May 28, 2023
1 parent ddfb485 commit 4bf0029
Show file tree
Hide file tree
Showing 31 changed files with 25 additions and 761 deletions.
20 changes: 0 additions & 20 deletions source/games/sw/src/actor.cpp
Expand Up @@ -952,26 +952,6 @@ int DoFall(DSWActor* actor)
//
//---------------------------------------------------------------------------

#include "saveable.h"

static saveable_code saveable_actor_code[] =
{
SAVE_CODE(DoActorDebris),
SAVE_CODE(DoFireFly),
SAVE_CODE(DoGenerateSewerDebris),
SAVE_CODE(DoActorDeathMove),
};

saveable_module saveable_actor =
{
// code
saveable_actor_code,
SIZ(saveable_actor_code),

// data
nullptr,0
};

// helpers

void DSWActor::ChangeStateEnd()
Expand Down
46 changes: 0 additions & 46 deletions source/games/sw/src/ai.cpp
Expand Up @@ -1634,51 +1634,5 @@ int DoActorPause(DSWActor* actor)
return 0;
}

//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------

#include "saveable.h"

static saveable_code saveable_ai_code[] =
{
SAVE_CODE(InitActorDecide),
SAVE_CODE(DoActorDecide),
SAVE_CODE(InitActorMoveCloser),
SAVE_CODE(DoActorMoveCloser),
SAVE_CODE(FindTrackToPlayer),
SAVE_CODE(FindTrackAwayFromPlayer),
SAVE_CODE(FindWanderTrack),
SAVE_CODE(InitActorRunAway),
SAVE_CODE(InitActorRunToward),
SAVE_CODE(InitActorAttack),
SAVE_CODE(DoActorAttack),
SAVE_CODE(InitActorEvade),
SAVE_CODE(InitActorWanderAround),
SAVE_CODE(InitActorFindPlayer),
SAVE_CODE(InitActorDuck),
SAVE_CODE(DoActorDuck),
SAVE_CODE(DoActorMoveJump),
SAVE_CODE(InitActorReposition),
SAVE_CODE(DoActorReposition),
SAVE_CODE(DoActorPause)
};

static saveable_data saveable_ai_data[] =
{
SAVE_DATA(GenericFlaming)
};

saveable_module saveable_ai =
{
// code
saveable_ai_code,
SIZ(saveable_ai_code),

// data
saveable_ai_data,
SIZ(saveable_ai_data)
};
END_SW_NS
30 changes: 2 additions & 28 deletions source/games/sw/src/bunny.cpp
Expand Up @@ -1469,34 +1469,8 @@ int DoBunnyGrowUp(DSWActor* actor)

#include "saveable.h"

static saveable_code saveable_bunny_code[] =
{
SAVE_CODE(DoBunnyBeginJumpAttack),
SAVE_CODE(DoBunnyMoveJump),
SAVE_CODE(DoPickCloseBunny),
SAVE_CODE(DoBunnyQuickJump),
SAVE_CODE(NullBunny),
SAVE_CODE(DoBunnyPain),
SAVE_CODE(DoBunnyRipHeart),
SAVE_CODE(DoBunnyStandKill),
SAVE_CODE(DoBunnyMove),
SAVE_CODE(BunnySpew),
SAVE_CODE(DoBunnyEat),
SAVE_CODE(DoBunnyScrew),
SAVE_CODE(DoBunnyGrowUp),
};

static saveable_data saveable_bunny_data[] =
{
SAVE_DATA(BunnyBattle),
SAVE_DATA(BunnyOffense),
SAVE_DATA(BunnyBroadcast),
SAVE_DATA(BunnySurprised),
SAVE_DATA(BunnyEvasive),
SAVE_DATA(BunnyLostTarget),
SAVE_DATA(BunnyCloseRange),
SAVE_DATA(BunnyWander),

SAVE_DATA(WhiteBunnyPersonality),
SAVE_DATA(BunnyPersonality),

Expand Down Expand Up @@ -1537,8 +1511,8 @@ static saveable_data saveable_bunny_data[] =
saveable_module saveable_bunny =
{
// code
saveable_bunny_code,
SIZ(saveable_bunny_code),
nullptr,
0,

// data
saveable_bunny_data,
Expand Down
23 changes: 1 addition & 22 deletions source/games/sw/src/coolg.cpp
Expand Up @@ -923,28 +923,8 @@ int DoCoolgPain(DSWActor* actor)

#include "saveable.h"

static saveable_code saveable_coolg_code[] =
{
SAVE_CODE(DoCoolgBirth),
SAVE_CODE(NullCoolg),
SAVE_CODE(InitCoolgCircle),
SAVE_CODE(DoCoolgCircle),
SAVE_CODE(DoCoolgDeath),
SAVE_CODE(DoCoolgMove),
SAVE_CODE(DoCoolgPain),
};

static saveable_data saveable_coolg_data[] =
{
SAVE_DATA(CoolgBattle),
SAVE_DATA(CoolgOffense),
SAVE_DATA(CoolgBroadcast),
SAVE_DATA(CoolgSurprised),
SAVE_DATA(CoolgEvasive),
SAVE_DATA(CoolgLostTarget),
SAVE_DATA(CoolgCloseRange),
SAVE_DATA(CoolgTouchTarget),

SAVE_DATA(CoolgPersonality),

SAVE_DATA(CoolgAttrib),
Expand Down Expand Up @@ -972,8 +952,7 @@ static saveable_data saveable_coolg_data[] =
saveable_module saveable_coolg =
{
// code
saveable_coolg_code,
SIZ(saveable_coolg_code),
nullptr, 0,

// data
saveable_coolg_data,
Expand Down
21 changes: 1 addition & 20 deletions source/games/sw/src/coolie.cpp
Expand Up @@ -633,26 +633,8 @@ int DoCoolieWaitBirth(DSWActor* actor)

#include "saveable.h"

static saveable_code saveable_coolie_code[] =
{
SAVE_CODE(SpawnCoolg),
SAVE_CODE(CooliePain),
SAVE_CODE(NullCoolie),
SAVE_CODE(DoCoolieMove),
SAVE_CODE(InitCoolieCharge),
SAVE_CODE(DoCoolieWaitBirth),
};

static saveable_data saveable_coolie_data[] =
{
SAVE_DATA(CoolieBattle),
SAVE_DATA(CoolieOffense),
SAVE_DATA(CoolieBroadcast),
SAVE_DATA(CoolieSurprised),
SAVE_DATA(CoolieEvasive),
SAVE_DATA(CoolieLostTarget),
SAVE_DATA(CoolieCloseRange),

SAVE_DATA(CooliePersonality),

SAVE_DATA(CoolieAttrib),
Expand All @@ -676,8 +658,7 @@ static saveable_data saveable_coolie_data[] =
saveable_module saveable_coolie =
{
// code
saveable_coolie_code,
SIZ(saveable_coolie_code),
nullptr, 0,

// data
saveable_coolie_data,
Expand Down
19 changes: 1 addition & 18 deletions source/games/sw/src/eel.cpp
Expand Up @@ -600,24 +600,8 @@ int DoEelMove(DSWActor* actor)

#include "saveable.h"

static saveable_code saveable_eel_code[] =
{
SAVE_CODE(DoEelMatchPlayerZ),
SAVE_CODE(DoEelDeath),
SAVE_CODE(DoEelMove)
};

static saveable_data saveable_eel_data[] =
{
SAVE_DATA(EelBattle),
SAVE_DATA(EelOffense),
SAVE_DATA(EelBroadcast),
SAVE_DATA(EelSurprised),
SAVE_DATA(EelEvasive),
SAVE_DATA(EelLostTarget),
SAVE_DATA(EelCloseRange),
SAVE_DATA(EelTouchTarget),

SAVE_DATA(EelPersonality),

SAVE_DATA(EelAttrib),
Expand All @@ -639,8 +623,7 @@ static saveable_data saveable_eel_data[] =
saveable_module saveable_eel =
{
// code
saveable_eel_code,
SIZ(saveable_eel_code),
nullptr, 0,

// data
saveable_eel_data,
Expand Down
2 changes: 2 additions & 0 deletions source/games/sw/src/game.h
Expand Up @@ -2467,6 +2467,8 @@ DEF_ANIMATOR(DoLaserStart)
DEF_ANIMATOR(DoTracerStart)
DEF_ANIMATOR(DoRailStart)

DEF_ANIMATOR(DoGenerateSewerDebris)

END_SW_NS

#endif
Expand Down
21 changes: 1 addition & 20 deletions source/games/sw/src/girlninj.cpp
Expand Up @@ -854,25 +854,8 @@ int DoGirlNinjaSpecial(DSWActor* actor)

#include "saveable.h"

static saveable_code saveable_girlninj_code[] =
{
SAVE_CODE(DoGirlNinjaMove),
SAVE_CODE(GirlNinjaJumpActionFunc),
SAVE_CODE(NullGirlNinja),
SAVE_CODE(DoGirlNinjaPain),
SAVE_CODE(DoGirlNinjaSpecial),
};

static saveable_data saveable_girlninj_data[] =
{
SAVE_DATA(GirlNinjaBattle),
SAVE_DATA(GirlNinjaOffense),
SAVE_DATA(GirlNinjaBroadcast),
SAVE_DATA(GirlNinjaSurprised),
SAVE_DATA(GirlNinjaEvasive),
SAVE_DATA(GirlNinjaLostTarget),
SAVE_DATA(GirlNinjaCloseRange),

SAVE_DATA(GirlNinjaPersonality),

SAVE_DATA(GirlNinjaAttrib),
Expand Down Expand Up @@ -912,9 +895,7 @@ static saveable_data saveable_girlninj_data[] =
saveable_module saveable_girlninj =
{
// code
saveable_girlninj_code,
SIZ(saveable_girlninj_code),

nullptr, 0,
// data
saveable_girlninj_data,
SIZ(saveable_girlninj_data)
Expand Down
18 changes: 1 addition & 17 deletions source/games/sw/src/goro.cpp
Expand Up @@ -567,23 +567,8 @@ int DoGoroMove(DSWActor* actor)

#include "saveable.h"

static saveable_code saveable_goro_code[] =
{
SAVE_CODE(NullGoro),
SAVE_CODE(DoGoroPain),
SAVE_CODE(DoGoroMove),
};

static saveable_data saveable_goro_data[] =
{
SAVE_DATA(GoroBattle),
SAVE_DATA(GoroOffense),
SAVE_DATA(GoroBroadcast),
SAVE_DATA(GoroSurprised),
SAVE_DATA(GoroEvasive),
SAVE_DATA(GoroLostTarget),
SAVE_DATA(GoroCloseRange),

SAVE_DATA(GoroPersonality),

SAVE_DATA(GoroAttrib),
Expand All @@ -609,8 +594,7 @@ static saveable_data saveable_goro_data[] =
saveable_module saveable_goro =
{
// code
saveable_goro_code,
SIZ(saveable_goro_code),
nullptr, 0,

// data
saveable_goro_data,
Expand Down
22 changes: 1 addition & 21 deletions source/games/sw/src/hornet.cpp
Expand Up @@ -619,27 +619,8 @@ int DoHornetMove(DSWActor* actor)

#include "saveable.h"

static saveable_code saveable_hornet_code[] =
{
SAVE_CODE(NullHornet),
SAVE_CODE(DoHornetMatchPlayerZ),
SAVE_CODE(InitHornetCircle),
SAVE_CODE(DoHornetCircle),
SAVE_CODE(DoHornetDeath),
SAVE_CODE(DoCheckSwarm),
SAVE_CODE(DoHornetMove),
};

static saveable_data saveable_hornet_data[] =
{
SAVE_DATA(HornetBattle),
SAVE_DATA(HornetOffense),
SAVE_DATA(HornetBroadcast),
SAVE_DATA(HornetSurprised),
SAVE_DATA(HornetEvasive),
SAVE_DATA(HornetLostTarget),
SAVE_DATA(HornetCloseRange),
SAVE_DATA(HornetTouchTarget),

SAVE_DATA(HornetPersonality),

Expand All @@ -660,8 +641,7 @@ static saveable_data saveable_hornet_data[] =
saveable_module saveable_hornet =
{
// code
saveable_hornet_code,
SIZ(saveable_hornet_code),
nullptr, 0,

// data
saveable_hornet_data,
Expand Down
17 changes: 1 addition & 16 deletions source/games/sw/src/lava.cpp
Expand Up @@ -524,22 +524,8 @@ int DoLavaMove(DSWActor* actor)

#include "saveable.h"

static saveable_code saveable_lava_code[] =
{
SAVE_CODE(NullLava),
SAVE_CODE(DoLavaMove),
};

static saveable_data saveable_lava_data[] =
{
SAVE_DATA(LavaBattle),
SAVE_DATA(LavaOffense),
SAVE_DATA(LavaBroadcast),
SAVE_DATA(LavaSurprised),
SAVE_DATA(LavaEvasive),
SAVE_DATA(LavaLostTarget),
SAVE_DATA(LavaCloseRange),

SAVE_DATA(LavaPersonality),

SAVE_DATA(LavaAttrib),
Expand All @@ -564,8 +550,7 @@ static saveable_data saveable_lava_data[] =
saveable_module saveable_lava =
{
// code
saveable_lava_code,
SIZ(saveable_lava_code),
nullptr, 0,

// data
saveable_lava_data,
Expand Down

0 comments on commit 4bf0029

Please sign in to comment.