TINSEL: Remove superfluous (and a bit confusing) pointer typedefs

This helps align tinsel with our code and type formatting  guidelines
This commit is contained in:
Filippos Karapetis 2022-01-16 13:15:18 +02:00
parent b108f6c335
commit e90b45b226
28 changed files with 210 additions and 237 deletions

View file

@ -28,7 +28,7 @@
#include "tinsel/dialogs.h" // INV_NOICON #include "tinsel/dialogs.h" // INV_NOICON
#include "tinsel/move.h" #include "tinsel/move.h"
#include "tinsel/multiobj.h" #include "tinsel/multiobj.h"
#include "tinsel/object.h" // for POBJECT #include "tinsel/object.h" // for OBJECT *
#include "tinsel/pcode.h" #include "tinsel/pcode.h"
#include "tinsel/pid.h" #include "tinsel/pid.h"
#include "tinsel/play.h" #include "tinsel/play.h"
@ -169,8 +169,7 @@ struct ATP_INIT {
int id; // Actor number int id; // Actor number
TINSEL_EVENT event; // Event TINSEL_EVENT event; // Event
PLR_EVENT bev; // Causal mouse event PLR_EVENT bev; // Causal mouse event
INT_CONTEXT *pic;
PINT_CONTEXT pic;
}; };
/** /**
@ -315,7 +314,7 @@ void Actor::DropActors() {
* @param ano Actor Id * @param ano Actor Id
*/ */
void Actor::DisableActor(int ano) { void Actor::DisableActor(int ano) {
PMOVER pActor; MOVER *pActor;
assert(ano > 0 && ano <= _numActors); // illegal actor number assert(ano > 0 && ano <= _numActors); // illegal actor number
@ -431,7 +430,7 @@ void Actor::FirstTaggedActor() {
* or there are no more tagged actors to look at. * or there are no more tagged actors to look at.
*/ */
int Actor::NextTaggedActor() { int Actor::NextTaggedActor() {
PMOVER pActor; MOVER *pActor;
bool hid; bool hid;
while (ti < _numActors) { while (ti < _numActors) {
@ -458,7 +457,7 @@ int Actor::NextTaggedActor() {
* there are no more tagged actors to look at. * there are no more tagged actors to look at.
*/ */
int Actor::NextTaggedActor(int previous) { int Actor::NextTaggedActor(int previous) {
PMOVER pMover; MOVER *pMover;
// Convert actor number to index // Convert actor number to index
if (!previous) if (!previous)
@ -578,7 +577,7 @@ int Actor::GetLoopCount(int ano) {
} }
void Actor::GetActorPos(int ano, int *x, int *y) { void Actor::GetActorPos(int ano, int *x, int *y) {
PMOVER pActor; MOVER *pActor;
assert((ano > 0 && ano <= _numActors) || ano == LEAD_ACTOR); // unknown actor assert((ano > 0 && ano <= _numActors) || ano == LEAD_ACTOR); // unknown actor
@ -601,7 +600,7 @@ void Actor::GetActorPos(int ano, int *x, int *y) {
*/ */
void Actor::GetActorMidTop(int ano, int *x, int *y) { void Actor::GetActorMidTop(int ano, int *x, int *y) {
// Not used in JAPAN version // Not used in JAPAN version
PMOVER pActor; MOVER *pActor;
assert((ano > 0 && ano <= _numActors) || ano == LEAD_ACTOR); // unknown actor assert((ano > 0 && ano <= _numActors) || ano == LEAD_ACTOR); // unknown actor
@ -652,7 +651,7 @@ int Actor::GetActorLeft(int ano) {
} }
// Tinsel 2 version // Tinsel 2 version
PMOVER pMover = GetMover(ano); MOVER *pMover = GetMover(ano);
int i; int i;
bool bIsObj; bool bIsObj;
int left = 0; int left = 0;
@ -694,7 +693,7 @@ int Actor::GetActorRight(int ano) {
} }
// Tinsel 2 version // Tinsel 2 version
PMOVER pMover = GetMover(ano); MOVER *pMover = GetMover(ano);
int i; int i;
bool bIsObj; bool bIsObj;
int right = 0; int right = 0;
@ -735,7 +734,7 @@ int Actor::GetActorTop(int ano) {
} }
// Tinsel 2 version // Tinsel 2 version
PMOVER pMover = GetMover(ano); MOVER *pMover = GetMover(ano);
int i; int i;
bool bIsObj; bool bIsObj;
int top = 0; int top = 0;
@ -776,7 +775,7 @@ int Actor::GetActorBottom(int ano) {
} }
// Tinsel 2 version // Tinsel 2 version
PMOVER pMover = GetMover(ano); MOVER *pMover = GetMover(ano);
int i; int i;
bool bIsObj; bool bIsObj;
int bottom = 0; int bottom = 0;
@ -816,7 +815,7 @@ bool Actor::ActorHidden(int ano) {
* @param sf sf * @param sf sf
*/ */
bool Actor::HideMovingActor(int ano, int sf) { bool Actor::HideMovingActor(int ano, int sf) {
PMOVER pActor; MOVER *pActor;
assert((ano > 0 && ano <= _numActors) || ano == LEAD_ACTOR); // illegal actor assert((ano > 0 && ano <= _numActors) || ano == LEAD_ACTOR); // illegal actor
@ -838,7 +837,7 @@ bool Actor::HideMovingActor(int ano, int sf) {
* @param ano Actor Id * @param ano Actor Id
*/ */
void Actor::unHideMovingActor(int ano) { void Actor::unHideMovingActor(int ano) {
PMOVER pActor; MOVER *pActor;
assert((ano > 0 && ano <= _numActors) || ano == LEAD_ACTOR); // illegal actor assert((ano > 0 && ano <= _numActors) || ano == LEAD_ACTOR); // illegal actor
@ -856,7 +855,7 @@ void Actor::unHideMovingActor(int ano) {
* actor's walk (if any) from the new co-ordinates. * actor's walk (if any) from the new co-ordinates.
*/ */
void Actor::restoreMovement(int ano) { void Actor::restoreMovement(int ano) {
PMOVER pActor; MOVER *pActor;
assert(ano > 0 && ano <= _numActors); // illegal actor number assert(ano > 0 && ano <= _numActors); // illegal actor number
@ -880,7 +879,7 @@ void Actor::restoreMovement(int ano) {
* 'store_actor_reel_and/or_film_and/or_object()' * 'store_actor_reel_and/or_film_and/or_object()'
*/ */
void Actor::storeActorReel(int ano, const FREEL *reel, SCNHANDLE hFilm, OBJECT *pobj, int reelnum, int x, int y) { void Actor::storeActorReel(int ano, const FREEL *reel, SCNHANDLE hFilm, OBJECT *pobj, int reelnum, int x, int y) {
PMOVER pActor; MOVER *pActor;
assert(ano > 0 && ano <= _numActors); // illegal actor number assert(ano > 0 && ano <= _numActors); // illegal actor number
@ -1074,7 +1073,7 @@ uint32 Actor::GetActorZfactor(int ano) {
/** /**
* Store relevant information pertaining to currently existing actors. * Store relevant information pertaining to currently existing actors.
*/ */
int Actor::SaveActors(PSAVED_ACTOR sActorInfo) { int Actor::SaveActors(SAVED_ACTOR *sActorInfo) {
int i, j, k; int i, j, k;
for (i = 0, j = 0; i < _numActors; i++) { for (i = 0, j = 0; i < _numActors; i++) {
@ -1113,7 +1112,7 @@ int Actor::SaveActors(PSAVED_ACTOR sActorInfo) {
/** /**
* Restore actor data * Restore actor data
*/ */
void Actor::RestoreActors(int numActors, PSAVED_ACTOR sActorInfo) { void Actor::RestoreActors(int numActors, SAVED_ACTOR *sActorInfo) {
int i, aIndex; int i, aIndex;
for (i = 0; i < numActors; i++) { for (i = 0; i < numActors; i++) {
@ -1622,7 +1621,7 @@ void ActorEvent(CORO_PARAM, int ano, TINSEL_EVENT tEvent, bool bWait, int myEsca
* Shows the given actor * Shows the given actor
*/ */
void ShowActor(CORO_PARAM, int ano) { void ShowActor(CORO_PARAM, int ano) {
PMOVER pMover; MOVER *pMover;
assert(ano > 0 && ano <= _vm->_actor->GetCount()); assert(ano > 0 && ano <= _vm->_actor->GetCount());
CORO_BEGIN_CONTEXT; CORO_BEGIN_CONTEXT;
@ -1651,7 +1650,7 @@ void ShowActor(CORO_PARAM, int ano) {
* @param ano Actor Id * @param ano Actor Id
*/ */
void HideActor(CORO_PARAM, int ano) { void HideActor(CORO_PARAM, int ano) {
PMOVER pMover; MOVER *pMover;
assert((ano > 0 && ano <= _vm->_actor->GetCount()) || ano == LEAD_ACTOR); // illegal actor assert((ano > 0 && ano <= _vm->_actor->GetCount()) || ano == LEAD_ACTOR); // illegal actor
CORO_BEGIN_CONTEXT; CORO_BEGIN_CONTEXT;

View file

@ -27,7 +27,7 @@
#include "tinsel/dw.h" // for SCNHANDLE #include "tinsel/dw.h" // for SCNHANDLE
#include "tinsel/events.h" // for TINSEL_EVENT #include "tinsel/events.h" // for TINSEL_EVENT
#include "tinsel/palette.h" // for COLORREF #include "tinsel/palette.h" // for COLORREF
#include "tinsel/movers.h" // for PMOVER #include "tinsel/movers.h" // for MOVER *
namespace Common { namespace Common {
class Serializer; class Serializer;
@ -78,8 +78,6 @@ struct Z_POSITIONS {
int z; int z;
}; };
typedef SAVED_ACTOR *PSAVED_ACTOR;
struct ACTORDATA { struct ACTORDATA {
int32 masking; ///< type of actor masking (Tinsel V1) int32 masking; ///< type of actor masking (Tinsel V1)
SCNHANDLE hActorId; ///< handle actor ID string index SCNHANDLE hActorId; ///< handle actor ID string index
@ -187,8 +185,8 @@ public:
void NotPlayingReel(int actor, int filmNumber, int column); void NotPlayingReel(int actor, int filmNumber, int column);
bool ActorReelPlaying(int actor, int column); bool ActorReelPlaying(int actor, int column);
int SaveActors(PSAVED_ACTOR sActorInfo); int SaveActors(SAVED_ACTOR *sActorInfo);
void RestoreActors(int numActors, PSAVED_ACTOR sActorInfo); void RestoreActors(int numActors, SAVED_ACTOR *sActorInfo);
void SaveZpositions(void *zpp); void SaveZpositions(void *zpp);
void RestoreZpositions(void *zpp); void RestoreZpositions(void *zpp);

View file

@ -405,7 +405,7 @@ void SkipFrames(ANIM *pAnim, int numFrames) {
* About to jump or end * About to jump or end
* @param pAnim Animation data structure * @param pAnim Animation data structure
*/ */
bool AboutToJumpOrEnd(PANIM pAnim) { bool AboutToJumpOrEnd(ANIM *pAnim) {
if (pAnim->aniDelta == 1) { if (pAnim->aniDelta == 1) {
// get a pointer to the script // get a pointer to the script
ANI_SCRIPT *pAni = (ANI_SCRIPT *)_vm->_handle->LockMem(pAnim->hScript); ANI_SCRIPT *pAni = (ANI_SCRIPT *)_vm->_handle->LockMem(pAnim->hScript);

View file

@ -37,9 +37,6 @@ struct ANIM {
uint32 hScript; ///< animation script handle uint32 hScript; ///< animation script handle
int scriptIndex; ///< current position in animation script int scriptIndex; ///< current position in animation script
}; };
typedef ANIM *PANIM;
typedef void (*PANI_ADDR)(struct ANIM *);
/** Animation script commands */ /** Animation script commands */
enum { enum {
@ -61,7 +58,6 @@ enum {
union ANI_SCRIPT { union ANI_SCRIPT {
int32 op; ///< treat as an opcode or operand int32 op; ///< treat as an opcode or operand
uint32 hFrame; ///< treat as a animation frame handle uint32 hFrame; ///< treat as a animation frame handle
// PANI_ADDR pFunc; ///< treat as a animation function call
}; };
@ -88,7 +84,7 @@ void SkipFrames( // Skip the specified number of frames
ANIM *pAnim, // animation data structure ANIM *pAnim, // animation data structure
int numFrames); // number of frames to skip int numFrames); // number of frames to skip
bool AboutToJumpOrEnd(PANIM pAnim); bool AboutToJumpOrEnd(ANIM *pAnim);
} // End of namespace Tinsel } // End of namespace Tinsel

View file

@ -29,7 +29,7 @@
#include "common/rect.h" #include "common/rect.h"
#include "tinsel/anim.h" // for ANIM #include "tinsel/anim.h" // for ANIM
#include "tinsel/dw.h" // for SCNHANDLE #include "tinsel/dw.h" // for SCNHANDLE
#include "tinsel/object.h" // for POBJECT #include "tinsel/object.h" // for OBJECT *
#include "tinsel/palette.h" // palette definitions #include "tinsel/palette.h" // palette definitions
namespace Tinsel { namespace Tinsel {
@ -159,7 +159,7 @@ private:
public: public:
int _bgReels; int _bgReels;
POBJECT _pBG[MAX_BG]; OBJECT *_pBG[MAX_BG];
ANIM _thisAnim[MAX_BG]; // used by BGmainProcess() ANIM _thisAnim[MAX_BG]; // used by BGmainProcess()
}; };

View file

@ -79,7 +79,7 @@ void BGmainProcess(CORO_PARAM, const void *param) {
int i; int i;
for (i = 0; i < _vm->_bg->_bgReels; i++) { for (i = 0; i < _vm->_bg->_bgReels; i++) {
// Get the MULTI_INIT structure // Get the MULTI_INIT structure
pmi = (PMULTI_INIT)_vm->_handle->LockMem(FROM_32(pFilm->reels[i].mobj)); pmi = (MULTI_INIT *)_vm->_handle->LockMem(FROM_32(pFilm->reels[i].mobj));
// Initialize and insert the object, and initialize its script. // Initialize and insert the object, and initialize its script.
_vm->_bg->_pBG[i] = MultiInitObject(pmi); _vm->_bg->_pBG[i] = MultiInitObject(pmi);

View file

@ -98,7 +98,7 @@ class BMVPlayer {
int blobsInBuffer; int blobsInBuffer;
struct { struct {
POBJECT pText; OBJECT *pText;
int dieFrame; int dieFrame;
} texts[2]; } texts[2];

View file

@ -2279,7 +2279,7 @@ void Dialogs::AddBackground(OBJECT **rect, int extraH, int extraV) {
/** /**
* Adds a title for a dialog * Adds a title for a dialog
*/ */
void Dialogs::AddTitle(POBJECT *title, int extraH) { void Dialogs::AddTitle(OBJECT **title, int extraH) {
int width = _TLwidth + extraH + _TRwidth + NM_BG_SIZ_X; int width = _TLwidth + extraH + _TRwidth + NM_BG_SIZ_X;
// Create text object using title string // Create text object using title string
@ -3124,7 +3124,7 @@ void Dialogs::InvCursor(InvCursorFN fn, int CurX, int CurY) {
void Dialogs::ConvAction(int index) { void Dialogs::ConvAction(int index) {
assert(_activeInv == INV_CONV); // not conv. window! assert(_activeInv == INV_CONV); // not conv. window!
PMOVER pMover = TinselV2 ? GetMover(_vm->_actor->GetLeadId()) : NULL; MOVER *pMover = TinselV2 ? GetMover(_vm->_actor->GetLeadId()) : NULL;
switch (index) { switch (index) {
case INV_NOICON: case INV_NOICON:

View file

@ -384,7 +384,7 @@ private:
OBJECT *AddInvObject(int num, const FREEL **pfreel, const FILM **pfilm); OBJECT *AddInvObject(int num, const FREEL **pfreel, const FILM **pfilm);
void AddBackground(OBJECT **rect, OBJECT **title, int extraH, int extraV, int textFrom); void AddBackground(OBJECT **rect, OBJECT **title, int extraH, int extraV, int textFrom);
void AddBackground(OBJECT **rect, int extraH, int extraV); void AddBackground(OBJECT **rect, int extraH, int extraV);
void AddTitle(POBJECT *title, int extraH); void AddTitle(OBJECT **title, int extraH);
void AddSlider(OBJECT **slide, const FILM *pfilm); void AddSlider(OBJECT **slide, const FILM *pfilm);
void AddBox(int *pi, const int i); void AddBox(int *pi, const int i);
void AddEWSlider(OBJECT **slide, const FILM *pfilm); void AddEWSlider(OBJECT **slide, const FILM *pfilm);

View file

@ -44,7 +44,7 @@ namespace Tinsel {
struct EP_INIT { struct EP_INIT {
HPOLYGON hEpoly; HPOLYGON hEpoly;
PMOVER pMover; MOVER *pMover;
int index; int index;
}; };
@ -93,7 +93,7 @@ static void EffectProcess(CORO_PARAM, const void *param) {
* it has just entered one. If it has, a process is started up to run * it has just entered one. If it has, a process is started up to run
* the polygon's Glitter code. * the polygon's Glitter code.
*/ */
static void FettleEffectPolys(int x, int y, int index, PMOVER pActor) { static void FettleEffectPolys(int x, int y, int index, MOVER *pActor) {
HPOLYGON hPoly; HPOLYGON hPoly;
EP_INIT epi; EP_INIT epi;
@ -123,7 +123,7 @@ void EffectPolyProcess(CORO_PARAM, const void *param) {
CORO_BEGIN_CODE(_ctx); CORO_BEGIN_CODE(_ctx);
while (1) { while (1) {
for (int i = 0; i < MAX_MOVERS; i++) { for (int i = 0; i < MAX_MOVERS; i++) {
PMOVER pActor = GetLiveMover(i); MOVER *pActor = GetLiveMover(i);
if (pActor != NULL) { if (pActor != NULL) {
int x, y; int x, y;
GetMoverPosition(pActor, &x, &y); GetMoverPosition(pActor, &x, &y);

View file

@ -256,7 +256,7 @@ struct WP_INIT {
static void WalkProcess(CORO_PARAM, const void *param) { static void WalkProcess(CORO_PARAM, const void *param) {
// COROUTINE // COROUTINE
CORO_BEGIN_CONTEXT; CORO_BEGIN_CONTEXT;
PMOVER pMover; MOVER *pMover;
int thisWalk; int thisWalk;
CORO_END_CONTEXT(_ctx); CORO_END_CONTEXT(_ctx);
@ -539,11 +539,9 @@ struct PTP_INIT {
HPOLYGON hPoly; // Polygon HPOLYGON hPoly; // Polygon
TINSEL_EVENT event; // Trigerring event TINSEL_EVENT event; // Trigerring event
PLR_EVENT bev; // To allow for double clicks PLR_EVENT bev; // To allow for double clicks
bool take_control; // Set if control should be taken bool take_control; // Set if control should be taken while code is running.
// while code is running.
int actor; int actor;
INT_CONTEXT *pic;
PINT_CONTEXT pic;
}; };
/** /**

View file

@ -53,7 +53,7 @@ static int g_scrEntries = 0;
* Sets an actor's walk reels * Sets an actor's walk reels
*/ */
void SetWalkReels(PMOVER pMover, int scale, void SetWalkReels(MOVER *pMover, int scale,
SCNHANDLE al, SCNHANDLE ar, SCNHANDLE af, SCNHANDLE aa) { SCNHANDLE al, SCNHANDLE ar, SCNHANDLE af, SCNHANDLE aa) {
assert(scale > 0 && scale <= TOTAL_SCALES); assert(scale > 0 && scale <= TOTAL_SCALES);
@ -68,7 +68,7 @@ void SetWalkReels(PMOVER pMover, int scale,
* Sets an actor's stand reels * Sets an actor's stand reels
*/ */
void SetStandReels(PMOVER pMover, int scale, void SetStandReels(MOVER *pMover, int scale,
SCNHANDLE al, SCNHANDLE ar, SCNHANDLE af, SCNHANDLE aa) { SCNHANDLE al, SCNHANDLE ar, SCNHANDLE af, SCNHANDLE aa) {
assert(scale > 0 && scale <= TOTAL_SCALES); assert(scale > 0 && scale <= TOTAL_SCALES);
@ -83,7 +83,7 @@ void SetStandReels(PMOVER pMover, int scale,
* Sets an actor's talk reels * Sets an actor's talk reels
*/ */
void SetTalkReels(PMOVER pMover, int scale, void SetTalkReels(MOVER *pMover, int scale,
SCNHANDLE al, SCNHANDLE ar, SCNHANDLE af, SCNHANDLE aa) { SCNHANDLE al, SCNHANDLE ar, SCNHANDLE af, SCNHANDLE aa) {
assert(scale > 0 && scale <= TOTAL_SCALES); assert(scale > 0 && scale <= TOTAL_SCALES);
@ -96,7 +96,7 @@ void SetTalkReels(PMOVER pMover, int scale,
/** /**
* Return handle to actor's talk reel at present scale and direction. * Return handle to actor's talk reel at present scale and direction.
*/ */
SCNHANDLE GetMoverTalkReel(PMOVER pActor, TFTYPE dirn) { SCNHANDLE GetMoverTalkReel(MOVER *pActor, TFTYPE dirn) {
assert(1 <= pActor->scale && pActor->scale <= TOTAL_SCALES); assert(1 <= pActor->scale && pActor->scale <= TOTAL_SCALES);
switch (dirn) { switch (dirn) {
case TF_NONE: case TF_NONE:
@ -175,11 +175,9 @@ void RebootScalingReels() {
* Discourage them from being ditched. * Discourage them from being ditched.
*/ */
void TouchMoverReels() { void TouchMoverReels() {
PMOVER pMover; MOVER *pMover = NextMover(NULL);
int scale; int scale;
pMover = NextMover(NULL);
do { do {
for (scale = 0; scale < TOTAL_SCALES; scale++) { for (scale = 0; scale < TOTAL_SCALES; scale++) {
_vm->_handle->TouchMem(pMover->walkReels[scale][LEFTREEL]); _vm->_handle->TouchMem(pMover->walkReels[scale][LEFTREEL]);

View file

@ -27,16 +27,16 @@
namespace Tinsel { namespace Tinsel {
void SetWalkReels(PMOVER pMover, int scale, void SetWalkReels(MOVER *pMover, int scale,
SCNHANDLE al, SCNHANDLE ar, SCNHANDLE af, SCNHANDLE aa); SCNHANDLE al, SCNHANDLE ar, SCNHANDLE af, SCNHANDLE aa);
void SetStandReels(PMOVER pMover, int scale, void SetStandReels(MOVER *pMover, int scale,
SCNHANDLE al, SCNHANDLE ar, SCNHANDLE af, SCNHANDLE aa); SCNHANDLE al, SCNHANDLE ar, SCNHANDLE af, SCNHANDLE aa);
void SetTalkReels(PMOVER pMover, int scale, void SetTalkReels(MOVER *pMover, int scale,
SCNHANDLE al, SCNHANDLE ar, SCNHANDLE af, SCNHANDLE aa); SCNHANDLE al, SCNHANDLE ar, SCNHANDLE af, SCNHANDLE aa);
SCNHANDLE GetMoverTalkReel(PMOVER pActor, TFTYPE dirn); SCNHANDLE GetMoverTalkReel(MOVER *pActor, TFTYPE dirn);
void SetScalingReels(int actor, int scale, int direction, void SetScalingReels(int actor, int scale, int direction,
SCNHANDLE left, SCNHANDLE right, SCNHANDLE forward, SCNHANDLE away); SCNHANDLE left, SCNHANDLE right, SCNHANDLE forward, SCNHANDLE away);

View file

@ -47,7 +47,7 @@ namespace Tinsel {
// in POLYGONS.C // in POLYGONS.C
// Deliberatley defined here, and not in polygons.h // Deliberatley defined here, and not in polygons.h
HPOLYGON InitExtraBlock(PMOVER ca, PMOVER ta); HPOLYGON InitExtraBlock(MOVER *ca, MOVER *ta);
//----------------- LOCAL DEFINES -------------------- //----------------- LOCAL DEFINES --------------------
@ -91,7 +91,7 @@ static int g_hSlowVar = 0; // used by MoveActor()
static void NewCoOrdinates(int fromx, int fromy, int *targetX, int *targetY, static void NewCoOrdinates(int fromx, int fromy, int *targetX, int *targetY,
int *newx, int *newy, int *s1, int *s2, HPOLYGON *hS2p, int *newx, int *newy, int *s1, int *s2, HPOLYGON *hS2p,
bool bOver, bool bBodge, bool bOver, bool bBodge,
PMOVER pActor, PMOVER *collisionActor = 0); MOVER *pActor, MOVER **collisionActor = 0);
#if SLOW_RINCE_DOWN #if SLOW_RINCE_DOWN
@ -485,7 +485,7 @@ DIRECTION GetDirection(int fromx, int fromy, int tox, int toy, DIRECTION lastree
/** /**
* Haven't moved, look towards the cursor. * Haven't moved, look towards the cursor.
*/ */
static void GotThereWithoutMoving(PMOVER pActor) { static void GotThereWithoutMoving(MOVER *pActor) {
int curX, curY; int curX, curY;
DIRECTION reel; DIRECTION reel;
@ -502,7 +502,7 @@ static void GotThereWithoutMoving(PMOVER pActor) {
/** /**
* Arrived at final destination. * Arrived at final destination.
*/ */
static void GotThere(PMOVER pMover) { static void GotThere(MOVER *pMover) {
pMover->targetX = pMover->targetY = -1; // 4/1/95 pMover->targetX = pMover->targetY = -1; // 4/1/95
pMover->ItargetX = pMover->ItargetY = -1; pMover->ItargetX = pMover->ItargetY = -1;
pMover->UtargetX = pMover->UtargetY = -1; pMover->UtargetX = pMover->UtargetY = -1;
@ -546,7 +546,7 @@ enum cgt { GT_NOTL, GT_NOTB, GT_NOT2, GT_OK, GT_MAY };
/** /**
* Can we get straight there? * Can we get straight there?
*/ */
static cgt CanGetThere(PMOVER pActor, int tx, int ty) { static cgt CanGetThere(MOVER *pActor, int tx, int ty) {
int s1, s2; // s2 not used here! int s1, s2; // s2 not used here!
HPOLYGON hS2p; // nor is s2p! HPOLYGON hS2p; // nor is s2p!
int nextx, nexty; int nextx, nexty;
@ -582,7 +582,7 @@ static cgt CanGetThere(PMOVER pActor, int tx, int ty) {
/** /**
* Set final destination. * Set final destination.
*/ */
static void SetMoverUltDest(PMOVER pActor, int x, int y) { static void SetMoverUltDest(MOVER *pActor, int x, int y) {
pActor->UtargetX = x; pActor->UtargetX = x;
pActor->UtargetY = y; pActor->UtargetY = y;
pActor->hUpath = InPolygon(x, y, PATH); pActor->hUpath = InPolygon(x, y, PATH);
@ -600,7 +600,7 @@ static void SetMoverUltDest(PMOVER pActor, int x, int y) {
* Otherwise, head towards the pseudo-center or end node of the first * Otherwise, head towards the pseudo-center or end node of the first
* en-route path. * en-route path.
*/ */
static void SetMoverIntDest(PMOVER pMover, int x, int y) { static void SetMoverIntDest(MOVER *pMover, int x, int y) {
HPOLYGON hIpath, hTpath; HPOLYGON hIpath, hTpath;
int node; int node;
@ -682,7 +682,7 @@ static void SetMoverIntDest(PMOVER pMover, int x, int y) {
/** /**
* Set short-term destination and adopt the appropriate reel. * Set short-term destination and adopt the appropriate reel.
*/ */
static void SetMoverDest(PMOVER pActor, int x, int y) { static void SetMoverDest(MOVER *pActor, int x, int y) {
int scale; int scale;
DIRECTION reel; DIRECTION reel;
@ -701,7 +701,7 @@ static void SetMoverDest(PMOVER pActor, int x, int y) {
/** /**
* SetNextDest * SetNextDest
*/ */
static void SetNextDest(PMOVER pMover) { static void SetNextDest(MOVER *pMover) {
int targetX, targetY; // Ultimate destination int targetX, targetY; // Ultimate destination
int x, y; // Present position int x, y; // Present position
int nextx, nexty; int nextx, nexty;
@ -718,7 +718,7 @@ static void SetNextDest(PMOVER pMover) {
int ss1, ss2; int ss1, ss2;
HPOLYGON shS2p; HPOLYGON shS2p;
PMOVER collisionActor; MOVER *collisionActor;
#if 1 #if 1
int sTargetX, sTargetY; int sTargetX, sTargetY;
#endif #endif
@ -1029,11 +1029,11 @@ static void SetNextDest(PMOVER pMover) {
static void NewCoOrdinates(int fromx, int fromy, int *targetX, int *targetY, static void NewCoOrdinates(int fromx, int fromy, int *targetX, int *targetY,
int *newx, int *newy, int *s1, int *s2, int *newx, int *newy, int *s1, int *s2,
HPOLYGON *hS2p, bool bOver, bool bBodge, HPOLYGON *hS2p, bool bOver, bool bBodge,
PMOVER pMover, PMOVER *collisionActor) { MOVER *pMover, MOVER **collisionActor) {
HPOLYGON hPoly; HPOLYGON hPoly;
int sidem, depthm; int sidem, depthm;
int sidesteps, depthsteps; int sidesteps, depthsteps;
PMOVER ma; MOVER *ma;
*s1 = *s2 = 0; *s1 = *s2 = 0;
@ -1240,7 +1240,7 @@ static void NewCoOrdinates(int fromx, int fromy, int *targetX, int *targetY,
/** /**
* SetOffWithinNodePath * SetOffWithinNodePath
*/ */
static void SetOffWithinNodePath(PMOVER pMover, HPOLYGON StartPath, HPOLYGON DestPath, static void SetOffWithinNodePath(MOVER *pMover, HPOLYGON StartPath, HPOLYGON DestPath,
int targetX, int targetY) { int targetX, int targetY) {
int endnode; int endnode;
HPOLYGON hIpath; HPOLYGON hIpath;
@ -1314,7 +1314,7 @@ static void SetOffWithinNodePath(PMOVER pMover, HPOLYGON StartPath, HPOLYGON Des
/** /**
* Restore a movement, called from restoreMovement() in ACTORS.CPP * Restore a movement, called from restoreMovement() in ACTORS.CPP
*/ */
void SSetActorDest(PMOVER pActor) { void SSetActorDest(MOVER *pActor) {
if (pActor->UtargetX != -1 && pActor->UtargetY != -1) { if (pActor->UtargetX != -1 && pActor->UtargetY != -1) {
Stand(Common::nullContext, pActor->actorID, pActor->objX, pActor->objY, 0); Stand(Common::nullContext, pActor->actorID, pActor->objX, pActor->objY, 0);
@ -1330,7 +1330,7 @@ void SSetActorDest(PMOVER pActor) {
/** /**
* Initiate a movement, called from WalkTo_Event() * Initiate a movement, called from WalkTo_Event()
*/ */
int SetActorDest(PMOVER pMover, int clickX, int clickY, bool igPath, SCNHANDLE hFilm) { int SetActorDest(MOVER *pMover, int clickX, int clickY, bool igPath, SCNHANDLE hFilm) {
HPOLYGON StartPath, DestPath = 0; HPOLYGON StartPath, DestPath = 0;
int targetX, targetY; int targetX, targetY;
@ -1446,7 +1446,7 @@ int SetActorDest(PMOVER pMover, int clickX, int clickY, bool igPath, SCNHANDLE h
/** /**
* Change scale if appropriate. * Change scale if appropriate.
*/ */
static void CheckScale(PMOVER pActor, HPOLYGON hPath, int ypos) { static void CheckScale(MOVER *pActor, HPOLYGON hPath, int ypos) {
int scale; int scale;
scale = GetScale(hPath, ypos); scale = GetScale(hPath, ypos);
@ -1458,7 +1458,7 @@ static void CheckScale(PMOVER pActor, HPOLYGON hPath, int ypos) {
/** /**
* Not going anywhere - Kick off again if not at final destination. * Not going anywhere - Kick off again if not at final destination.
*/ */
static void NotMoving(PMOVER pActor, int x, int y) { static void NotMoving(MOVER *pActor, int x, int y) {
pActor->targetX = pActor->targetY = -1; pActor->targetX = pActor->targetY = -1;
// if (x == pActor->UtargetX && y == pActor->UtargetY) // if (x == pActor->UtargetX && y == pActor->UtargetY)
@ -1479,7 +1479,7 @@ static void NotMoving(PMOVER pActor, int x, int y) {
/** /**
* Does the necessary business when entering a different path polygon. * Does the necessary business when entering a different path polygon.
*/ */
static void EnteringNewPath(PMOVER pMover, HPOLYGON hPath, int x, int y) { static void EnteringNewPath(MOVER *pMover, HPOLYGON hPath, int x, int y) {
int firstnode; // First node to go to int firstnode; // First node to go to
int lastnode; // Last node to go to int lastnode; // Last node to go to
HPOLYGON hIpath; HPOLYGON hIpath;
@ -1583,7 +1583,7 @@ static void EnteringNewPath(PMOVER pMover, HPOLYGON hPath, int x, int y) {
/** /**
* Move * Move
*/ */
void Move(PMOVER pMover, int newx, int newy, HPOLYGON hPath) { void Move(MOVER *pMover, int newx, int newy, HPOLYGON hPath) {
pMover->objX = newx; pMover->objX = newx;
pMover->objY = newy; pMover->objY = newy;
@ -1607,13 +1607,13 @@ void Move(PMOVER pMover, int newx, int newy, HPOLYGON hPath) {
* *
* Moves the actor as appropriate. * Moves the actor as appropriate.
*/ */
void MoveActor(PMOVER pMover) { void MoveActor(MOVER *pMover) {
int newx, newy; int newx, newy;
HPOLYGON hPath; HPOLYGON hPath;
int status, s2; // s2 not used here! int status, s2; // s2 not used here!
HPOLYGON hS2p; // nor is s2p! HPOLYGON hS2p; // nor is s2p!
HPOLYGON hEb; HPOLYGON hEb;
PMOVER ma; MOVER *ma;
int sTargetX, sTargetY; int sTargetX, sTargetY;
bool bNewPath = false; bool bNewPath = false;
@ -1739,7 +1739,7 @@ int GetLastLeadYdest() {
/** /**
* DoMoveActor * DoMoveActor
*/ */
void DoMoveActor(PMOVER pActor) { void DoMoveActor(MOVER *pActor) {
int wasx, wasy; int wasx, wasy;
int i; int i;

View file

@ -58,7 +58,7 @@ static MOVER g_Movers[MAX_MOVERS];
/** /**
* Called from ActorPalette(), normally once just after the beginning of time. * Called from ActorPalette(), normally once just after the beginning of time.
*/ */
void StoreMoverPalette(PMOVER pMover, int startColor, int length) { void StoreMoverPalette(MOVER *pMover, int startColor, int length) {
pMover->startColor = startColor; pMover->startColor = startColor;
pMover->paletteLength = length; pMover->paletteLength = length;
} }
@ -66,7 +66,7 @@ void StoreMoverPalette(PMOVER pMover, int startColor, int length) {
/** /**
* Called from the moving actor's main loop. * Called from the moving actor's main loop.
*/ */
static void CheckBrightness(PMOVER pMover) { static void CheckBrightness(MOVER *pMover) {
int brightness; int brightness;
if (pMover->hCpath == NOPOLY || pMover->bHidden) if (pMover->hCpath == NOPOLY || pMover->bHidden)
@ -97,7 +97,7 @@ static void CheckBrightness(PMOVER pMover) {
* Typically called before the moving actor is created * Typically called before the moving actor is created
* at the start of a scene to cover a walk-in Play(). * at the start of a scene to cover a walk-in Play().
*/ */
void MoverBrightness(PMOVER pMover, int brightness) { void MoverBrightness(MOVER *pMover, int brightness) {
// Note: Like with some of the Tinsel1 code, this routine original had a process yield // Note: Like with some of the Tinsel1 code, this routine original had a process yield
// if BgPal is NULL, and has been changed for ScummVM to a simple assert // if BgPal is NULL, and has been changed for ScummVM to a simple assert
@ -122,7 +122,7 @@ void RebootMovers() {
* Given an actor number, return pointer to its moving actor structure, * Given an actor number, return pointer to its moving actor structure,
* if it is a moving actor. * if it is a moving actor.
*/ */
PMOVER GetMover(int ano) { MOVER *GetMover(int ano) {
int i; int i;
// Slot 0 is reserved for lead actor // Slot 0 is reserved for lead actor
@ -139,7 +139,7 @@ PMOVER GetMover(int ano) {
/** /**
* Register an actor as being a moving one. * Register an actor as being a moving one.
*/ */
PMOVER RegisterMover(int ano) { MOVER *RegisterMover(int ano) {
int i; int i;
// Slot 0 is reserved for lead actor // Slot 0 is reserved for lead actor
@ -173,7 +173,7 @@ PMOVER RegisterMover(int ano) {
* *
* At the time of writing, used by the effect process. * At the time of writing, used by the effect process.
*/ */
PMOVER GetLiveMover(int index) { MOVER *GetLiveMover(int index) {
assert(index >= 0 && index < MAX_MOVERS); // out of range assert(index >= 0 && index < MAX_MOVERS); // out of range
if (g_Movers[index].bActive) if (g_Movers[index].bActive)
@ -197,7 +197,7 @@ void SetMoverInEffect(int index, bool tf) {
/** /**
* Remove a moving actor from the current scene. * Remove a moving actor from the current scene.
*/ */
void KillMover(PMOVER pMover) { void KillMover(MOVER *pMover) {
if (pMover->bActive) { if (pMover->bActive) {
pMover->bActive = false; pMover->bActive = false;
MultiDeleteObject(_vm->_bg->GetPlayfieldList(FIELD_WORLD), pMover->actorObj); MultiDeleteObject(_vm->_bg->GetPlayfieldList(FIELD_WORLD), pMover->actorObj);
@ -210,7 +210,7 @@ void KillMover(PMOVER pMover) {
/** /**
* getMActorState * getMActorState
*/ */
bool getMActorState(PMOVER pActor) { bool getMActorState(MOVER *pActor) {
return pActor->bActive; return pActor->bActive;
} }
@ -219,7 +219,7 @@ bool getMActorState(PMOVER pActor) {
* MultiHideObject() is deliberately not used, as StepAnimScript() calls * MultiHideObject() is deliberately not used, as StepAnimScript() calls
* cause the object to re-appear. * cause the object to re-appear.
*/ */
void HideMover(PMOVER pMover, int sf) { void HideMover(MOVER *pMover, int sf) {
assert(pMover); // Hiding null moving actor assert(pMover); // Hiding null moving actor
pMover->bHidden = true; pMover->bHidden = true;
@ -243,7 +243,7 @@ void HideMover(PMOVER pMover, int sf) {
/** /**
* MoverHidden * MoverHidden
*/ */
bool MoverHidden(PMOVER pMover) { bool MoverHidden(MOVER *pMover) {
if (pMover) if (pMover)
return pMover->bHidden; return pMover->bHidden;
else else
@ -253,7 +253,7 @@ bool MoverHidden(PMOVER pMover) {
/** /**
* To be or not to be? If it be, then it is. * To be or not to be? If it be, then it is.
*/ */
bool MoverIs(PMOVER pMover) { bool MoverIs(MOVER *pMover) {
if (TinselV2) if (TinselV2)
return pMover->actorObj ? true : false; return pMover->actorObj ? true : false;
else else
@ -263,14 +263,14 @@ bool MoverIs(PMOVER pMover) {
/** /**
* To be SWalk()ing or not to be SWalk()ing? * To be SWalk()ing or not to be SWalk()ing?
*/ */
bool MoverIsSWalking(PMOVER pMover) { bool MoverIsSWalking(MOVER *pMover) {
return (MoverMoving(pMover) && pMover->bIgPath); return (MoverMoving(pMover) && pMover->bIgPath);
} }
/** /**
* MoverMoving() * MoverMoving()
*/ */
bool MoverMoving(PMOVER pMover) { bool MoverMoving(MOVER *pMover) {
if (!TinselV2) if (!TinselV2)
return pMover->bMoving; return pMover->bMoving;
@ -283,21 +283,21 @@ bool MoverMoving(PMOVER pMover) {
/** /**
* Return an actor's walk ticket. * Return an actor's walk ticket.
*/ */
int GetWalkNumber(PMOVER pMover) { int GetWalkNumber(MOVER *pMover) {
return pMover->walkNumber; return pMover->walkNumber;
} }
/** /**
* GetMoverId * GetMoverId
*/ */
int GetMoverId(PMOVER pMover) { int GetMoverId(MOVER *pMover) {
return pMover->actorID; return pMover->actorID;
} }
/** /**
* Sets the mover Z position * Sets the mover Z position
*/ */
void SetMoverZ(PMOVER pMover, int y, uint32 zFactor) { void SetMoverZ(MOVER *pMover, int y, uint32 zFactor) {
if (!pMover->bHidden) { if (!pMover->bHidden) {
if (!TinselV2) if (!TinselV2)
_vm->_actor->AsetZPos(pMover->actorObj, y, zFactor); _vm->_actor->AsetZPos(pMover->actorObj, y, zFactor);
@ -311,14 +311,14 @@ void SetMoverZ(PMOVER pMover, int y, uint32 zFactor) {
} }
} }
void SetMoverZoverride(PMOVER pMover, uint32 zFactor) { void SetMoverZoverride(MOVER *pMover, uint32 zFactor) {
pMover->zOverride = zFactor; pMover->zOverride = zFactor;
} }
/** /**
* UnHideMover * UnHideMover
*/ */
void UnHideMover(PMOVER pMover) { void UnHideMover(MOVER *pMover) {
assert(pMover); // unHiding null moving actor assert(pMover); // unHiding null moving actor
if (!TinselV2 || pMover->bHidden) { if (!TinselV2 || pMover->bHidden) {
@ -338,7 +338,7 @@ void UnHideMover(PMOVER pMover) {
/** /**
* Clear everything out at actor start-up time. * Clear everything out at actor start-up time.
*/ */
static void InitMover(PMOVER pMover) { static void InitMover(MOVER *pMover) {
pMover->bActive = false; pMover->bActive = false;
pMover->actorObj = nullptr; pMover->actorObj = nullptr;
pMover->objX = pMover->objY = 0; pMover->objX = pMover->objY = 0;
@ -401,7 +401,7 @@ void DropMovers() {
/** /**
* Reposition a moving actor. * Reposition a moving actor.
*/ */
void PositionMover(PMOVER pMover, int x, int y) { void PositionMover(MOVER *pMover, int x, int y) {
int z; int z;
int node; int node;
HPOLYGON hPath; HPOLYGON hPath;
@ -447,7 +447,7 @@ void PositionMover(PMOVER pMover, int x, int y) {
/** /**
* Get position of a moving actor. * Get position of a moving actor.
*/ */
void GetMoverPosition(PMOVER pMover, int *paniX, int *paniY) { void GetMoverPosition(MOVER *pMover, int *paniX, int *paniY) {
assert(pMover); // Getting null moving actor's position assert(pMover); // Getting null moving actor's position
if (pMover->actorObj != NULL) if (pMover->actorObj != NULL)
@ -461,7 +461,7 @@ void GetMoverPosition(PMOVER pMover, int *paniX, int *paniY) {
/** /**
* Moving actor's mid-top position. * Moving actor's mid-top position.
*/ */
void GetMoverMidTop(PMOVER pMover, int *aniX, int *aniY) { void GetMoverMidTop(MOVER *pMover, int *aniX, int *aniY) {
assert(pMover); // Getting null moving actor's mid-top position assert(pMover); // Getting null moving actor's mid-top position
assert(pMover->actorObj); // Getting null moving actor's mid-top position assert(pMover->actorObj); // Getting null moving actor's mid-top position
@ -472,7 +472,7 @@ void GetMoverMidTop(PMOVER pMover, int *aniX, int *aniY) {
/** /**
* Moving actor's left-most co-ordinate. * Moving actor's left-most co-ordinate.
*/ */
int GetMoverLeft(PMOVER pMover) { int GetMoverLeft(MOVER *pMover) {
assert(pMover); // Getting null moving actor's leftmost position assert(pMover); // Getting null moving actor's leftmost position
if (pMover->type == MOVER_3D) { if (pMover->type == MOVER_3D) {
warning("TODO: Finish implementation of GetMoverLeft() for Noir"); warning("TODO: Finish implementation of GetMoverLeft() for Noir");
@ -486,7 +486,7 @@ int GetMoverLeft(PMOVER pMover) {
/** /**
* Moving actor's right-most co-ordinate. * Moving actor's right-most co-ordinate.
*/ */
int GetMoverRight(PMOVER pMover) { int GetMoverRight(MOVER *pMover) {
assert(pMover); // Getting null moving actor's rightmost position assert(pMover); // Getting null moving actor's rightmost position
if (pMover->type == MOVER_3D) { if (pMover->type == MOVER_3D) {
warning("TODO: Finish implementation of GetMoverRight() for Noir"); warning("TODO: Finish implementation of GetMoverRight() for Noir");
@ -500,7 +500,7 @@ int GetMoverRight(PMOVER pMover) {
/** /**
* Moving actor's top co-ordinate. * Moving actor's top co-ordinate.
*/ */
int GetMoverTop(PMOVER pMover) { int GetMoverTop(MOVER *pMover) {
assert(pMover); // Getting null moving actor's topmost position assert(pMover); // Getting null moving actor's topmost position
if (pMover->type == MOVER_3D) { if (pMover->type == MOVER_3D) {
@ -515,7 +515,7 @@ int GetMoverTop(PMOVER pMover) {
/** /**
* Moving actor's bottom co-ordinate. * Moving actor's bottom co-ordinate.
*/ */
int GetMoverBottom(PMOVER pMover) { int GetMoverBottom(MOVER *pMover) {
assert(pMover); // Getting null moving actor's bottommost position assert(pMover); // Getting null moving actor's bottommost position
if (pMover->type == MOVER_3D) { if (pMover->type == MOVER_3D) {
warning("TODO: Finish implementation of GetMoverBottom() for Noir"); warning("TODO: Finish implementation of GetMoverBottom() for Noir");
@ -529,7 +529,7 @@ int GetMoverBottom(PMOVER pMover) {
/** /**
* See if moving actor is stood within a polygon. * See if moving actor is stood within a polygon.
*/ */
bool MoverIsInPolygon(PMOVER pMover, HPOLYGON hp) { bool MoverIsInPolygon(MOVER *pMover, HPOLYGON hp) {
assert(pMover); // Checking if null moving actor is in polygon assert(pMover); // Checking if null moving actor is in polygon
assert(pMover->actorObj); // Checking if null moving actor is in polygon assert(pMover->actorObj); // Checking if null moving actor is in polygon
@ -542,7 +542,7 @@ bool MoverIsInPolygon(PMOVER pMover, HPOLYGON hp) {
/** /**
* Change which reel is playing for a moving actor. * Change which reel is playing for a moving actor.
*/ */
void AlterMover(PMOVER pMover, SCNHANDLE film, AR_FUNCTION fn) { void AlterMover(MOVER *pMover, SCNHANDLE film, AR_FUNCTION fn) {
const FILM *pfilm; const FILM *pfilm;
assert(pMover->actorObj); // Altering null moving actor's animation script assert(pMover->actorObj); // Altering null moving actor's animation script
@ -602,28 +602,28 @@ void AlterMover(PMOVER pMover, SCNHANDLE film, AR_FUNCTION fn) {
/** /**
* Return the actor's direction. * Return the actor's direction.
*/ */
DIRECTION GetMoverDirection(PMOVER pMover) { DIRECTION GetMoverDirection(MOVER *pMover) {
return pMover->direction; return pMover->direction;
} }
/** /**
* Return the actor's scale. * Return the actor's scale.
*/ */
int GetMoverScale(PMOVER pMover) { int GetMoverScale(MOVER *pMover) {
return pMover->scale; return pMover->scale;
} }
/** /**
* Point actor in specified derection * Point actor in specified derection
*/ */
void SetMoverDirection(PMOVER pMover, DIRECTION dirn) { void SetMoverDirection(MOVER *pMover, DIRECTION dirn) {
pMover->direction = dirn; pMover->direction = dirn;
} }
/** /**
* Get actor to adopt its appropriate standing reel. * Get actor to adopt its appropriate standing reel.
*/ */
void SetMoverStanding(PMOVER pMover) { void SetMoverStanding(MOVER *pMover) {
if (TinselV3) { if (TinselV3) {
warning("TODO: Finish implementation of GetMoverStanding() for Noir"); warning("TODO: Finish implementation of GetMoverStanding() for Noir");
return; return;
@ -635,7 +635,7 @@ void SetMoverStanding(PMOVER pMover) {
/** /**
* Get actor to adopt its appropriate walking reel. * Get actor to adopt its appropriate walking reel.
*/ */
void SetMoverWalkReel(PMOVER pMover, DIRECTION reel, int scale, bool force) { void SetMoverWalkReel(MOVER *pMover, DIRECTION reel, int scale, bool force) {
SCNHANDLE whichReel; SCNHANDLE whichReel;
const FILM *pfilm; const FILM *pfilm;
@ -680,7 +680,7 @@ void SetMoverWalkReel(PMOVER pMover, DIRECTION reel, int scale, bool force) {
/** /**
* Sort some stuff out at actor start-up time. * Sort some stuff out at actor start-up time.
*/ */
static void InitialPathChecks(PMOVER pMover, int xpos, int ypos) { static void InitialPathChecks(MOVER *pMover, int xpos, int ypos) {
HPOLYGON hPath; HPOLYGON hPath;
int node; int node;
int z; int z;
@ -717,7 +717,7 @@ static void InitialPathChecks(PMOVER pMover, int xpos, int ypos) {
} }
} }
static void MoverProcessHelper(int X, int Y, int id, PMOVER pMover) { static void MoverProcessHelper(int X, int Y, int id, MOVER *pMover) {
const FILM *pfilm = (const FILM *)_vm->_handle->LockMem(pMover->walkReels[0][FORWARD]); const FILM *pfilm = (const FILM *)_vm->_handle->LockMem(pMover->walkReels[0][FORWARD]);
const MULTI_INIT *pmi = (const MULTI_INIT *)_vm->_handle->LockMem(FROM_32(pfilm->reels[0].mobj)); const MULTI_INIT *pmi = (const MULTI_INIT *)_vm->_handle->LockMem(FROM_32(pfilm->reels[0].mobj));
@ -769,7 +769,7 @@ void T1MoverProcess(CORO_PARAM, const void *param) {
CORO_BEGIN_CONTEXT; CORO_BEGIN_CONTEXT;
CORO_END_CONTEXT(_ctx); CORO_END_CONTEXT(_ctx);
const PMOVER pActor = *(const PMOVER *)param; MOVER *pActor = *(MOVER **)param;
CORO_BEGIN_CODE(_ctx); CORO_BEGIN_CODE(_ctx);
@ -801,10 +801,10 @@ void T2MoverProcess(CORO_PARAM, const void *param) {
// Get the co-ordinates - copied to process when it was created // Get the co-ordinates - copied to process when it was created
const MAINIT *rpos = (const MAINIT *)param; const MAINIT *rpos = (const MAINIT *)param;
PMOVER pMover = rpos->pMover; MOVER *pMover = rpos->pMover;
int i; int i;
FILM *pFilm; FILM *pFilm;
PMULTI_INIT pmi; MULTI_INIT *pmi;
CORO_BEGIN_CODE(_ctx); CORO_BEGIN_CODE(_ctx);
@ -818,7 +818,7 @@ void T2MoverProcess(CORO_PARAM, const void *param) {
InitialPathChecks(pMover, rpos->X, rpos->Y); InitialPathChecks(pMover, rpos->X, rpos->Y);
pFilm = (FILM *)_vm->_handle->LockMem(pMover->walkReels[i][FORWARD]); // Any old reel pFilm = (FILM *)_vm->_handle->LockMem(pMover->walkReels[i][FORWARD]); // Any old reel
pmi = (PMULTI_INIT)_vm->_handle->LockMem(FROM_32(pFilm->reels[0].mobj)); pmi = (MULTI_INIT *)_vm->_handle->LockMem(FROM_32(pFilm->reels[0].mobj));
// Poke in the background palette // Poke in the background palette
PokeInPalette(pmi); PokeInPalette(pmi);
@ -873,7 +873,7 @@ void T3MoverProcess(CORO_PARAM, const void *param) {
// Get the co-ordinates - copied to process when it was created // Get the co-ordinates - copied to process when it was created
const MAINIT *rpos = (const MAINIT *)param; const MAINIT *rpos = (const MAINIT *)param;
PMOVER pMover = rpos->pMover; MOVER *pMover = rpos->pMover;
CORO_BEGIN_CODE(_ctx); CORO_BEGIN_CODE(_ctx);
@ -900,7 +900,7 @@ void T3MoverProcess(CORO_PARAM, const void *param) {
/** /**
* Creates a handling process for a moving actor * Creates a handling process for a moving actor
*/ */
void MoverProcessCreate(int X, int Y, int id, PMOVER pMover) { void MoverProcessCreate(int X, int Y, int id, MOVER *pMover) {
if (TinselV2 || TinselV3) { if (TinselV2 || TinselV3) {
MAINIT iStruct; MAINIT iStruct;
iStruct.X = X; iStruct.X = X;
@ -910,14 +910,14 @@ void MoverProcessCreate(int X, int Y, int id, PMOVER pMover) {
CoroScheduler.createProcess(PID_MOVER, TinselV3 ? T3MoverProcess : T2MoverProcess, &iStruct, sizeof(MAINIT)); CoroScheduler.createProcess(PID_MOVER, TinselV3 ? T3MoverProcess : T2MoverProcess, &iStruct, sizeof(MAINIT));
} else { } else {
MoverProcessHelper(X, Y, id, pMover); MoverProcessHelper(X, Y, id, pMover);
pMover->pProc = CoroScheduler.createProcess(PID_MOVER, T1MoverProcess, &pMover, sizeof(PMOVER)); pMover->pProc = CoroScheduler.createProcess(PID_MOVER, T1MoverProcess, &pMover, sizeof(MOVER *));
} }
} }
/** /**
* Check for moving actor collision. * Check for moving actor collision.
*/ */
PMOVER InMoverBlock(PMOVER pMover, int x, int y) { MOVER *InMoverBlock(MOVER *pMover, int x, int y) {
int caX; // Calling actor's pos'n int caX; // Calling actor's pos'n
int caL, caR; // Calling actor's left and right int caL, caR; // Calling actor's left and right
int taX, taY; // Test actor's pos'n int taX, taY; // Test actor's pos'n
@ -995,7 +995,7 @@ void RestoreAuxScales(SAVED_MOVER *sMoverInfo) {
} }
PMOVER NextMover(PMOVER pMover) { MOVER *NextMover(MOVER *pMover) {
int next; int next;
if (pMover == NULL) if (pMover == NULL)
@ -1009,7 +1009,7 @@ PMOVER NextMover(PMOVER pMover) {
return NULL; return NULL;
} }
void StopMover(PMOVER pMover) { void StopMover(MOVER *pMover) {
pMover->bStop = true; pMover->bStop = true;
DoMoveActor(pMover); DoMoveActor(pMover);
} }

View file

@ -126,70 +126,68 @@ struct MOVER {
bool bIsValid; bool bIsValid;
}; };
typedef MOVER *PMOVER;
struct MAINIT { struct MAINIT {
int X; int X;
int Y; int Y;
PMOVER pMover; MOVER *pMover;
}; };
typedef MAINIT *PMAINIT;
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
void MoverProcessCreate(int X, int Y, int id, PMOVER pMover); void MoverProcessCreate(int X, int Y, int id, MOVER *pMover);
enum AR_FUNCTION { AR_NORMAL, AR_PUSHREEL, AR_POPREEL, AR_WALKREEL }; enum AR_FUNCTION { AR_NORMAL, AR_PUSHREEL, AR_POPREEL, AR_WALKREEL };
void StoreMoverPalette(PMOVER pMover, int startColor, int length); void StoreMoverPalette(MOVER *pMover, int startColor, int length);
void MoverBrightness(PMOVER pMover, int brightness); void MoverBrightness(MOVER *pMover, int brightness);
MOVER *GetMover(int ano); MOVER *GetMover(int ano);
MOVER *RegisterMover(int ano); MOVER *RegisterMover(int ano);
void KillMover(PMOVER pMover); void KillMover(MOVER *pMover);
MOVER *GetLiveMover(int index); MOVER *GetLiveMover(int index);
bool getMActorState(MOVER *psActor); bool getMActorState(MOVER *psActor);
int GetMoverId(PMOVER pMover); int GetMoverId(MOVER *pMover);
void SetMoverZ(PMOVER pMover, int y, uint32 zFactor); void SetMoverZ(MOVER *pMover, int y, uint32 zFactor);
void SetMoverZoverride(PMOVER pMover, uint32 zFactor); void SetMoverZoverride(MOVER *pMover, uint32 zFactor);
void HideMover(PMOVER pMover, int sf = 0); void HideMover(MOVER *pMover, int sf = 0);
bool MoverHidden(PMOVER pMover); bool MoverHidden(MOVER *pMover);
bool MoverIs(PMOVER pMover); bool MoverIs(MOVER *pMover);
bool MoverIsSWalking(PMOVER pMover); bool MoverIsSWalking(MOVER *pMover);
bool MoverMoving(PMOVER pMover); bool MoverMoving(MOVER *pMover);
int GetWalkNumber(PMOVER pMover); int GetWalkNumber(MOVER *pMover);
void UnHideMover(PMOVER pMover); void UnHideMover(MOVER *pMover);
void DropMovers(); void DropMovers();
void PositionMover(PMOVER pMover, int x, int y); void PositionMover(MOVER *pMover, int x, int y);
void GetMoverPosition(PMOVER pMover, int *aniX, int *aniY); void GetMoverPosition(MOVER *pMover, int *aniX, int *aniY);
void GetMoverMidTop(PMOVER pMover, int *aniX, int *aniY); void GetMoverMidTop(MOVER *pMover, int *aniX, int *aniY);
int GetMoverLeft(PMOVER pMover); int GetMoverLeft(MOVER *pMover);
int GetMoverRight(PMOVER pMover); int GetMoverRight(MOVER *pMover);
int GetMoverTop(PMOVER pMover); int GetMoverTop(MOVER *pMover);
int GetMoverBottom(PMOVER pMover); int GetMoverBottom(MOVER *pMover);
bool MoverIsInPolygon(PMOVER pMover, HPOLYGON hPoly); bool MoverIsInPolygon(MOVER *pMover, HPOLYGON hPoly);
void AlterMover(PMOVER pMover, SCNHANDLE film, AR_FUNCTION fn); void AlterMover(MOVER *pMover, SCNHANDLE film, AR_FUNCTION fn);
DIRECTION GetMoverDirection(PMOVER pMover); DIRECTION GetMoverDirection(MOVER *pMover);
int GetMoverScale(PMOVER pMover); int GetMoverScale(MOVER *pMover);
void SetMoverDirection(PMOVER pMover, DIRECTION dirn); void SetMoverDirection(MOVER *pMover, DIRECTION dirn);
void SetMoverStanding(PMOVER pMover); void SetMoverStanding(MOVER *pMover);
void SetMoverWalkReel(PMOVER pMover, DIRECTION reel, int scale, bool force); void SetMoverWalkReel(MOVER *pMover, DIRECTION reel, int scale, bool force);
PMOVER InMoverBlock(PMOVER pMover, int x, int y); MOVER *InMoverBlock(MOVER *pMover, int x, int y);
void RebootMovers(); void RebootMovers();
bool IsMAinEffectPoly(int index); bool IsMAinEffectPoly(int index);
void SetMoverInEffect(int index, bool tf); void SetMoverInEffect(int index, bool tf);
void StopMover(PMOVER pMover); void StopMover(MOVER *pMover);
/*----------------------------------------------------------------------*/ /*----------------------------------------------------------------------*/
@ -214,7 +212,7 @@ struct SAVED_MOVER {
void SaveMovers(SAVED_MOVER *sMoverInfo); void SaveMovers(SAVED_MOVER *sMoverInfo);
void RestoreAuxScales(SAVED_MOVER *sMoverInfo); void RestoreAuxScales(SAVED_MOVER *sMoverInfo);
PMOVER NextMover(PMOVER pMover); MOVER *NextMover(MOVER *pMover);
/*----------------------------------------------------------------------*/ /*----------------------------------------------------------------------*/

View file

@ -529,7 +529,7 @@ int MultiLowest(OBJECT *pMulti) {
* @param pMulti Multi-part object * @param pMulti Multi-part object
*/ */
bool MultiHasShape(POBJECT pMulti) { bool MultiHasShape(OBJECT *pMulti) {
return (pMulti->hShape != 0); return (pMulti->hShape != 0);
} }
@ -538,7 +538,7 @@ bool MultiHasShape(POBJECT pMulti) {
* @param pMultiObj Multi-part object to be adjusted * @param pMultiObj Multi-part object to be adjusted
*/ */
void MultiForceRedraw(POBJECT pMultiObj) { void MultiForceRedraw(OBJECT *pMultiObj) {
// validate object pointer // validate object pointer
assert(isValidObject(pMultiObj)); assert(isValidObject(pMultiObj));

View file

@ -44,7 +44,6 @@ struct MULTI_INIT {
int32 mulZ; ///< multi-objects initial z position int32 mulZ; ///< multi-objects initial z position
uint32 otherFlags; ///< multi-objects Tinsel 2 - other flags uint32 otherFlags; ///< multi-objects Tinsel 2 - other flags
} PACKED_STRUCT; } PACKED_STRUCT;
typedef MULTI_INIT *PMULTI_INIT;
#include "common/pack-end.h" // END STRUCT PACKING #include "common/pack-end.h" // END STRUCT PACKING
@ -99,10 +98,6 @@ void MultiSetZPosition( // Sets the z position of a multi-part object
OBJECT *pMultiObj, // multi-part object to be adjusted OBJECT *pMultiObj, // multi-part object to be adjusted
int newZ); // new Z order int newZ); // new Z order
void MultiMatchAniPoints( // Matches a multi-parts pos and orientation to be the same as a reference object
OBJECT *pMoveObj, // multi-part object to be moved
OBJECT *pRefObj); // multi-part object to match with
void MultiReshape( // Reshape a multi-part object void MultiReshape( // Reshape a multi-part object
OBJECT *pMultiObj); // multi-part object to re-shape OBJECT *pMultiObj); // multi-part object to re-shape
@ -119,10 +114,10 @@ int MultiLowest( // Returns the lowest point of a multi-part object
OBJECT *pMulti); // multi-part object OBJECT *pMulti); // multi-part object
bool MultiHasShape( // Returns TRUE if the object currently has an image bool MultiHasShape( // Returns TRUE if the object currently has an image
POBJECT pMulti); // multi-part object OBJECT *pMulti); // multi-part object
void MultiForceRedraw( void MultiForceRedraw(
POBJECT pMultiObj); // multi-part object to be forced OBJECT *pMultiObj); // multi-part object to be forced
} // End of namespace Tinsel } // End of namespace Tinsel

View file

@ -120,7 +120,6 @@ struct OBJECT {
OBJECT() { reset(); } OBJECT() { reset(); }
}; };
typedef OBJECT *POBJECT;
#include "common/pack-start.h" // START STRUCT PACKING #include "common/pack-start.h" // START STRUCT PACKING

View file

@ -285,7 +285,7 @@ static INT_CONTEXT *AllocateInterpretContext(GSORT gsort) {
error("Out of interpret contexts"); error("Out of interpret contexts");
} }
static void FreeWaitCheck(PINT_CONTEXT pic, bool bVoluntary) { static void FreeWaitCheck(INT_CONTEXT * pic, bool bVoluntary) {
int i; int i;
// Is this waiting for something? // Is this waiting for something?
@ -925,7 +925,7 @@ void WaitInterpret(CORO_PARAM, Common::PPROCESS pWaitProc, bool *result) {
*/ */
CORO_BEGIN_CONTEXT; CORO_BEGIN_CONTEXT;
PINT_CONTEXT picWaiter, picWaitee; INT_CONTEXT *picWaiter, *picWaitee;
CORO_END_CONTEXT(_ctx); CORO_END_CONTEXT(_ctx);

View file

@ -85,7 +85,6 @@ struct INT_CONTEXT {
void syncWithSerializer(Common::Serializer &s); void syncWithSerializer(Common::Serializer &s);
}; };
typedef INT_CONTEXT *PINT_CONTEXT;
/*----------------------------------------------------------------------*\ /*----------------------------------------------------------------------*\
|* Interpreter Function Prototypes *| |* Interpreter Function Prototypes *|

View file

@ -148,7 +148,7 @@ void CursorPositionProcess(CORO_PARAM, const void *) {
char PositionString[64]; // sprintf() things into here char PositionString[64]; // sprintf() things into here
PMOVER pActor; // Lead actor MOVER *pActor; // Lead actor
while (1) { while (1) {
_vm->_bg->PlayfieldGetPos(FIELD_WORLD, &Loffset, &Toffset); _vm->_bg->PlayfieldGetPos(FIELD_WORLD, &Loffset, &Toffset);

View file

@ -107,7 +107,7 @@ void PokeInPalette(const MULTI_INIT *pmi) {
} }
int32 NoNameFunc(int actorID, bool bNewMover) { int32 NoNameFunc(int actorID, bool bNewMover) {
PMOVER pActor; MOVER *pActor;
int32 retval; int32 retval;
pActor = GetMover(actorID); pActor = GetMover(actorID);
@ -182,7 +182,7 @@ static void DeRegisterSoundReel(SCNHANDLE hFilm, int column) {
} }
} }
void SaveSoundReels(PSOUNDREELS psr) { void SaveSoundReels(SOUNDREELS *psr) {
for (int i = 0; i < MAX_SOUNDREELS; i++) { for (int i = 0; i < MAX_SOUNDREELS; i++) {
if (_vm->_handle->IsCdPlayHandle(g_soundReels[i].hFilm)) if (_vm->_handle->IsCdPlayHandle(g_soundReels[i].hFilm))
g_soundReels[i].hFilm = 0; g_soundReels[i].hFilm = 0;
@ -191,11 +191,11 @@ void SaveSoundReels(PSOUNDREELS psr) {
memcpy(psr, g_soundReels, sizeof(g_soundReels)); memcpy(psr, g_soundReels, sizeof(g_soundReels));
} }
void RestoreSoundReels(PSOUNDREELS psr) { void RestoreSoundReels(SOUNDREELS *psr) {
memcpy(g_soundReels, psr, sizeof(g_soundReels)); memcpy(g_soundReels, psr, sizeof(g_soundReels));
} }
static uint32 GetZfactor(int actorID, PMOVER pMover, bool bNewMover) { static uint32 GetZfactor(int actorID, MOVER *pMover, bool bNewMover) {
if (pMover != NULL && bNewMover == false) { if (pMover != NULL && bNewMover == false) {
// If no path, just use first path in the scene // If no path, just use first path in the scene
if (pMover->hCpath == NOPOLY) if (pMover->hCpath == NOPOLY)
@ -235,10 +235,10 @@ static void SoundReel(CORO_PARAM, SCNHANDLE hFilm, int column, int speed,
CORO_BEGIN_CODE(_ctx); CORO_BEGIN_CODE(_ctx);
if (actorCol) { if (actorCol) {
PMULTI_INIT pmi; // MULTI_INIT structure MULTI_INIT *pmi; // MULTI_INIT structure
pReel = GetReel(hFilm, actorCol - 1); pReel = GetReel(hFilm, actorCol - 1);
pmi = (PMULTI_INIT)_vm->_handle->LockMem(FROM_32(pReel->mobj)); pmi = (MULTI_INIT *)_vm->_handle->LockMem(FROM_32(pReel->mobj));
_ctx->reelActor = (int32)FROM_32(pmi->mulID); _ctx->reelActor = (int32)FROM_32(pmi->mulID);
} else } else
_ctx->reelActor = 0; _ctx->reelActor = 0;
@ -431,7 +431,7 @@ static void t1PlayReel(CORO_PARAM, const PPINIT *ppi) {
int stepCount; int stepCount;
int frameCount; int frameCount;
int reelActor; int reelActor;
PMOVER pActor; MOVER *pActor;
int tmpX, tmpY; int tmpX, tmpY;
CORO_END_CONTEXT(_ctx); CORO_END_CONTEXT(_ctx);
@ -683,11 +683,11 @@ static void t2PlayReel(CORO_PARAM, int x, int y, bool bRestore, int speed, SCNHA
FREEL *pFreel; FREEL *pFreel;
MULTI_INIT *pmi; // MULTI_INIT structure MULTI_INIT *pmi; // MULTI_INIT structure
POBJECT pPlayObj; // Object OBJECT *pPlayObj; // Object
ANIM thisAnim; // Animation structure ANIM thisAnim; // Animation structure
int reelActor; // Which actor this reel belongs to int reelActor; // Which actor this reel belongs to
PMOVER pMover; // set if it's a moving actor MOVER *pMover; // set if it's a moving actor
bool bNewMover; // Gets set if a moving actor that isn't in scene yet bool bNewMover; // Gets set if a moving actor that isn't in scene yet
int filmNumber; int filmNumber;
@ -1147,7 +1147,7 @@ void RestoreActorReels(SCNHANDLE hFilm, int actor, int x, int y) {
int i; int i;
FREEL *pFreel; FREEL *pFreel;
PMULTI_INIT pmi; // MULTI_INIT structure MULTI_INIT *pmi; // MULTI_INIT structure
ppi.hFilm = hFilm; ppi.hFilm = hFilm;
ppi.x = (short)x; ppi.x = (short)x;
@ -1160,7 +1160,7 @@ void RestoreActorReels(SCNHANDLE hFilm, int actor, int x, int y) {
// Search backwards for now as later column will be the one // Search backwards for now as later column will be the one
for (i = (int)FROM_32(pFilm->numreels) - 1; i >= 0; i--) { for (i = (int)FROM_32(pFilm->numreels) - 1; i >= 0; i--) {
pFreel = &pFilm->reels[i]; pFreel = &pFilm->reels[i];
pmi = (PMULTI_INIT)_vm->_handle->LockMem(FROM_32(pFreel->mobj)); pmi = (MULTI_INIT *)_vm->_handle->LockMem(FROM_32(pFreel->mobj));
if ((int32)FROM_32(pmi->mulID) == actor) { if ((int32)FROM_32(pmi->mulID) == actor) {
ppi.column = (short)i; ppi.column = (short)i;
NewestFilm(hFilm, &pFilm->reels[i]); NewestFilm(hFilm, &pFilm->reels[i]);

View file

@ -36,7 +36,6 @@ struct SOUNDREELS {
int column; // Column number int column; // Column number
int actorCol; int actorCol;
}; };
typedef SOUNDREELS *PSOUNDREELS;
void PlayFilm(CORO_PARAM, SCNHANDLE film, int x, int y, int actorid, bool splay, bool sfact, bool escOn, int myescEvent, bool bTop, OBJECT** playfield); void PlayFilm(CORO_PARAM, SCNHANDLE film, int x, int y, int actorid, bool splay, bool sfact, bool escOn, int myescEvent, bool bTop, OBJECT** playfield);
@ -50,8 +49,8 @@ void RestoreActorReels(SCNHANDLE hFilm, int actor, int x, int y);
void PokeInPalette(const MULTI_INIT *pmi); void PokeInPalette(const MULTI_INIT *pmi);
void NoSoundReels(); void NoSoundReels();
void SaveSoundReels(PSOUNDREELS psr); void SaveSoundReels(SOUNDREELS *psr);
void RestoreSoundReels(PSOUNDREELS psr); void RestoreSoundReels(SOUNDREELS *psr);
int ExtractActor(SCNHANDLE hFilm); int ExtractActor(SCNHANDLE hFilm);

View file

@ -107,7 +107,6 @@ struct POLYGON {
POLYGON *adjpaths[MAXADJ]; POLYGON *adjpaths[MAXADJ];
}; };
typedef POLYGON *PPOLYGON;
#define MAXONROUTE 40 #define MAXONROUTE 40
@ -1359,7 +1358,7 @@ static int DistinctCorners(HPOLYGON hp1, HPOLYGON hp2) {
/** /**
* Returns true if the two paths are on the same level * Returns true if the two paths are on the same level
*/ */
static bool MatchingLevels(PPOLYGON p1, PPOLYGON p2) { static bool MatchingLevels(POLYGON *p1, POLYGON *p2) {
byte *pps = _vm->_handle->LockMem(pHandle); // All polygons byte *pps = _vm->_handle->LockMem(pHandle); // All polygons
Poly pp1(pps, p1->pIndex); // This polygon 1 Poly pp1(pps, p1->pIndex); // This polygon 1
Poly pp2(pps, p2->pIndex); // This polygon 2 Poly pp2(pps, p2->pIndex); // This polygon 2
@ -1381,7 +1380,7 @@ static void SetPathAdjacencies() {
// Reset them all // Reset them all
for (i1 = 0; i1 < noofPolys; i1++) for (i1 = 0; i1 < noofPolys; i1++)
memset(Polys[i1]->adjpaths, 0, MAXADJ * sizeof(PPOLYGON)); memset(Polys[i1]->adjpaths, 0, MAXADJ * sizeof(POLYGON *));
// For each polygon.. // For each polygon..
for (i1 = 0; i1 < MAX_POLY-1; i1++) { for (i1 = 0; i1 < MAX_POLY-1; i1++) {
@ -1618,13 +1617,10 @@ static void FiddlyBit(POLYGON *p) {
/** /**
* Allocate a POLYGON structure and reset it to default values * Allocate a POLYGON structure and reset it to default values
*/ */
static PPOLYGON GetPolyEntry() { static POLYGON *GetPolyEntry() {
int i; // Loop counter for (int i = 0; i < MaxPolys; i++) {
PPOLYGON p;
for (i = 0; i < MaxPolys; i++) {
if (!Polys[i]) { if (!Polys[i]) {
p = Polys[i] = &Polygons[i]; POLYGON *p = Polys[i] = &Polygons[i];
// What the hell, just clear it all out - it's safer // What the hell, just clear it all out - it's safer
memset(p, 0, sizeof(POLYGON)); memset(p, 0, sizeof(POLYGON));
@ -1640,15 +1636,14 @@ static PPOLYGON GetPolyEntry() {
* Variation of GetPolyEntry from Tinsel 1 that splits up getting a new * Variation of GetPolyEntry from Tinsel 1 that splits up getting a new
* polygon structure from initializing it * polygon structure from initializing it
*/ */
static PPOLYGON CommonInits(PTYPE polyType, int pno, const Poly &ptp, bool bRestart) { static POLYGON * CommonInits(PTYPE polyType, int pno, const Poly &ptp, bool bRestart) {
int i;
HPOLYGON hp; HPOLYGON hp;
PPOLYGON p = GetPolyEntry(); // Obtain a slot POLYGON *p = GetPolyEntry(); // Obtain a slot
p->polyType = polyType; // Polygon type p->polyType = polyType; // Polygon type
p->pIndex = pno; p->pIndex = pno;
for (i = 0; i < 4; i++) { // Polygon definition for (int i = 0; i < 4; i++) { // Polygon definition
p->cx[i] = (short)FROM_32(ptp.x[i]); p->cx[i] = (short)FROM_32(ptp.x[i]);
p->cy[i] = (short)FROM_32(ptp.y[i]); p->cy[i] = (short)FROM_32(ptp.y[i]);
} }
@ -1712,7 +1707,7 @@ static void InitExit(const Poly &ptp, int pno, bool bRestart) {
* Initialize a PATH or NPATH polygon. * Initialize a PATH or NPATH polygon.
*/ */
static void InitPath(const Poly &ptp, bool NodePath, int pno, bool bRestart) { static void InitPath(const Poly &ptp, bool NodePath, int pno, bool bRestart) {
PPOLYGON p = CommonInits(PATH, pno, ptp, bRestart); POLYGON *p = CommonInits(PATH, pno, ptp, bRestart);
p->subtype = NodePath ? NODE : NORMAL; p->subtype = NodePath ? NODE : NORMAL;
@ -1733,7 +1728,7 @@ static void InitBlock(const Poly &ptp, int pno, bool bRestart) {
* trying to walk through the actor you first thought of. * trying to walk through the actor you first thought of.
* This is for dynamic blocking. * This is for dynamic blocking.
*/ */
HPOLYGON InitExtraBlock(PMOVER ca, PMOVER ta) { HPOLYGON InitExtraBlock(MOVER *ca, MOVER *ta) {
int caX, caY; // Calling actor co-ords int caX, caY; // Calling actor co-ords
int taX, taY; // Test actor co-ords int taX, taY; // Test actor co-ords
int left, right; int left, right;
@ -1774,7 +1769,7 @@ static void InitEffect(const Poly &ptp, int pno, bool bRestart) {
* Initialize a REFER polygon. * Initialize a REFER polygon.
*/ */
static void InitRefer(const Poly &ptp, int pno, bool bRestart) { static void InitRefer(const Poly &ptp, int pno, bool bRestart) {
PPOLYGON p = CommonInits(REFER, pno, ptp, bRestart); POLYGON *p = CommonInits(REFER, pno, ptp, bRestart);
p->subtype = FROM_32(ptp.reftype); // Refer type p->subtype = FROM_32(ptp.reftype); // Refer type
} }

View file

@ -74,7 +74,7 @@ static void RestoredProcessProcess(CORO_PARAM, const void *param) {
CORO_BEGIN_CODE(_ctx); CORO_BEGIN_CODE(_ctx);
// get the stuff copied to process when it was created // get the stuff copied to process when it was created
_ctx->pic = *(const PINT_CONTEXT *)param; _ctx->pic = *(INT_CONTEXT **)param;
_ctx->pic = RestoreInterpretContext(_ctx->pic); _ctx->pic = RestoreInterpretContext(_ctx->pic);
AttachInterpret(_ctx->pic, CoroScheduler.getCurrentProcess()); AttachInterpret(_ctx->pic, CoroScheduler.getCurrentProcess());
@ -88,7 +88,7 @@ static void RestoredProcessProcess(CORO_PARAM, const void *param) {
* Process Tinsel Process * Process Tinsel Process
*/ */
static void ProcessTinselProcess(CORO_PARAM, const void *param) { static void ProcessTinselProcess(CORO_PARAM, const void *param) {
const PINT_CONTEXT *pPic = (const PINT_CONTEXT *)param; INT_CONTEXT **pPic = (INT_CONTEXT **)param;
CORO_BEGIN_CONTEXT; CORO_BEGIN_CONTEXT;
CORO_END_CONTEXT(_ctx); CORO_END_CONTEXT(_ctx);
@ -137,7 +137,7 @@ void SceneProcessEvent(CORO_PARAM, uint32 procID, TINSEL_EVENT event, bool bWait
CORO_BEGIN_CONTEXT; CORO_BEGIN_CONTEXT;
PROCESS_STRUC *pStruc; PROCESS_STRUC *pStruc;
Common::PPROCESS pProc; Common::PPROCESS pProc;
PINT_CONTEXT pic; INT_CONTEXT * pic;
CORO_END_CONTEXT(_ctx); CORO_END_CONTEXT(_ctx);
CORO_BEGIN_CODE(_ctx); CORO_BEGIN_CODE(_ctx);
@ -235,7 +235,7 @@ void KillGlobalProcesses() {
*/ */
bool GlobalProcessEvent(CORO_PARAM, uint32 procID, TINSEL_EVENT event, bool bWait, int myEscape) { bool GlobalProcessEvent(CORO_PARAM, uint32 procID, TINSEL_EVENT event, bool bWait, int myEscape) {
CORO_BEGIN_CONTEXT; CORO_BEGIN_CONTEXT;
PINT_CONTEXT pic; INT_CONTEXT *pic;
Common::PPROCESS pProc; Common::PPROCESS pProc;
CORO_END_CONTEXT(_ctx); CORO_END_CONTEXT(_ctx);

View file

@ -84,7 +84,7 @@ private:
int _leftScroll, _downScroll; // Number of iterations outstanding int _leftScroll, _downScroll; // Number of iterations outstanding
int _scrollActor; int _scrollActor;
PMOVER _pScrollMover; MOVER *_pScrollMover;
int _oldx, _oldy; int _oldx, _oldy;
/** Boundaries and numbers of boundaries */ /** Boundaries and numbers of boundaries */

View file

@ -392,7 +392,6 @@ struct SCROLL_MONITOR {
int thisScroll; int thisScroll;
int myEscape; int myEscape;
}; };
typedef SCROLL_MONITOR *PSCROLL_MONITOR;
/** /**
* Monitor a scrolling, allowing Escape to interrupt it * Monitor a scrolling, allowing Escape to interrupt it
@ -454,7 +453,7 @@ static int TextTime(char *pTstring) {
/** /**
* KeepOnScreen * KeepOnScreen
*/ */
void KeepOnScreen(POBJECT pText, int *pTextX, int *pTextY) { void KeepOnScreen(OBJECT * pText, int *pTextX, int *pTextY) {
int shift; int shift;
// Not off the left // Not off the left
@ -540,7 +539,7 @@ static void ActorAttr(int actor, int r1, int g1, int b1) {
* Behave as if actor has walked into a polygon with given brughtness. * Behave as if actor has walked into a polygon with given brughtness.
*/ */
void ActorBrightness(int actor, int brightness) { void ActorBrightness(int actor, int brightness) {
PMOVER pMover = GetMover(actor); MOVER *pMover = GetMover(actor);
assert(pMover != NULL); assert(pMover != NULL);
assert(brightness >= 0 && brightness <= 10); assert(brightness >= 0 && brightness <= 10);
@ -552,7 +551,7 @@ void ActorBrightness(int actor, int brightness) {
* Return a moving actor's current direction. * Return a moving actor's current direction.
*/ */
static int ActorDirection(int actor) { static int ActorDirection(int actor) {
PMOVER pMover = GetMover(actor); MOVER *pMover = GetMover(actor);
assert(pMover); assert(pMover);
return (int)GetMoverDirection(pMover); return (int)GetMoverDirection(pMover);
@ -562,7 +561,7 @@ static int ActorDirection(int actor) {
* Set actor's palette details for path brightnesses * Set actor's palette details for path brightnesses
*/ */
void ActorPalette(int actor, int startColor, int length) { void ActorPalette(int actor, int startColor, int length) {
PMOVER pMover = GetMover(actor); MOVER *pMover = GetMover(actor);
assert(pMover); assert(pMover);
StoreMoverPalette(pMover, startColor, length); StoreMoverPalette(pMover, startColor, length);
@ -586,7 +585,7 @@ static void ActorRGB(int actor, COLORREF color) {
* Return the actor's scale. * Return the actor's scale.
*/ */
static int ActorScale(int actor) { static int ActorScale(int actor) {
PMOVER pMover = GetMover(actor); MOVER *pMover = GetMover(actor);
assert(pMover); assert(pMover);
return (int)GetMoverScale(pMover); return (int)GetMoverScale(pMover);
@ -630,7 +629,7 @@ static void AddInv(int invno, int object) {
* Define an actor's walk and stand reels for an auxilliary scale. * Define an actor's walk and stand reels for an auxilliary scale.
*/ */
static void AuxScale(int actor, int scale, SCNHANDLE *rp) { static void AuxScale(int actor, int scale, SCNHANDLE *rp) {
PMOVER pMover = GetMover(actor); MOVER *pMover = GetMover(actor);
assert(pMover); assert(pMover);
int j; int j;
@ -694,7 +693,7 @@ void CdDoChange(CORO_PARAM) {
* CdEndActor("actor") * CdEndActor("actor")
*/ */
void CdEndActor(int actor, int myEscape) { void CdEndActor(int actor, int myEscape) {
PMOVER pMover; // for if it's a moving actor MOVER *pMover; // for if it's a moving actor
// Only do it if escaped! // Only do it if escaped!
if (myEscape && myEscape != GetEscEvents()) { if (myEscape && myEscape != GetEscEvents()) {
@ -998,7 +997,7 @@ static void DeclareLanguage(int languageId, SCNHANDLE hDescription, SCNHANDLE hF
* @param text Tag text (v1 only) * @param text Tag text (v1 only)
*/ */
static void DecLead(uint32 id, SCNHANDLE *rp = 0, SCNHANDLE text = 0) { static void DecLead(uint32 id, SCNHANDLE *rp = 0, SCNHANDLE text = 0) {
PMOVER pMover; // Moving actor structure MOVER *pMover; // Moving actor structure
if (TinselV2) { if (TinselV2) {
// Tinsel 2 only specifies the lead actor Id // Tinsel 2 only specifies the lead actor Id
@ -1044,7 +1043,7 @@ static void DecScale(int actor, int scale,
SCNHANDLE wkl, SCNHANDLE wkr, SCNHANDLE wkf, SCNHANDLE wka, SCNHANDLE wkl, SCNHANDLE wkr, SCNHANDLE wkf, SCNHANDLE wka,
SCNHANDLE stl, SCNHANDLE str, SCNHANDLE stf, SCNHANDLE sta, SCNHANDLE stl, SCNHANDLE str, SCNHANDLE stf, SCNHANDLE sta,
SCNHANDLE tal, SCNHANDLE tar, SCNHANDLE taf, SCNHANDLE taa) { SCNHANDLE tal, SCNHANDLE tar, SCNHANDLE taf, SCNHANDLE taa) {
PMOVER pMover = GetMover(actor); MOVER *pMover = GetMover(actor);
assert(pMover); assert(pMover);
SetWalkReels(pMover, scale, wkl, wkr, wkf, wka); SetWalkReels(pMover, scale, wkl, wkr, wkf, wka);
@ -1118,7 +1117,7 @@ static void EndActor(int actor) {
* If the actor is at the tag, do a StandTag(). * If the actor is at the tag, do a StandTag().
*/ */
static void FaceTag(int actor, HPOLYGON hp) { static void FaceTag(int actor, HPOLYGON hp) {
PMOVER pMover; // Moving actor structure MOVER *pMover; // Moving actor structure
int nowx, nowy; int nowx, nowy;
int nodex, nodey; int nodex, nodey;
@ -2905,7 +2904,7 @@ static void SPlay(CORO_PARAM, int sf, SCNHANDLE film, int x, int y, bool complet
*/ */
void Stand(CORO_PARAM, int actor, int x, int y, SCNHANDLE hFilm) { void Stand(CORO_PARAM, int actor, int x, int y, SCNHANDLE hFilm) {
CORO_BEGIN_CONTEXT; CORO_BEGIN_CONTEXT;
PMOVER pMover; // Moving actor structure MOVER *pMover; // Moving actor structure
CORO_END_CONTEXT(_ctx); CORO_END_CONTEXT(_ctx);
CORO_BEGIN_CODE(_ctx); CORO_BEGIN_CODE(_ctx);
@ -3080,7 +3079,7 @@ void StopSample(int sample) {
* Kill a moving actor's walk. * Kill a moving actor's walk.
*/ */
static void StopWalk(int actor) { static void StopWalk(int actor) {
PMOVER pMover; MOVER *pMover;
pMover = GetMover(actor); pMover = GetMover(actor);
assert(pMover); assert(pMover);
@ -3165,7 +3164,7 @@ static void Swalk(CORO_PARAM, int actor, int x1, int y1, int x2, int y2, SCNHAND
} }
if (TinselV2 && (zOverride != -1)) { if (TinselV2 && (zOverride != -1)) {
PMOVER pMover = GetMover(actor); MOVER *pMover = GetMover(actor);
assert(pMover); assert(pMover);
SetMoverZ(pMover, y1, zOverride); SetMoverZ(pMover, y1, zOverride);
@ -3222,7 +3221,7 @@ static int TagPos(MASTER_LIB_CODES operand, int tagno, HPOLYGON hp) {
/** /**
* Text goes over actor's head while actor plays the talk reel. * Text goes over actor's head while actor plays the talk reel.
*/ */
static void FinishTalkingReel(CORO_PARAM, PMOVER pMover, int actor) { static void FinishTalkingReel(CORO_PARAM, MOVER *pMover, int actor) {
CORO_BEGIN_CONTEXT; CORO_BEGIN_CONTEXT;
CORO_END_CONTEXT(_ctx); CORO_END_CONTEXT(_ctx);
@ -3244,7 +3243,7 @@ static void TalkOrSay(CORO_PARAM, SPEECH_TYPE speechType, SCNHANDLE hText, int x
CORO_BEGIN_CONTEXT; CORO_BEGIN_CONTEXT;
int Loffset, Toffset; // Top left of display int Loffset, Toffset; // Top left of display
int actor; // The speaking actor int actor; // The speaking actor
PMOVER pActor; // For moving actors MOVER *pActor; // For moving actors
int myLeftEvent; int myLeftEvent;
int escEvents; int escEvents;
int ticks; int ticks;
@ -3903,7 +3902,7 @@ void Walk(CORO_PARAM, int actor, int x, int y, SCNHANDLE hFilm, int hold, bool i
CORO_END_CONTEXT(_ctx); CORO_END_CONTEXT(_ctx);
bool bQuick = hold != 0; bool bQuick = hold != 0;
PMOVER pMover = GetMover(actor); MOVER *pMover = GetMover(actor);
assert(pMover); // Can't walk a non-moving actor assert(pMover); // Can't walk a non-moving actor
@ -3991,7 +3990,7 @@ static void Walked(CORO_PARAM, int actor, int x, int y, SCNHANDLE film, bool esc
int thisWalk; int thisWalk;
CORO_END_CONTEXT(_ctx); CORO_END_CONTEXT(_ctx);
PMOVER pMover = GetMover(actor); MOVER *pMover = GetMover(actor);
assert(pMover); // Can't walk a non-moving actor assert(pMover); // Can't walk a non-moving actor
CORO_BEGIN_CODE(_ctx); CORO_BEGIN_CODE(_ctx);
@ -4052,7 +4051,7 @@ static void Walked(CORO_PARAM, int actor, int x, int y, SCNHANDLE film, bool esc
* Declare a moving actor. * Declare a moving actor.
*/ */
static void WalkingActor(uint32 id, SCNHANDLE *rp = NULL) { static void WalkingActor(uint32 id, SCNHANDLE *rp = NULL) {
PMOVER pActor; // Moving actor structure MOVER *pActor; // Moving actor structure
if (TinselVersion == TINSEL_V2) { if (TinselVersion == TINSEL_V2) {
RegisterMover(id); RegisterMover(id);
@ -4094,7 +4093,7 @@ static void WalkPoly(CORO_PARAM, int actor, SCNHANDLE film, HPOLYGON hp, bool es
CORO_END_CONTEXT(_ctx); CORO_END_CONTEXT(_ctx);
assert(hp != NOPOLY); // WalkPoly() may only be called from a polygon code block assert(hp != NOPOLY); // WalkPoly() may only be called from a polygon code block
PMOVER pMover = GetMover(actor); MOVER *pMover = GetMover(actor);
assert(pMover); // Can't walk a non-moving actor assert(pMover); // Can't walk a non-moving actor
CORO_BEGIN_CODE(_ctx); CORO_BEGIN_CODE(_ctx);
@ -4152,7 +4151,7 @@ static void WalkTag(CORO_PARAM, int actor, SCNHANDLE film, HPOLYGON hp, bool esc
int thisWalk; int thisWalk;
CORO_END_CONTEXT(_ctx); CORO_END_CONTEXT(_ctx);
PMOVER pMover = GetMover(actor); MOVER *pMover = GetMover(actor);
assert(pMover); // Can't walk a non-moving actor assert(pMover); // Can't walk a non-moving actor
CORO_BEGIN_CODE(_ctx); CORO_BEGIN_CODE(_ctx);