[Scummvm-cvs-logs] SF.net SVN: scummvm:[33249] scummvm/trunk/engines/tinsel
fingolfin at users.sourceforge.net
fingolfin at users.sourceforge.net
Wed Jul 23 18:55:53 CEST 2008
Revision: 33249
http://scummvm.svn.sourceforge.net/scummvm/?rev=33249&view=rev
Author: fingolfin
Date: 2008-07-23 16:55:52 +0000 (Wed, 23 Jul 2008)
Log Message:
-----------
TINSEL: Renamed CoroutineInstall back to ProcessCreate; got rid of yet another typedef; more cleanup
Modified Paths:
--------------
scummvm/trunk/engines/tinsel/actors.cpp
scummvm/trunk/engines/tinsel/bg.cpp
scummvm/trunk/engines/tinsel/effect.cpp
scummvm/trunk/engines/tinsel/events.cpp
scummvm/trunk/engines/tinsel/faders.cpp
scummvm/trunk/engines/tinsel/inventory.cpp
scummvm/trunk/engines/tinsel/object.cpp
scummvm/trunk/engines/tinsel/palette.cpp
scummvm/trunk/engines/tinsel/palette.h
scummvm/trunk/engines/tinsel/play.cpp
scummvm/trunk/engines/tinsel/rince.cpp
scummvm/trunk/engines/tinsel/scene.cpp
scummvm/trunk/engines/tinsel/sched.cpp
scummvm/trunk/engines/tinsel/sched.h
scummvm/trunk/engines/tinsel/tinsel.cpp
Modified: scummvm/trunk/engines/tinsel/actors.cpp
===================================================================
--- scummvm/trunk/engines/tinsel/actors.cpp 2008-07-23 16:49:45 UTC (rev 33248)
+++ scummvm/trunk/engines/tinsel/actors.cpp 2008-07-23 16:55:52 UTC (rev 33249)
@@ -230,7 +230,7 @@
void RestoreActorProcess(int id, PINT_CONTEXT pic) {
RATP_INIT r = { pic, id };
- CoroutineInstall(PID_TCODE, ActorRestoredProcess, &r, sizeof(r));
+ ProcessCreate(PID_TCODE, ActorRestoredProcess, &r, sizeof(r));
}
/**
@@ -247,7 +247,7 @@
atp.id = ano;
atp.event = event;
atp.bev = be;
- CoroutineInstall(PID_TCODE, ActorTinselProcess, &atp, sizeof(atp));
+ ProcessCreate(PID_TCODE, ActorTinselProcess, &atp, sizeof(atp));
}
}
Modified: scummvm/trunk/engines/tinsel/bg.cpp
===================================================================
--- scummvm/trunk/engines/tinsel/bg.cpp 2008-07-23 16:49:45 UTC (rev 33248)
+++ scummvm/trunk/engines/tinsel/bg.cpp 2008-07-23 16:55:52 UTC (rev 33249)
@@ -176,7 +176,7 @@
// Start display process for each reel in the film
assert(FROM_LE_32(pfilm->numreels) == 1); // Multi-reeled backgrounds withdrawn
- CoroutineInstall(PID_REEL, BGmainProcess, &pfilm->reels[0], sizeof(FREEL));
+ ProcessCreate(PID_REEL, BGmainProcess, &pfilm->reels[0], sizeof(FREEL));
}
/**
Modified: scummvm/trunk/engines/tinsel/effect.cpp
===================================================================
--- scummvm/trunk/engines/tinsel/effect.cpp 2008-07-23 16:49:45 UTC (rev 33248)
+++ scummvm/trunk/engines/tinsel/effect.cpp 2008-07-23 16:55:52 UTC (rev 33249)
@@ -102,7 +102,7 @@
epi.hEpoly = hPoly;
epi.pActor = pActor;
epi.index = index;
- CoroutineInstall(PID_TCODE, EffectProcess, &epi, sizeof(epi));
+ ProcessCreate(PID_TCODE, EffectProcess, &epi, sizeof(epi));
}
}
}
Modified: scummvm/trunk/engines/tinsel/events.cpp
===================================================================
--- scummvm/trunk/engines/tinsel/events.cpp 2008-07-23 16:49:45 UTC (rev 33248)
+++ scummvm/trunk/engines/tinsel/events.cpp 2008-07-23 16:55:52 UTC (rev 33249)
@@ -184,13 +184,13 @@
void RunPolyTinselCode(HPOLYGON hPoly, USER_EVENT event, BUTEVENT be, bool tc) {
TP_INIT to = { hPoly, event, be, tc, 0 };
- CoroutineInstall(PID_TCODE, PolyTinselProcess, &to, sizeof(to));
+ ProcessCreate(PID_TCODE, PolyTinselProcess, &to, sizeof(to));
}
void effRunPolyTinselCode(HPOLYGON hPoly, USER_EVENT event, int actor) {
TP_INIT to = { hPoly, event, BE_NONE, false, actor };
- CoroutineInstall(PID_TCODE, PolyTinselProcess, &to, sizeof(to));
+ ProcessCreate(PID_TCODE, PolyTinselProcess, &to, sizeof(to));
}
//-----------------------------------------------------------------------
@@ -233,7 +233,7 @@
void walkto(int x, int y) {
WP_INIT to = { x, y };
- CoroutineInstall(PID_TCODE, WalkProcess, &to, sizeof(to));
+ ProcessCreate(PID_TCODE, WalkProcess, &to, sizeof(to));
}
/**
Modified: scummvm/trunk/engines/tinsel/faders.cpp
===================================================================
--- scummvm/trunk/engines/tinsel/faders.cpp 2008-07-23 16:49:45 UTC (rev 33248)
+++ scummvm/trunk/engines/tinsel/faders.cpp 2008-07-23 16:55:52 UTC (rev 33249)
@@ -35,7 +35,7 @@
/** structure used by the "FadeProcess" process */
struct FADE {
const long *pColourMultTable; // list of fixed point colour multipliers - terminated with negative entry
- PPALQ pPalQ; // palette queue entry to fade
+ PALQ *pPalQ; // palette queue entry to fade
};
// fixed point fade multiplier tables
@@ -120,7 +120,7 @@
* @param noFadeTable List of palettes not to fade
*/
static void Fader(const long multTable[], SCNHANDLE noFadeTable[]) {
- PPALQ pPal; // palette manager iterator
+ PALQ *pPal; // palette manager iterator
// create a process for each palette in the palette queue
for (pPal = GetNextPalette(NULL); pPal != NULL; pPal = GetNextPalette(pPal)) {
@@ -149,7 +149,7 @@
fade.pPalQ = pPal;
// create a fader process for this palette
- CoroutineInstall(PID_FADER, FadeProcess, (void *)&fade, sizeof(FADE));
+ ProcessCreate(PID_FADER, FadeProcess, (void *)&fade, sizeof(FADE));
}
}
}
Modified: scummvm/trunk/engines/tinsel/inventory.cpp
===================================================================
--- scummvm/trunk/engines/tinsel/inventory.cpp 2008-07-23 16:49:45 UTC (rev 33248)
+++ scummvm/trunk/engines/tinsel/inventory.cpp 2008-07-23 16:55:52 UTC (rev 33249)
@@ -980,7 +980,7 @@
return;
GlitterIndex = index;
- CoroutineInstall(PID_TCODE, InvTinselProcess, &to, sizeof(to));
+ ProcessCreate(PID_TCODE, InvTinselProcess, &to, sizeof(to));
}
/**************************************************************************/
@@ -3938,7 +3938,7 @@
else if (!(invObj->attribute & IO_ONLYINV1 && ino !=INV_1)
&& !(invObj->attribute & IO_ONLYINV2 && ino !=INV_2))
- CoroutineInstall(PID_TCODE, InvPdProcess, &index, sizeof(index));
+ ProcessCreate(PID_TCODE, InvPdProcess, &index, sizeof(index));
}
}
}
Modified: scummvm/trunk/engines/tinsel/object.cpp
===================================================================
--- scummvm/trunk/engines/tinsel/object.cpp 2008-07-23 16:49:45 UTC (rev 33248)
+++ scummvm/trunk/engines/tinsel/object.cpp 2008-07-23 16:55:52 UTC (rev 33249)
@@ -365,7 +365,7 @@
// get pointer to image
if (pInitTbl->hObjImg) {
int aniX, aniY; // objects animation offsets
- PPALQ pPalQ; // palette queue pointer
+ PALQ *pPalQ; // palette queue pointer
const IMAGE *pImg = (const IMAGE *)LockMem(pInitTbl->hObjImg); // handle to image
// allocate a palette for this object
@@ -477,7 +477,7 @@
OBJECT *RectangleObject(SCNHANDLE hPal, int colour, int width, int height) {
// template for initialising the rectangle object
static const OBJ_INIT rectObj = {0, DMA_CONST, OID_EFFECTS, 0, 0, 0};
- PPALQ pPalQ; // palette queue pointer
+ PALQ *pPalQ; // palette queue pointer
// allocate and init a new object
OBJECT *pRect = InitObject(&rectObj);
Modified: scummvm/trunk/engines/tinsel/palette.cpp
===================================================================
--- scummvm/trunk/engines/tinsel/palette.cpp 2008-07-23 16:49:45 UTC (rev 33248)
+++ scummvm/trunk/engines/tinsel/palette.cpp 2008-07-23 16:55:52 UTC (rev 33249)
@@ -34,6 +34,22 @@
namespace Tinsel {
+//----------------- LOCAL DEFINES --------------------
+
+/** video DAC transfer Q structure */
+struct VIDEO_DAC_Q {
+ union {
+ SCNHANDLE hRGBarray; //!< handle of palette or
+ COLORREF *pRGBarray; //!< list of palette colours
+ } pal;
+ bool bHandle; //!< when set - use handle of palette
+ int destDACindex; //!< start index of palette in video DAC
+ int numColours; //!< number of colours in "hRGBarray"
+};
+
+
+//----------------- LOCAL GLOBAL DATA --------------------
+
/** background colour */
static COLORREF bgndColour = BLACK;
@@ -67,8 +83,8 @@
* Transfer palettes in the palette Q to Video DAC.
*/
void PalettesToVideoDAC(void) {
- PPALQ pPalQ; // palette Q iterator
- PVIDEO_DAC_Q pDACtail = vidDACdata; // set tail pointer
+ PALQ *pPalQ; // palette Q iterator
+ VIDEO_DAC_Q *pDACtail = vidDACdata; // set tail pointer
bool needUpdate = false;
// while Q is not empty
@@ -198,10 +214,10 @@
* Allocate a palette.
* @param hNewPal Palette to allocate
*/
-PPALQ AllocPalette(SCNHANDLE hNewPal) {
- PPALQ pPrev, p; // walks palAllocData
+PALQ *AllocPalette(SCNHANDLE hNewPal) {
+ PALQ *pPrev, *p; // walks palAllocData
int iDAC; // colour index in video DAC
- PPALQ pNxtPal; // next PALQ struct in palette allocator
+ PALQ *pNxtPal; // next PALQ struct in palette allocator
PALETTE *pNewPal;
// get pointer to new palette
@@ -274,7 +290,7 @@
* Free a palette allocated with "AllocPalette".
* @param pFreePal Palette queue entry to free
*/
-void FreePalette(PPALQ pFreePal) {
+void FreePalette(PALQ *pFreePal) {
// validate palette Q pointer
assert(pFreePal >= palAllocData && pFreePal <= palAllocData + NUM_PALETTES - 1);
@@ -299,8 +315,8 @@
* Find the specified palette.
* @param hSrchPal Hardware palette to search for
*/
-PPALQ FindPalette(SCNHANDLE hSrchPal) {
- PPALQ pPal; // palette allocator iterator
+PALQ *FindPalette(SCNHANDLE hSrchPal) {
+ PALQ *pPal; // palette allocator iterator
// search all structs in palette allocator
for (pPal = palAllocData; pPal < palAllocData + NUM_PALETTES; pPal++) {
@@ -318,7 +334,7 @@
* @param pPalQ Palette queue position
* @param hNewPal New palette
*/
-void SwapPalette(PPALQ pPalQ, SCNHANDLE hNewPal) {
+void SwapPalette(PALQ *pPalQ, SCNHANDLE hNewPal) {
// convert handle to palette pointer
PALETTE *pNewPal = (PALETTE *)LockMem(hNewPal);
@@ -336,7 +352,7 @@
} else {
// # colours are different - will have to update all following palette entries
- PPALQ pNxtPalQ; // next palette queue position
+ PALQ *pNxtPalQ; // next palette queue position
for (pNxtPalQ = pPalQ + 1; pNxtPalQ < palAllocData + NUM_PALETTES; pNxtPalQ++) {
if (pNxtPalQ->posInDAC >= pPalQ->posInDAC + pPalQ->numColours)
@@ -362,7 +378,7 @@
* Statless palette iterator. Returns the next palette in the list
* @param pStrtPal Palette to start from - when NULL will start from beginning of list
*/
-PPALQ GetNextPalette(PPALQ pStrtPal) {
+PALQ *GetNextPalette(PALQ *pStrtPal) {
if (pStrtPal == NULL) {
// start of palette iteration - return 1st palette
return (palAllocData[0].objCount) ? palAllocData : NULL;
Modified: scummvm/trunk/engines/tinsel/palette.h
===================================================================
--- scummvm/trunk/engines/tinsel/palette.h 2008-07-23 16:49:45 UTC (rev 33248)
+++ scummvm/trunk/engines/tinsel/palette.h 2008-07-23 16:55:52 UTC (rev 33249)
@@ -67,18 +67,6 @@
#define CYAN (RGB(0, MAX_INTENSITY, MAX_INTENSITY))
-/** video DAC transfer Q structure */
-struct VIDEO_DAC_Q {
- union {
- SCNHANDLE hRGBarray; //!< handle of palette or
- COLORREF *pRGBarray; //!< list of palette colours
- } pal;
- bool bHandle; //!< when set - use handle of palette
- int destDACindex; //!< start index of palette in video DAC
- int numColours; //!< number of colours in "hRGBarray"
-};
-typedef VIDEO_DAC_Q *PVIDEO_DAC_Q;
-
#include "common/pack-start.h" // START STRUCT PACKING
/** hardware palette structure */
@@ -97,7 +85,6 @@
int posInDAC; //!< palette position in the video DAC
int numColours; //!< number of colours in the palette
};
-typedef PALQ *PPALQ;
#define PALETTE_MOVED 0x8000 // when this bit is set in the "posInDAC"
@@ -129,21 +116,21 @@
int numColours, // number of colours in palette
COLORREF *pColours); // list of RGB tripples
-PPALQ AllocPalette( // allocate a new palette
+PALQ *AllocPalette( // allocate a new palette
SCNHANDLE hNewPal); // palette to allocate
void FreePalette( // free a palette allocated with "AllocPalette"
- PPALQ pFreePal); // palette queue entry to free
+ PALQ *pFreePal); // palette queue entry to free
-PPALQ FindPalette( // find a palette in the palette queue
+PALQ *FindPalette( // find a palette in the palette queue
SCNHANDLE hSrchPal); // palette to search for
void SwapPalette( // swaps palettes at the specified palette queue position
- PPALQ pPalQ, // palette queue position
+ PALQ *pPalQ, // palette queue position
SCNHANDLE hNewPal); // new palette
-PPALQ GetNextPalette( // returns the next palette in the queue
- PPALQ pStrtPal); // queue position to start from - when NULL will start from beginning of queue
+PALQ *GetNextPalette( // returns the next palette in the queue
+ PALQ *pStrtPal); // queue position to start from - when NULL will start from beginning of queue
COLORREF GetBgndColour(void); // returns current background colour
Modified: scummvm/trunk/engines/tinsel/play.cpp
===================================================================
--- scummvm/trunk/engines/tinsel/play.cpp 2008-07-23 16:49:45 UTC (rev 33248)
+++ scummvm/trunk/engines/tinsel/play.cpp 2008-07-23 16:55:52 UTC (rev 33249)
@@ -417,7 +417,7 @@
newestFilm(film, &pfilm->reels[i]);
ppi.column = i;
- CoroutineInstall(PID_REEL, playProcess, &ppi, sizeof(ppi));
+ ProcessCreate(PID_REEL, playProcess, &ppi, sizeof(ppi));
}
}
@@ -459,7 +459,7 @@
newestFilm(film, &pfilm->reels[i]);
_ctx->ppi.column = i;
- CoroutineInstall(PID_REEL, playProcess, &_ctx->ppi, sizeof(PPINIT));
+ ProcessCreate(PID_REEL, playProcess, &_ctx->ppi, sizeof(PPINIT));
}
newestFilm(film, &pfilm->reels[0]);
@@ -501,7 +501,7 @@
newestFilm(film, &pfilm->reels[reelnum]);
// Start display process for the reel
- CoroutineInstall(PID_REEL, playProcess, &ppi, sizeof(ppi));
+ ProcessCreate(PID_REEL, playProcess, &ppi, sizeof(ppi));
}
} // end of namespace Tinsel
Modified: scummvm/trunk/engines/tinsel/rince.cpp
===================================================================
--- scummvm/trunk/engines/tinsel/rince.cpp 2008-07-23 16:49:45 UTC (rev 33248)
+++ scummvm/trunk/engines/tinsel/rince.cpp 2008-07-23 16:55:52 UTC (rev 33249)
@@ -633,7 +633,7 @@
void MActorProcessCreate(int X, int Y, int id, PMACTOR pActor) {
MActorProcessHelper(X, Y, id, pActor);
- pActor->pProc = CoroutineInstall(PID_MACTOR, MActorProcess, &pActor, sizeof(PMACTOR));
+ pActor->pProc = ProcessCreate(PID_MACTOR, MActorProcess, &pActor, sizeof(PMACTOR));
}
Modified: scummvm/trunk/engines/tinsel/scene.cpp
===================================================================
--- scummvm/trunk/engines/tinsel/scene.cpp 2008-07-23 16:49:45 UTC (rev 33248)
+++ scummvm/trunk/engines/tinsel/scene.cpp 2008-07-23 16:55:52 UTC (rev 33249)
@@ -154,7 +154,7 @@
for (i = 0; i < FROM_LE_32(ss->numEntrance); i++, es++) {
if (FROM_LE_32(es->eNumber) == (uint)entry) {
if (es->hScript)
- CoroutineInstall(PID_TCODE, SceneTinselProcess, &es->hScript, sizeof(es->hScript));
+ ProcessCreate(PID_TCODE, SceneTinselProcess, &es->hScript, sizeof(es->hScript));
break;
}
}
@@ -163,7 +163,7 @@
error("Non-existant scene entry number");
if (ss->hSceneScript)
- CoroutineInstall(PID_TCODE, SceneTinselProcess, &ss->hSceneScript, sizeof(ss->hSceneScript));
+ ProcessCreate(PID_TCODE, SceneTinselProcess, &ss->hSceneScript, sizeof(ss->hSceneScript));
}
// Default refer type
@@ -257,16 +257,16 @@
RestartCursor(); // Restart the cursor
EnableTags(); // Next scene with tags enabled
- CoroutineInstall(PID_SCROLL, ScrollProcess, NULL, 0);
- CoroutineInstall(PID_SCROLL, EffectPolyProcess, NULL, 0);
+ ProcessCreate(PID_SCROLL, ScrollProcess, NULL, 0);
+ ProcessCreate(PID_SCROLL, EffectPolyProcess, NULL, 0);
#ifdef DEBUG
if (ShowPosition)
- CoroutineInstall(PID_POSITION, CursorPositionProcess, NULL, 0);
+ ProcessCreate(PID_POSITION, CursorPositionProcess, NULL, 0);
#endif
- CoroutineInstall(PID_TAG, TagProcess, NULL, 0);
- CoroutineInstall(PID_TAG, PointProcess, NULL, 0);
+ ProcessCreate(PID_TAG, TagProcess, NULL, 0);
+ ProcessCreate(PID_TAG, PointProcess, NULL, 0);
// init the current background
PrimeBackground();
Modified: scummvm/trunk/engines/tinsel/sched.cpp
===================================================================
--- scummvm/trunk/engines/tinsel/sched.cpp 2008-07-23 16:49:45 UTC (rev 33248)
+++ scummvm/trunk/engines/tinsel/sched.cpp 2008-07-23 16:55:52 UTC (rev 33249)
@@ -147,7 +147,7 @@
* @param pParam process specific info
* @param sizeParam size of process specific info
*/
-PROCESS *CoroutineInstall(int pid, CORO_ADDR coroAddr, const void *pParam, int sizeParam) {
+PROCESS *ProcessCreate(int pid, CORO_ADDR coroAddr, const void *pParam, int sizeParam) {
PROCESS *pProc;
// get a free process
Modified: scummvm/trunk/engines/tinsel/sched.h
===================================================================
--- scummvm/trunk/engines/tinsel/sched.h 2008-07-23 16:49:45 UTC (rev 33248)
+++ scummvm/trunk/engines/tinsel/sched.h 2008-07-23 16:55:52 UTC (rev 33249)
@@ -69,7 +69,7 @@
void Scheduler(void); // called to start process dispatching
-PROCESS *CoroutineInstall(int pid, CORO_ADDR coroAddr, const void *pParam, int sizeParam);
+PROCESS *ProcessCreate(int pid, CORO_ADDR coroAddr, const void *pParam, int sizeParam);
void ProcessKill( // kill a process
PROCESS *pKillProc); // which process to kill (must be different from current one)
Modified: scummvm/trunk/engines/tinsel/tinsel.cpp
===================================================================
--- scummvm/trunk/engines/tinsel/tinsel.cpp 2008-07-23 16:49:45 UTC (rev 33248)
+++ scummvm/trunk/engines/tinsel/tinsel.cpp 2008-07-23 16:55:52 UTC (rev 33249)
@@ -386,8 +386,8 @@
void EventsInstall(void) {
lastLeftClick = lastRightClick = DwGetCurrentTime();
- pMouseProcess = CoroutineInstall(PID_MOUSE, MouseProcess, NULL, 0);
- pKeyboardProcess = CoroutineInstall(PID_KEYBOARD, KeyboardProcess, NULL, 0);
+ pMouseProcess = ProcessCreate(PID_MOUSE, MouseProcess, NULL, 0);
+ pKeyboardProcess = ProcessCreate(PID_KEYBOARD, KeyboardProcess, NULL, 0);
}
/**
@@ -498,11 +498,11 @@
}
void RestoreProcess(PINT_CONTEXT pic) {
- CoroutineInstall(PID_TCODE, RestoredProcess, &pic, sizeof(pic));
+ ProcessCreate(PID_TCODE, RestoredProcess, &pic, sizeof(pic));
}
void RestoreMasterProcess(PINT_CONTEXT pic) {
- CoroutineInstall(PID_MASTER_SCR, RestoredProcess, &pic, sizeof(pic));
+ ProcessCreate(PID_MASTER_SCR, RestoredProcess, &pic, sizeof(pic));
}
// FIXME: CountOut is used by ChangeScene
@@ -868,11 +868,11 @@
void TinselEngine::CreateConstProcesses(void) {
// Process to run the master script
- CoroutineInstall(PID_MASTER_SCR, MasterScriptProcess, NULL, 0);
+ ProcessCreate(PID_MASTER_SCR, MasterScriptProcess, NULL, 0);
// Processes to run the cursor and inventory,
- CoroutineInstall(PID_CURSOR, CursorProcess, NULL, 0);
- CoroutineInstall(PID_INVENTORY, InventoryProcess, NULL, 0);
+ ProcessCreate(PID_CURSOR, CursorProcess, NULL, 0);
+ ProcessCreate(PID_INVENTORY, InventoryProcess, NULL, 0);
}
/**
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list