Skip to content

Commit

Permalink
TONY: Some formatting fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
dreammaster committed May 4, 2012
1 parent 5498f9a commit 9482eac
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 44 deletions.
5 changes: 1 addition & 4 deletions engines/tony/gfxcore.cpp
Expand Up @@ -45,14 +45,11 @@
* *
**************************************************************************/

#include "tony/gfxEngine.h"
#include "tony/gfxengine.h"
#include "tony/mpal/mpalutils.h"

namespace Tony {

static char rcsid[] = "$Id: $";


/****************************************************************************\
* Metodi di RMGfxTask
\****************************************************************************/
Expand Down
4 changes: 2 additions & 2 deletions engines/tony/gfxengine.cpp
Expand Up @@ -49,7 +49,7 @@
#include "tony/mpal/lzo.h"
#include "tony/mpal/mpalutils.h"
#include "tony/custom.h"
#include "tony/gfxEngine.h"
#include "tony/gfxengine.h"
#include "tony/tony.h"

namespace Tony {
Expand Down Expand Up @@ -934,7 +934,7 @@ void RMGfxEngine::LoadState(const char *fn) {

// Le versioni vecchie necessitano di On enter
if (ver < 5)
mpalQueryDoAction(0,loc,0);
mpalQueryDoAction(0, loc, 0);
else {
// In quelle nuove, ci basta resettare gli mcode
MCharResetCodes();
Expand Down
2 changes: 0 additions & 2 deletions engines/tony/loc.cpp
Expand Up @@ -55,8 +55,6 @@ namespace Tony {

using namespace ::Tony::MPAL;

static char rcsid[] = "$Id: $";

extern bool bSkipSfxNoLoop;


Expand Down
70 changes: 35 additions & 35 deletions engines/tony/mpal/mpal.cpp
Expand Up @@ -868,9 +868,9 @@ void PASCAL ScriptThread(LPMPALSCRIPT s) {
// Dorme il tempo necessario per arrivare al momento successivo
if (s->Moment[i].dwTime==-1) {
WaitForMultipleObjects(numHandles,cfHandles,true,INFINITE);
dwStartTime=timeGetTime();
dwStartTime = timeGetTime();
} else {
dwCurTime=timeGetTime();
dwCurTime = timeGetTime();
if (dwCurTime < dwStartTime+(s->Moment[i].dwTime*100)) {
// warning("PlayScript(): Sleeping %lums\n",dwStartTime+(s->Moment[i].dwTime*100)-dwCurTime);
Sleep(dwStartTime+(s->Moment[i].dwTime*100)-dwCurTime);
Expand Down Expand Up @@ -1043,23 +1043,23 @@ void PASCAL LocationPollThread(uint32 id) {
/* Cerchiamo gli items della locazione senza idle actions e li eliminiamo
dalla lista */
LockItems();
nIdleActions=0;
nRealItems=0;
for (i=0;i<numitems;i++) {
int ord=itemGetOrderFromNum(il[i]);
nIdleActions = 0;
nRealItems = 0;
for (i = 0; i < numitems; i++) {
int ord = itemGetOrderFromNum(il[i]);

if (ord==-1) continue;
if (ord == -1) continue;

curItem=lpmiItems+ord;
curItem = lpmiItems + ord;

k=0;
for (j=0;j<curItem->nActions;j++)
if (curItem->Action[j].num==0xFF)
for (j = 0; j < curItem->nActions; j++)
if (curItem->Action[j].num == 0xFF)
k++;

nIdleActions+=k;
nIdleActions += k;

if (k==0)
if (k == 0)
/* Possiamo eliminare questo item dalla lista */
il[i] = (uint32)NULL;
else
Expand All @@ -1068,56 +1068,56 @@ void PASCAL LocationPollThread(uint32 id) {
UnlockItems();

/* Se non e' rimasto nessuno possiamo uscire */
if (nRealItems==0) {
if (nRealItems == 0) {
GlobalFree(il);
ExitThread(0);
// _endthread();
}

MyThreads=(MYTHREAD*)GlobalAlloc(GMEM_FIXED|GMEM_ZEROINIT,nRealItems*sizeof(MYTHREAD));
if (MyThreads==NULL) {
MyThreads=(MYTHREAD *)GlobalAlloc(GMEM_FIXED | GMEM_ZEROINIT, nRealItems * sizeof(MYTHREAD));
if (MyThreads == NULL) {
GlobalFree(il);
ExitThread(0);
// _endthread();
}

/* Inizializziamo le routine random */
//curTime=timeGetTime();
//curTime = timeGetTime();
//srand(curTime);


/* Abbiamo appurato che esiste almeno un item che contiene idle actions.
Ora creaiamo le copie speculari delle idle actions */
MyActions=(MYACTION*)GlobalAlloc(GMEM_FIXED|GMEM_ZEROINIT,nIdleActions*sizeof(MYACTION));
if (MyActions==NULL) {
MyActions = (MYACTION *)GlobalAlloc(GMEM_FIXED | GMEM_ZEROINIT, nIdleActions * sizeof(MYACTION));
if (MyActions == NULL) {
GlobalFree(MyThreads);
GlobalFree(il);
ExitThread(0);
// _endthread();
}

LockItems();
k=0;
k = 0;

for (i=0;i<numitems;i++) {
if (il[i]==0)
for (i = 0; i < numitems; i++) {
if (il[i] == 0)
continue;

curItem=lpmiItems+itemGetOrderFromNum(il[i]);
curItem = lpmiItems + itemGetOrderFromNum(il[i]);

for (j=0;j<curItem->nActions;j++)
if (curItem->Action[j].num==0xFF) {
MyActions[k].nItem=il[i];
MyActions[k].nAction=j;
for (j = 0; j < curItem->nActions; j++)
if (curItem->Action[j].num == 0xFF) {
MyActions[k].nItem = il[i];
MyActions[k].nAction = j;

MyActions[k].wTime=curItem->Action[j].wTime;
MyActions[k].perc=curItem->Action[j].perc;
MyActions[k].when=curItem->Action[j].when;
MyActions[k].nCmds=curItem->Action[j].nCmds;
MyActions[k].wTime = curItem->Action[j].wTime;
MyActions[k].perc = curItem->Action[j].perc;
MyActions[k].when = curItem->Action[j].when;
MyActions[k].nCmds = curItem->Action[j].nCmds;
CopyMemory(MyActions[k].CmdNum, curItem->Action[j].CmdNum,
MAX_COMMANDS_PER_ACTION*sizeof(uint16));
MAX_COMMANDS_PER_ACTION * sizeof(uint16));

MyActions[k].dwLastTime=timeGetTime();
MyActions[k].dwLastTime = timeGetTime();
k++;
}
}
Expand All @@ -1132,7 +1132,7 @@ void PASCAL LocationPollThread(uint32 id) {
while (1) {
/* Cerchiamo tra tutte le idle actions quella a cui manca meno tempo per
l'esecuzione */
curTime=timeGetTime();
curTime = timeGetTime();
dwSleepTime=(uint32)-1L;

for (k=0;k<nIdleActions;k++)
Expand All @@ -1154,7 +1154,7 @@ void PASCAL LocationPollThread(uint32 id) {
MyThreads[i].nItem=0;
}

curTime=timeGetTime();
curTime = timeGetTime();

/* Cerchiamo all'interno delle idle actions quale e' necessario eseguire */
for (k=0;k<nIdleActions;k++)
Expand Down Expand Up @@ -1204,7 +1204,7 @@ void PASCAL LocationPollThread(uint32 id) {
UnlockItems();

/* Copiamo l'azione nella #0 */
// newItem->Action[0].nCmds=curItem->Action[j].nCmds;
// newItem->Action[0].nCmds = curItem->Action[j].nCmds;
// CopyMemory(newItem->Action[0].CmdNum,curItem->Action[j].CmdNum,newItem->Action[0].nCmds*sizeof(newItem->Action[0].CmdNum[0]));
newItem->dwRes=j;

Expand Down
2 changes: 1 addition & 1 deletion engines/tony/mpal/mpal.h
Expand Up @@ -271,7 +271,7 @@ typedef LPITEMIRQFUNCTION* LPLPITEMIRQFUNCTION;
\****************************************************************************/

#define mpalQueryGlobalVar(lpszVarName) \
(uint32)mpalQuery(MPQ_GLOBAL_VAR,(LPSTR)(lpszVarName))
(uint32)mpalQuery(MPQ_GLOBAL_VAR,(const char *)(lpszVarName))



Expand Down

0 comments on commit 9482eac

Please sign in to comment.