From bc2ec5afdeb9be3cc35b4e45f21d783c79cf6709 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Wed, 23 Jul 2008 10:27:24 +0000 Subject: Got rid of some typedefs svn-id: r33235 --- engines/tinsel/actors.cpp | 2 +- engines/tinsel/actors.h | 3 +-- engines/tinsel/anim.cpp | 8 +++---- engines/tinsel/anim.h | 1 - engines/tinsel/background.cpp | 10 ++++----- engines/tinsel/background.h | 9 -------- engines/tinsel/handle.cpp | 2 +- engines/tinsel/heapmem.cpp | 50 +++++++++++++++++++++---------------------- engines/tinsel/heapmem.h | 21 +++++++++--------- 9 files changed, 47 insertions(+), 59 deletions(-) (limited to 'engines/tinsel') diff --git a/engines/tinsel/actors.cpp b/engines/tinsel/actors.cpp index e0689f1374..a385c26f6f 100644 --- a/engines/tinsel/actors.cpp +++ b/engines/tinsel/actors.cpp @@ -847,7 +847,7 @@ COLORREF getActorTcol(int ano) { /** * Store relevant information pertaining to currently existing actors. */ -int SaveActors(PSAVED_ACTOR sActorInfo) { +int SaveActors(SAVED_ACTOR *sActorInfo) { int i, j; for (i = 0, j = 0; i < NumActors; i++) { diff --git a/engines/tinsel/actors.h b/engines/tinsel/actors.h index 7707dd636d..91f54519d5 100644 --- a/engines/tinsel/actors.h +++ b/engines/tinsel/actors.h @@ -111,9 +111,8 @@ struct SAVED_ACTOR { short presRnum; //!< the present reel number short presX, presY; }; -typedef SAVED_ACTOR *PSAVED_ACTOR; -int SaveActors(PSAVED_ACTOR sActorInfo); +int SaveActors(SAVED_ACTOR *sActorInfo); void RestoreActorProcess(int id, INT_CONTEXT *pic); diff --git a/engines/tinsel/anim.cpp b/engines/tinsel/anim.cpp index 266c39bca8..95d834d88a 100644 --- a/engines/tinsel/anim.cpp +++ b/engines/tinsel/anim.cpp @@ -59,7 +59,7 @@ union ANI_SCRIPT { * Advance to next frame routine. * @param pAnim Animation data structure */ -SCRIPTSTATE DoNextFrame(PANIM pAnim) { +SCRIPTSTATE DoNextFrame(ANIM *pAnim) { // get a pointer to the script const ANI_SCRIPT *pAni = (const ANI_SCRIPT *)LockMem(pAnim->hScript); @@ -227,7 +227,7 @@ SCRIPTSTATE DoNextFrame(PANIM pAnim) { * @param hNewScript Script of multipart frames * @param aniSpeed Sets speed of animation in frames */ -void InitStepAnimScript(PANIM pAnim, OBJECT *pAniObj, SCNHANDLE hNewScript, int aniSpeed) { +void InitStepAnimScript(ANIM *pAnim, OBJECT *pAniObj, SCNHANDLE hNewScript, int aniSpeed) { OBJECT *pObj; // multi-object list iterator pAnim->aniDelta = 1; // will animate on next call to NextAnimRate @@ -247,7 +247,7 @@ void InitStepAnimScript(PANIM pAnim, OBJECT *pAniObj, SCNHANDLE hNewScript, int * Execute the next command in a animation script. * @param pAnim Animation data structure */ -SCRIPTSTATE StepAnimScript(PANIM pAnim) { +SCRIPTSTATE StepAnimScript(ANIM *pAnim) { SCRIPTSTATE state; if (--pAnim->aniDelta == 0) { @@ -270,7 +270,7 @@ SCRIPTSTATE StepAnimScript(PANIM pAnim) { * @param pAnim Animation data structure * @param numFrames Number of frames to skip */ -void SkipFrames(PANIM pAnim, int numFrames) { +void SkipFrames(ANIM *pAnim, int numFrames) { // get a pointer to the script const ANI_SCRIPT *pAni = (const ANI_SCRIPT *)LockMem(pAnim->hScript); diff --git a/engines/tinsel/anim.h b/engines/tinsel/anim.h index a6ac574350..5b25292a6b 100644 --- a/engines/tinsel/anim.h +++ b/engines/tinsel/anim.h @@ -41,7 +41,6 @@ struct ANIM { uint32 hScript; //!< animation script handle int scriptIndex; //!< current position in animation script }; -typedef ANIM *PANIM; /*----------------------------------------------------------------------*\ diff --git a/engines/tinsel/background.cpp b/engines/tinsel/background.cpp index 05d36e9412..6c586e11d9 100644 --- a/engines/tinsel/background.cpp +++ b/engines/tinsel/background.cpp @@ -50,7 +50,7 @@ bool bNoScroll; void InitBackground(BACKGND *pBgnd) { int i; // playfield counter - PPLAYFIELD pPlayfield; // pointer to current playfield + PLAYFIELD *pPlayfield; // pointer to current playfield // set current background pCurBgnd = pBgnd; @@ -87,7 +87,7 @@ void InitBackground(BACKGND *pBgnd) { */ void PlayfieldSetPos(int which, int newXpos, int newYpos) { - PPLAYFIELD pPlayfield; // pointer to relavent playfield + PLAYFIELD *pPlayfield; // pointer to relavent playfield // make sure there is a background assert(pCurBgnd != NULL); @@ -114,7 +114,7 @@ void PlayfieldSetPos(int which, int newXpos, int newYpos) { */ void PlayfieldGetPos(int which, int *pXpos, int *pYpos) { - PPLAYFIELD pPlayfield; // pointer to relavent playfield + PLAYFIELD *pPlayfield; // pointer to relavent playfield // make sure there is a background assert(pCurBgnd != NULL); @@ -136,7 +136,7 @@ void PlayfieldGetPos(int which, int *pXpos, int *pYpos) { */ OBJECT *GetPlayfieldList(int which) { - PPLAYFIELD pPlayfield; // pointer to relavent playfield + PLAYFIELD *pPlayfield; // pointer to relavent playfield // make sure there is a background assert(pCurBgnd != NULL); @@ -159,7 +159,7 @@ OBJECT *GetPlayfieldList(int which) { void DrawBackgnd(void) { int i; // playfield counter - PPLAYFIELD pPlay; // playfield pointer + PLAYFIELD *pPlay; // playfield pointer int prevX, prevY; // save interger part of position Common::Point ptWin; // window top left diff --git a/engines/tinsel/background.h b/engines/tinsel/background.h index 7409fd0785..f4b5c82e94 100644 --- a/engines/tinsel/background.h +++ b/engines/tinsel/background.h @@ -53,8 +53,6 @@ struct BLOCK { short blkHeight; //!< block height SCNHANDLE hBlkBits; //!< block bitmap handle }; -typedef BLOCK *PBLOCK; - /** structure to define position of blocks, which block and which palette */ struct BLK_INFO { @@ -65,8 +63,6 @@ struct BLK_INFO { uint8 byBlkPal; //!< which palette - index into "blkPals" for this block int32 blkIndex; //!< which block - index into "blocks" }; -typedef BLK_INFO *PBLK_INFO; - /** background module structure - a module is a container for blocks */ struct MODULE { @@ -78,8 +74,6 @@ struct MODULE { BLK_INFO *blkInfo; //!< pointer to array of which block goes where //!< NOTE: This array must be sorted on x position }; -typedef MODULE *PMODULE; - /** * background module node structure - links a playfields modules together @@ -92,8 +86,6 @@ struct MOD_NODE { char *onDispList; //!< pointer to modules (block on object list) flags - should alloc 1 byte per block Common::Point ptModPos; //!< module world start position }; -typedef MOD_NODE *PMOD_NODE; - /** background playfield structure - a playfield is a container for modules */ struct PLAYFIELD { @@ -106,7 +98,6 @@ struct PLAYFIELD { Common::Rect rcClip; //!< clip rectangle for this playfield bool bMoved; //!< set when playfield has moved }; -typedef PLAYFIELD *PPLAYFIELD; /** multi-playfield background structure - a backgnd is a container of playfields */ struct BACKGND { diff --git a/engines/tinsel/handle.cpp b/engines/tinsel/handle.cpp index 610f23012f..11623516ec 100644 --- a/engines/tinsel/handle.cpp +++ b/engines/tinsel/handle.cpp @@ -57,7 +57,7 @@ bool bLockedScene = 0; struct MEMHANDLE { char szName[12]; //!< 00 - file name of graphics file int32 filesize; //!< 12 - file size and flags - PMEM_NODE pNode; //!< 16 - memory node for the graphics + MEM_NODE *pNode; //!< 16 - memory node for the graphics }; diff --git a/engines/tinsel/heapmem.cpp b/engines/tinsel/heapmem.cpp index f3df3d4391..aff085d003 100644 --- a/engines/tinsel/heapmem.cpp +++ b/engines/tinsel/heapmem.cpp @@ -36,7 +36,7 @@ namespace Tinsel { MEM_NODE mnodeList[NUM_MNODES]; // pointer to the linked list of free mnodes -static PMEM_NODE pFreeMemNodes; +static MEM_NODE *pFreeMemNodes; #ifdef DEBUG // diagnostic mnode counters @@ -48,14 +48,14 @@ static int maxNodes; static MEM_NODE heapSentinel; // -static PMEM_NODE AllocMemNode(void); +static MEM_NODE *AllocMemNode(void); /** * Initialises the memory manager. */ void MemoryInit(void) { - PMEM_NODE pNode; + MEM_NODE *pNode; #ifdef DEBUG // clear number of nodes in use @@ -117,9 +117,9 @@ void MemoryStats(void) { /** * Allocate a mnode from the free list. */ -static PMEM_NODE AllocMemNode(void) { +static MEM_NODE *AllocMemNode(void) { // get the first free mnode - PMEM_NODE pMemNode = pFreeMemNodes; + MEM_NODE *pMemNode = pFreeMemNodes; // make sure a mnode is available assert(pMemNode); // Out of memory nodes @@ -144,7 +144,7 @@ static PMEM_NODE AllocMemNode(void) { * Return a mnode back to the free list. * @param pMemNode Node of the memory object */ -void FreeMemNode(PMEM_NODE pMemNode) { +void FreeMemNode(MEM_NODE *pMemNode) { // validate mnode pointer assert(pMemNode >= mnodeList && pMemNode <= mnodeList + NUM_MNODES - 1); @@ -168,8 +168,8 @@ void FreeMemNode(PMEM_NODE pMemNode) { * @param bDiscard When set - will discard blocks to fullfill the request */ bool HeapCompact(long size, bool bDiscard) { - PMEM_NODE pHeap = &heapSentinel; - PMEM_NODE pPrev, pCur, pOldest; + MEM_NODE *pHeap = &heapSentinel; + MEM_NODE *pPrev, *pCur, *pOldest; long largest; // size of largest free block uint32 oldest; // time of the oldest discardable block @@ -268,9 +268,9 @@ bool HeapCompact(long size, bool bDiscard) { * @param flags Allocation attributes * @param size Number of bytes to allocate */ -PMEM_NODE MemoryAlloc(int flags, long size) { - PMEM_NODE pHeap = &heapSentinel; - PMEM_NODE pNode; +MEM_NODE *MemoryAlloc(int flags, long size) { + MEM_NODE *pHeap = &heapSentinel; + MEM_NODE *pNode; bool bCompacted = true; // set when heap has been compacted // compact the heap if we are allocating fixed memory @@ -297,13 +297,13 @@ PMEM_NODE MemoryAlloc(int flags, long size) { if (flags & DWM_FIXED) // lock the memory - return (PMEM_NODE)MemoryLock(pNode); + return (MEM_NODE *)MemoryLock(pNode); else // just return the node return pNode; } else { // allocate a node for the remainder of the free block - PMEM_NODE pTemp = AllocMemNode(); + MEM_NODE *pTemp = AllocMemNode(); // calc size of the free block long freeSize = pNode->size - size; @@ -326,7 +326,7 @@ PMEM_NODE MemoryAlloc(int flags, long size) { if (flags & DWM_ZEROINIT) memset(pNode->pBaseAddr, 0, size); - return (PMEM_NODE)MemoryLock(pNode); + return (MEM_NODE *)MemoryLock(pNode); } else { // place the free node before pNode pTemp->pBaseAddr = pNode->pBaseAddr; @@ -375,7 +375,7 @@ PMEM_NODE MemoryAlloc(int flags, long size) { * Discards the specified memory object. * @param pMemNode Node of the memory object */ -void MemoryDiscard(PMEM_NODE pMemNode) { +void MemoryDiscard(MEM_NODE *pMemNode) { // validate mnode pointer assert(pMemNode >= mnodeList && pMemNode <= mnodeList + NUM_MNODES - 1); @@ -387,7 +387,7 @@ void MemoryDiscard(PMEM_NODE pMemNode) { if ((pMemNode->flags & DWM_DISCARDED) == 0) { // allocate a free node to replace this node - PMEM_NODE pTemp = AllocMemNode(); + MEM_NODE *pTemp = AllocMemNode(); // copy node data memcpy(pTemp, pMemNode, sizeof(MEM_NODE)); @@ -423,8 +423,8 @@ void MemoryDiscard(PMEM_NODE pMemNode) { * Frees the specified memory object and invalidates its node. * @param pMemNode Node of the memory object */ -void MemoryFree(PMEM_NODE pMemNode) { - PMEM_NODE pPrev, pNext; +void MemoryFree(MEM_NODE *pMemNode) { + MEM_NODE *pPrev, *pNext; // validate mnode pointer assert(pMemNode >= mnodeList && pMemNode <= mnodeList + NUM_MNODES - 1); @@ -469,7 +469,7 @@ void MemoryFree(PMEM_NODE pMemNode) { * of the objects memory block. * @param pMemNode Node of the memory object */ -void *MemoryLock(PMEM_NODE pMemNode) { +void *MemoryLock(MEM_NODE *pMemNode) { // validate mnode pointer assert(pMemNode >= mnodeList && pMemNode <= mnodeList + NUM_MNODES - 1); @@ -493,8 +493,8 @@ void *MemoryLock(PMEM_NODE pMemNode) { * @param size New size of block * @param flags How to reallocate the object */ -PMEM_NODE MemoryReAlloc(PMEM_NODE pMemNode, long size, int flags) { - PMEM_NODE pNew; +MEM_NODE *MemoryReAlloc(MEM_NODE *pMemNode, long size, int flags) { + MEM_NODE *pNew; // validate mnode pointer assert(pMemNode >= mnodeList && pMemNode <= mnodeList + NUM_MNODES - 1); @@ -550,7 +550,7 @@ PMEM_NODE MemoryReAlloc(PMEM_NODE pMemNode, long size, int flags) { if (flags & DWM_FIXED) // lock the memory - return (PMEM_NODE)MemoryLock(pMemNode); + return (MEM_NODE *)MemoryLock(pMemNode); else // just return the node return pMemNode; @@ -560,7 +560,7 @@ PMEM_NODE MemoryReAlloc(PMEM_NODE pMemNode, long size, int flags) { * Unlocks a memory object. * @param pMemNode Node of the memory object */ -void MemoryUnlock(PMEM_NODE pMemNode) { +void MemoryUnlock(MEM_NODE *pMemNode) { // validate mnode pointer assert(pMemNode >= mnodeList && pMemNode <= mnodeList + NUM_MNODES - 1); @@ -578,8 +578,8 @@ void MemoryUnlock(PMEM_NODE pMemNode) { * Retrieves the mnode associated with the specified pointer to a memory object. * @param pMem Address of memory object */ -PMEM_NODE MemoryHandle(void *pMem) { - PMEM_NODE pNode; +MEM_NODE *MemoryHandle(void *pMem) { + MEM_NODE *pNode; // search the DOS heap for (pNode = heapSentinel.pNext; pNode != &heapSentinel; pNode = pNode->pNext) { if (pNode->pBaseAddr == pMem) diff --git a/engines/tinsel/heapmem.h b/engines/tinsel/heapmem.h index c5d022b7f9..7fb85985a9 100644 --- a/engines/tinsel/heapmem.h +++ b/engines/tinsel/heapmem.h @@ -41,7 +41,6 @@ struct MEM_NODE { uint32 lruTime; // time when memory object was last accessed int flags; // allocation attributes }; -typedef MEM_NODE *PMEM_NODE; // allocation flags for the MemoryAlloc function #define DWM_FIXED 0x0001 // allocates fixed memory @@ -71,35 +70,35 @@ void MemoryInit(void); // initialises the memory manager void MemoryStats(void); // Shows the maximum number of mnodes used at once #endif -PMEM_NODE MemoryAlloc( // allocates the specified number of bytes from the heap +MEM_NODE *MemoryAlloc( // allocates the specified number of bytes from the heap int flags, // allocation attributes long size); // number of bytes to allocate void MemoryDiscard( // discards the specified memory object - PMEM_NODE pMemNode); // node of the memory object + MEM_NODE *pMemNode); // node of the memory object int MemoryFlags( // returns information about the specified memory object - PMEM_NODE pMemNode); // node of the memory object + MEM_NODE *pMemNode); // node of the memory object void MemoryFree( // frees the specified memory object and invalidates its node - PMEM_NODE pMemNode); // node of the memory object + MEM_NODE *pMemNode); // node of the memory object -PMEM_NODE MemoryHandle( // Retrieves the mnode associated with the specified pointer to a memory object +MEM_NODE *MemoryHandle( // Retrieves the mnode associated with the specified pointer to a memory object void *pMem); // address of memory object void *MemoryLock( // locks a memory object and returns a pointer to the first byte of the objects memory block - PMEM_NODE pMemNode); // node of the memory object + MEM_NODE *pMemNode); // node of the memory object -PMEM_NODE MemoryReAlloc( // changes the size or attributes of a specified memory object - PMEM_NODE pMemNode, // node of the memory object +MEM_NODE *MemoryReAlloc( // changes the size or attributes of a specified memory object + MEM_NODE *pMemNode, // node of the memory object long size, // new size of block int flags); // how to reallocate the object long MemorySize( // returns the size, in bytes, of the specified memory object - PMEM_NODE pMemNode); // node of the memory object + MEM_NODE *pMemNode); // node of the memory object void MemoryUnlock( // unlocks a memory object - PMEM_NODE pMemNode); // node of the memory object + MEM_NODE *pMemNode); // node of the memory object bool HeapCompact( // Allocates the specified number of bytes from the specified heap long size, // number of bytes to free up -- cgit v1.2.3