Skip to content

Commit

Permalink
Refactor|Server: Use ThinkerT in the server delta pool
Browse files Browse the repository at this point in the history
The delta pool will not have to worry about the private data pointers,
as the pool itself needs to be reimplemented to cooperate with DMU.
Therefore the pool can continue taking a straight up copies of mobjs.
  • Loading branch information
skyjake committed Jul 25, 2014
1 parent 2cb4722 commit 15a754d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions doomsday/server/include/server/sv_pool.h
Expand Up @@ -99,6 +99,8 @@ typedef mobj_t dt_mobj_t;
typedef struct mobjdelta_s {
delta_t delta; // The header.
dt_mobj_t mo; // The data of the delta.

mobjdelta_s() : mo(thinker_s::InitializeToZero) {}
} mobjdelta_t;

typedef struct {
Expand Down
4 changes: 2 additions & 2 deletions doomsday/server/src/server/sv_pool.cpp
Expand Up @@ -101,7 +101,7 @@ static float deltaBaseScores[NUM_DELTA_TYPES];

// Keep this zeroed out. Used if the register doesn't have data for
// the mobj being compared.
static dt_mobj_t dummyZeroMobj;
static ThinkerT<dt_mobj_t> dummyZeroMobj;

/**
* Called once for each map, from R_SetupMap(). Initialize the world
Expand Down Expand Up @@ -504,7 +504,7 @@ dd_bool Sv_RegisterCompareMobj(cregister_t *reg, mobj_t const *s, mobjdelta_t *d
{
int df;
reg_mobj_t *regMo = 0;
dt_mobj_t const *r = &dummyZeroMobj;
dt_mobj_t const *r = dummyZeroMobj;

if((regMo = Sv_RegisterFindMobj(reg, s->thinker.id)) != NULL)
{
Expand Down

0 comments on commit 15a754d

Please sign in to comment.