diff options
author | Paul Gilbert | 2012-05-20 13:54:59 +1000 |
---|---|---|
committer | Paul Gilbert | 2012-05-20 13:54:59 +1000 |
commit | 0450275c44c8c001d56cf37c78db6951ecaa4314 (patch) | |
tree | 83a19e37020d9730c4f76e9bed38a6008dfe6cda /engines/tony | |
parent | 333c30b8c7f6781605f517f2a7150f78a77556fc (diff) | |
download | scummvm-rg350-0450275c44c8c001d56cf37c78db6951ecaa4314.tar.gz scummvm-rg350-0450275c44c8c001d56cf37c78db6951ecaa4314.tar.bz2 scummvm-rg350-0450275c44c8c001d56cf37c78db6951ecaa4314.zip |
TONY: Converting Italian comments to English and formatting
Diffstat (limited to 'engines/tony')
-rw-r--r-- | engines/tony/loc.cpp | 612 | ||||
-rw-r--r-- | engines/tony/loc.h | 119 | ||||
-rw-r--r-- | engines/tony/tony.cpp | 12 | ||||
-rw-r--r-- | engines/tony/tony.h | 12 | ||||
-rw-r--r-- | engines/tony/tonychar.cpp | 56 | ||||
-rw-r--r-- | engines/tony/tonychar.h | 69 | ||||
-rw-r--r-- | engines/tony/utils.cpp | 36 | ||||
-rw-r--r-- | engines/tony/utils.h | 20 | ||||
-rw-r--r-- | engines/tony/window.cpp | 6 | ||||
-rw-r--r-- | engines/tony/window.h | 10 |
10 files changed, 433 insertions, 519 deletions
diff --git a/engines/tony/loc.cpp b/engines/tony/loc.cpp index b88fc68fc5..722116c47c 100644 --- a/engines/tony/loc.cpp +++ b/engines/tony/loc.cpp @@ -38,47 +38,34 @@ using namespace ::Tony::MPAL; /****************************************************************************\ -* Metodi di RMPalette -\****************************************************************************/ - -/****************************************************************************\ -* -* Function: friend RMDataStream &operator>>(RMDataStream &ds, -* RMPalette& pal); -* -* Description: Operatore di estrazione di palette da data stream -* -* Input: RMDataStream &ds Data stream -* RMPalette& pal Palette di destinazione -* -* Return: Reference allo stream -* +* RMPalette Methods \****************************************************************************/ +/** + * Operator for reading palette information from a data stream. + * + * @param ds Data stream + * @param pal Destination palette + * + * @returns Reference to the data stream + */ RMDataStream &operator>>(RMDataStream &ds, RMPalette &pal) { ds.Read(pal.m_data,1024); return ds; } /****************************************************************************\ -* Metodi di RMSlot -\****************************************************************************/ - -/****************************************************************************\ -* -* Function: friend RMDataStream &operator>>(RMDataStream &ds, -* RMSlot& slot) -* -* Description: Operatore per estrarre uno slot di un pattern da un data -* stream -* -* Input: RMDataStream &ds Data stream -* RMSlot& slot Slot di destinazione -* -* Return: Reference allo stream -* +* RMSlot Methods \****************************************************************************/ +/** + * Operator for reading slot information from a data stream. + * + * @param ds Data stream + * @param slot Destination slot + * + * @returns Reference to the data stream + */ RMDataStream &operator>>(RMDataStream &ds, RMPattern::RMSlot &slot) { slot.ReadFromStream(ds); return ds; @@ -107,20 +94,14 @@ void RMPattern::RMSlot::ReadFromStream(RMDataStream &ds, bool bLOX) { * Metodi di RMPattern \****************************************************************************/ -/****************************************************************************\ -* -* Function: friend RMDataStream &operator>>(RMDataStream &ds, -* RMPattern& pat) -* -* Description: Operatore per estrarre un pattern da un data stream -* -* Input: RMDataStream &ds Data stream -* RMPattern& pat Pattern di destinazione -* -* Return: Reference allo stream -* -\****************************************************************************/ - +/** + * Operator for reading pattern information from a data stream + * + * @param ds Data stream + * @param pat Destination pattern + * + * @returns Reference to the data stream + */ RMDataStream &operator>>(RMDataStream &ds, RMPattern &pat) { pat.ReadFromStream(ds); return ds; @@ -129,23 +110,23 @@ RMDataStream &operator>>(RMDataStream &ds, RMPattern &pat) { void RMPattern::ReadFromStream(RMDataStream &ds, bool bLOX) { int i; - // Nome del pattern + // Pattern name if (!bLOX) ds >> m_name; - // Velocita' + // Velocity ds >> m_speed; - // Posizione + // Position ds >> m_pos; - // Flag di loop del pattern + // Flag for pattern looping ds >> m_bLoop; - // Numero di slot + // Number of slots ds >> m_nSlots; - // Creazione e lettura degli slot + // Create and read the slots m_slots = new RMSlot[m_nSlots]; for (i = 0; i < m_nSlots && !ds.IsError(); i++) { @@ -174,11 +155,11 @@ void RMPattern::StopSfx(RMSfx *sfx) { int RMPattern::Init(RMSfx *sfx, bool bPlayP0, byte *bFlag) { int i; - // Prendiamo il tempo corrente + // Read the current time m_nStartTime = _vm->GetTime(); m_nCurSlot = 0; - // Cerca il primo frame nel pattern + // Find the first frame of the pattern i = 0; while (m_slots[i].m_type != SPRITE) { assert(i + 1 < m_nSlots); @@ -190,13 +171,13 @@ int RMPattern::Init(RMSfx *sfx, bool bPlayP0, byte *bFlag) { if (bFlag) *bFlag = m_slots[i].m_flag; - // Calcola le coordinate correnti + // Calculate the current coordinates UpdateCoord(); - // Controlla per il sonoro: - // Se sta alla slot 0, lo playa - // Se speed = 0, deve suonare solo se va in loop '_', oppure se specificato dal parametro - // Se speed! = 0, suona solo quelli in loop + // Check for sound: + // If the slot is 0, play + // If speed = 0, must playing unless it goes into loop '_', or if specified by the parameter + // If speed != 0, play only the loop for (i = 0;i < m_nSlots; i++) { if (m_slots[i].m_type == SOUND) { if (i == 0) { @@ -230,14 +211,14 @@ int RMPattern::Init(RMSfx *sfx, bool bPlayP0, byte *bFlag) { int RMPattern::Update(uint32 hEndPattern, byte &bFlag, RMSfx *sfx) { int CurTime = _vm->GetTime(); - // Se la speed e' 0, il pattern non avanza mai + // If the speed is 0, then the pattern never advances if (m_speed == 0) { CoroScheduler.pulseEvent(hEndPattern); bFlag=m_slots[m_nCurSlot].m_flag; return m_nCurSprite; } - // E' arrivato il momento di cambiare slot? + // Is it time to change the slots? while (m_nStartTime + m_speed <= (uint32)CurTime) { m_nStartTime += m_speed; if (m_slots[m_nCurSlot].m_type == SPRITE) @@ -248,8 +229,8 @@ int RMPattern::Update(uint32 hEndPattern, byte &bFlag, RMSfx *sfx) { CoroScheduler.pulseEvent(hEndPattern); - // @@@ Se non c'e' loop avverte che il pattern e' finito - // Se non c'e' loop rimane sull'ultimo frame + // @@@ If there is no loop pattern, and there's a warning that it's the final + // frame, then remain on the last frame if (!m_bLoop) { m_nCurSlot = m_nSlots - 1; bFlag = m_slots[m_nCurSlot].m_flag; @@ -260,10 +241,10 @@ int RMPattern::Update(uint32 hEndPattern, byte &bFlag, RMSfx *sfx) { for (;;) { switch (m_slots[m_nCurSlot].m_type) { case SPRITE: - // Legge il prossimo sprite + // Read the next sprite m_nCurSprite = m_slots[m_nCurSlot].m_data; - // Aggiorna le coordinate babbo+figlio + // Update the parent & child coordinates UpdateCoord(); break; @@ -293,7 +274,7 @@ int RMPattern::Update(uint32 hEndPattern, byte &bFlag, RMSfx *sfx) { } } - // Ritorna lo sprite corrente + // Return the current sprite bFlag=m_slots[m_nCurSlot].m_flag; return m_nCurSprite; } @@ -320,23 +301,17 @@ RMPattern::~RMPattern() { /****************************************************************************\ -* Metodi di RMSprite -\****************************************************************************/ - -/****************************************************************************\ -* -* Function: friend RMDataStream &operator>>(RMDataStream &ds, -* RMSprite& sprite) -* -* Description: Operatore per estrarre uno sprite da un data stream -* -* Input: RMDataStream &ds Data stream -* RMItem &item Sprite di destinazione -* -* Return: Reference allo stream -* +* RMSprite Methods \****************************************************************************/ +/** + * Operator for reading sprite information from a data stream. + * + * @param ds Data stream + * @param sprite Destination slot + * + * @returns Reference to the data stream + */ RMDataStream &operator>>(RMDataStream &ds, RMSprite &sprite) { sprite.ReadFromStream(ds); return ds; @@ -366,22 +341,22 @@ void RMSprite::GetSizeFromStream(RMDataStream &ds, int *dimx, int *dimy) { void RMSprite::ReadFromStream(RMDataStream &ds, bool bLOX) { int dimx,dimy; - // Nome dello sprite + // Sprite name if (!bLOX) ds >> m_name; - // Dimensioni + // Dimensions ds >> dimx >> dimy; - // Bouding box + // Bounding box ds >> m_rcBox; - // Spazio inutilizzato + // Unused space if (!bLOX) - ds+=32; + ds += 32; - // Crezione del buffer e lettura - m_buf->Init(ds, dimx,dimy); + // Create buffer and read + m_buf->Init(ds, dimx, dimy); } void RMSprite::Draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive *prim) { @@ -405,23 +380,17 @@ RMSprite::~RMSprite() { /****************************************************************************\ -* Metodi di RMSfx -\****************************************************************************/ - -/****************************************************************************\ -* -* Function: friend RMDataStream &operator>>(RMDataStream &ds, -* RMSfx &sfx) -* -* Description: Operatore per estrarre uno sfx da un data stream -* -* Input: RMDataStream &ds Data stream -* RMSfx &sfx Sfx di destinazione -* -* Return: Reference allo stream -* +* RMSfx Methods \****************************************************************************/ +/** + * Operator for reading SFX information from a data stream. + * + * @param ds Data stream + * @param sfx Destination SFX + * + * @returns Reference to the data stream + */ RMDataStream &operator>>(RMDataStream &ds, RMSfx &sfx) { sfx.ReadFromStream(ds); return ds; @@ -432,29 +401,29 @@ void RMSfx::ReadFromStream(RMDataStream &ds, bool bLOX) { int size; byte *raw; - // Nome dello sfx + // sfx name ds >> m_name; ds >> size; - // Carica l'effetto sonoro dal buffer - ds.Read(id,4); + // Upload the sound effect identifier from the buffer + ds.Read(id, 4); - // Controlla che sia un riff + // Ensure it's a RIFF assert(id[0] == 'R' && id[1] == 'I' && id[2] == 'F' && id[3] == 'F'); - // Legge la dimensione + // Read the size ds >> size; - // Carica il wav + // Read the raw WAV data raw = new byte[size]; ds.Read(raw, size); - // Crea l'effetto sonoro + // Create the sound effect m_fx = _vm->CreateSFX(raw); m_fx->SetLoop(false); - // Cancella il buffer che non serve più a nessuno + // Close the read buffer which is no longer needed delete[] raw; } @@ -476,7 +445,7 @@ void RMSfx::Play(bool bLoop) { m_fx->Play(); if (bLoop) - m_bPlayingLoop=true; + m_bPlayingLoop = true; } } @@ -502,23 +471,17 @@ void RMSfx::Stop(void) { /****************************************************************************\ -* Metodi di RMItem -\****************************************************************************/ - -/****************************************************************************\ -* -* Function: friend RMDataStream &operator>>(RMDataStream &ds, -* RMItem &item) -* -* Description: Operatore per estrarre un item da un data stream -* -* Input: RMDataStream &ds Data stream -* RMItem &item Item di destinazione -* -* Return: Reference allo stream -* +* RMItem Methods \****************************************************************************/ +/** + * Operator for reading item information from a data stream. + * + * @param ds Data stream + * @param tem Destination item + * + * @returns Reference to the data stream + */ RMDataStream &operator>>(RMDataStream &ds, RMItem &item) { item.ReadFromStream(ds); return ds; @@ -561,13 +524,12 @@ bool RMItem::IsIn(const RMPoint &pt, int *size) { if (!m_bIsActive) return false; - // Cerca il rettangolo giusto da usare, che è quello dello sprite se ce l'ha, altrimenti - // quello generico dell'oggeto + // Search for the right bounding box to use - use the sprite's if it has one, otherwise use the generic one if (m_nCurPattern != 0 && !m_sprites[m_nCurSprite].m_rcBox.IsEmpty()) rc=m_sprites[m_nCurSprite].m_rcBox + CalculatePos(); else if (!m_rcBox.IsEmpty()) rc = m_rcBox; - // Se non ha box, esce subito + // If no box, return immediately else return false; @@ -582,16 +544,16 @@ void RMItem::ReadFromStream(RMDataStream &ds, bool bLOX) { int i, dimx, dimy; byte cm; - // Codice mpal + // MPAL code ds >> m_mpalCode; - // Nome dell'oggetto + // Object name ds >> m_name; // Z (signed) ds >> m_z; - // Posizione nonno + // Parent position ds >> m_pos; // Hotspot @@ -600,22 +562,22 @@ void RMItem::ReadFromStream(RMDataStream &ds, bool bLOX) { // Bounding box ds >> m_rcBox; - // Numero sprite, effetti sonori e pattern + // Number of sprites, sound effects, and patterns ds >> m_nSprites >> m_nSfx >> m_nPatterns; // Color mode ds >> cm; m_cm=(RMColorMode)cm; - // Flag di presenza della palette differnziata + // Flag for the presence of custom palette differences ds >> m_bPal; if (m_cm == CM_256) { - // Se c'e' la palette, leggiamola + // If there is a palette, read it in if (m_bPal) ds >> m_pal; } - // Dati MPAL + // MPAL data if (!bLOX) ds += 20; @@ -625,17 +587,17 @@ void RMItem::ReadFromStream(RMDataStream &ds, bool bLOX) { if (!bLOX) ds += 106; - // Creazione delle classi + // Create sub-classes if (m_nSprites > 0) m_sprites = new RMSprite[m_nSprites]; if (m_nSfx > 0) m_sfx = new RMSfx[m_nSfx]; m_patterns = new RMPattern[m_nPatterns+1]; - // Lettura delle classi + // Read in class data if (!ds.IsError()) for (i = 0; i < m_nSprites && !ds.IsError(); i++) { - // Carica lo sprite + // Download the sprites if (bLOX) { m_sprites[i].LOXGetSizeFromStream(ds, &dimx, &dimy); m_sprites[i].Init(NewItemSpriteBuffer(dimx, dimy, true)); @@ -658,7 +620,7 @@ void RMItem::ReadFromStream(RMDataStream &ds, bool bLOX) { m_sfx[i].ReadFromStream(ds, false); } - // Leggiamo i pattern a partire dal pattern 1 + // Read the pattern from pattern 1 if (!ds.IsError()) for (i = 1;i <= m_nPatterns && !ds.IsError(); i++) { if (bLOX) @@ -667,12 +629,12 @@ void RMItem::ReadFromStream(RMDataStream &ds, bool bLOX) { m_patterns[i].ReadFromStream(ds, false); } - // Inizializza il curpattern + // Initialise the current pattern if (m_bInitCurPattern) SetPattern(mpalQueryItemPattern(m_mpalCode)); - // Inizializza lo stato di attivazione - m_bIsActive=mpalQueryItemIsActive(m_mpalCode); + // Initailise the current activation state + m_bIsActive = mpalQueryItemIsActive(m_mpalCode); } @@ -687,11 +649,11 @@ void RMItem::SetScrollPosition(const RMPoint &scroll) { bool RMItem::DoFrame(RMGfxTargetBuffer *bigBuf, bool bAddToList) { int oldSprite = m_nCurSprite; - // Pattern 0 = Non disegnare nulla! + // Pattern 0 = Do not draw anything! if (m_nCurPattern == 0) return false; - // Facciamo un update del pattern, che ci ritorna anche il frame corrente + // We do an update of the pattern, which also returns the current frame if (m_nCurPattern != 0) { m_nCurSprite = m_patterns[m_nCurPattern].Update(m_hEndPattern, m_bCurFlag, m_sfx); @@ -704,14 +666,14 @@ bool RMItem::DoFrame(RMGfxTargetBuffer *bigBuf, bool bAddToList) { m_nCurSprite = -1; } - // Se la funzione ha ritornato -1, vuol dire che il pattern e' finito + // If the function returned -1, it means that the pattern has finished if (m_nCurSprite == -1) { - // Mettiamo il pattern 0, e usciamo. La classe si auto-deregistrera' della OT list + // We have pattern 0, so leave. The class will self de-register from the OT list m_nCurPattern = 0; return false; } - // Se non siamo in OT list, mettiamoci + // If we are not in the OT list, add ourselves if (!m_nInList && bAddToList) bigBuf->AddPrim(NewItemPrimitive()); @@ -728,24 +690,24 @@ void RMItem::Draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive *prim) { CORO_BEGIN_CODE(_ctx); - // Se CurSprite == -1, allora e' finito il pattern + // If CurSprite == -1, then the pattern is finished if (m_nCurSprite == -1) return; - // Settiamo la flag + // Set the flag prim->SetFlag(m_bCurFlag); - // Offset inverso per lo scrolling + // Offset direction for scrolling prim->Dst().Offset(-m_curScroll); - // Dobbiamo sparaflashare le coordinate dell'item dentro la primitiva. - // Si calcola nonno+(babbo+figlio) + // We must offset the cordinates of the item inside the primitive + // It is estimated as nonno + (babbo + figlio) prim->Dst().Offset(CalculatePos()); // No stretching, please prim->SetStrecth(false); - // Ora la passiamo alla routine di drawing generica per surface + // Now we turn to the generic surface drawing routines CORO_INVOKE_2(m_sprites[m_nCurSprite].Draw, bigBuf, prim); CORO_END_CODE; @@ -753,7 +715,7 @@ void RMItem::Draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive *prim) { void RMItem::RemoveThis(CORO_PARAM, bool &result) { - // Rimuove dalla OT list se il frame corrente e' -1 (pattern finito) + // Remove from the OT list if the current frame is -1 (pattern over) result = (m_nCurSprite == -1); } @@ -771,16 +733,16 @@ void RMItem::SetPattern(int nPattern, bool bPlayP0) { if (m_nCurPattern>0) m_patterns[m_nCurPattern].StopSfx(m_sfx); - // Si ricorda il pattern corrente + // Remember the current pattern m_nCurPattern = nPattern; - // Inizia il pattern per cominciare l'animazione + // Start the pattern to start the animation if (m_nCurPattern != 0) m_nCurSprite = m_patterns[m_nCurPattern].Init(m_sfx, bPlayP0, &m_bCurFlag); else { m_nCurSprite = -1; - // Cerca l'effetto sonoro per il pattern 0 + // Look for the sound effect for pattern 0 if (bPlayP0) for (i = 0;i < m_nSfx; i++) if (strcmp(m_sfx[i].m_name, "p0") == 0) @@ -789,8 +751,7 @@ void RMItem::SetPattern(int nPattern, bool bPlayP0) { } -bool RMItem::GetName(RMString &name) -{ +bool RMItem::GetName(RMString &name) { char buf[256]; mpalQueryItemName(m_mpalCode, buf); @@ -885,7 +846,7 @@ void RMItem::PauseSound(bool bPause) { /****************************************************************************\ -* Metodi di RMWipe +* RMWipe Methods \****************************************************************************/ @@ -931,13 +892,13 @@ void RMWipe::WaitForFadeEnd(CORO_PARAM) { } void RMWipe::CloseFade(void) { -// m_bUnregister=true; +// m_bUnregister = true; // WaitForSingleObject(m_hUnregistered,CORO_INFINITE); m_wip0r.Unload(); } void RMWipe::InitFade(int type) { - // Attiva il fade + // Activate the fade m_bUnregister = false; m_bEndFade = false; @@ -993,19 +954,19 @@ void RMWipe::Draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive *prim) { /****************************************************************************\ -* Metodi di RMCharacter +* RMCharacter Methods \****************************************************************************/ -/***************************************************************************/ -/* Cerca il percorso minimo tra due nodi del grafo di connessione dei BOX */ -/* Restituisce il percorso lungo pathlenght nel vettore path[] */ -/***************************************************************************/ +/****************************************************************************/ +/* Find the shortest path between two nodes of the graph connecting the BOX */ +/* Returns path along the vector path path[] */ +/****************************************************************************/ short RMCharacter::FindPath(short source, short destination) { - static RMBox BOX[MAXBOXES]; // Matrice di Adjacenza - static short COSTO[MAXBOXES]; // Costi per Nodo - static short VALIDO[MAXBOXES]; // 0:non valido 1:valido 2:saturo - static short NEXT[MAXBOXES]; // Prossimo Nodo + static RMBox BOX[MAXBOXES]; // Matrix of adjacent boxes + static short COSTO[MAXBOXES]; // Cost per node + static short VALIDO[MAXBOXES]; // 0:Invalid 1:Valid 2:Saturated + static short NEXT[MAXBOXES]; // Prossimo Nodo short i, j, k, costominimo, fine, errore = 0; RMBoxLoc *cur; @@ -1016,37 +977,37 @@ short RMCharacter::FindPath(short source, short destination) { return 0; } - // Si fa dare i box + // Get the boxes cur = theBoxes->GetBoxes(curLocation); - // Effettua una copia di riserva per lavorarci + // Make a backup copy to work on for (i = 0; i < cur->numbbox; i++) memcpy(&BOX[i], &cur->boxes[i], sizeof(RMBox)); - // Invalida tutti i Nodi + // Invalidate all nodes for (i = 0; i < cur->numbbox; i++) VALIDO[i] = 0; - // Prepara sorgente e variabili globali alla procedura + // Prepare source and variables for the procedure COSTO[source] = 0; VALIDO[source] = 1; fine = 0; - // Ricerca del percorso minimo + // Find the shortest path while(!fine) { - costominimo = 32000; // risetta il costo minimo - errore = 1; // errore possibile + costominimo = 32000; // Reset the minimum cost + errore = 1; // Possible error - // 1° ciclo : ricerca di possibili nuovi nodi + // 1st cycle: explore possible new nodes for (i = 0; i < cur->numbbox; i++) if (VALIDO[i] == 1) { - errore = 0; // errore sfatato + errore = 0; // Failure de-bunked j = 0; while (((BOX[i].adj[j]) != 1) && (j < cur->numbbox)) j++; if (j >= cur->numbbox) - VALIDO[i] = 2; // nodo saturo? + VALIDO[i] = 2; // nodo saturated? else { NEXT[i] = j; if (COSTO[i] + 1 < costominimo) @@ -1055,9 +1016,9 @@ short RMCharacter::FindPath(short source, short destination) { } if (errore) - fine = 1; // tutti i nodi saturi + fine = 1; // All nodes saturated - // 2° ciclo : aggiunta nuovi nodi trovati , saturazione nodi vecchi + // 2nd cycle: adding new nodes that were found, saturate old nodes for (i = 0; i < cur->numbbox; i++) if ((VALIDO[i] == 1) && ((COSTO[i] + 1) == costominimo)) { BOX[i].adj[NEXT[i]] = 2; @@ -1072,7 +1033,7 @@ short RMCharacter::FindPath(short source, short destination) { } } - // Estrazione del percorso dalla matrice di adiacenza modificata + // Remove the path from the adjacent modified matrixes if (!errore) { pathlenght = COSTO[destination]; k = pathlenght; @@ -1133,7 +1094,7 @@ void RMCharacter::GoTo(CORO_PARAM, RMPoint destcoord, bool bReversed) { walkspeed = -walkspeed; walkstatus = 1; - // Cambia il proprio pattern per la nuova direzione + // Change the pattern for the new direction bNeedToStop = true; if ((walkspeed < 0 && !bReversed) || (walkspeed >= 0 && bReversed)) { if (nPatt != PAT_WALKLEFT) @@ -1148,7 +1109,7 @@ void RMCharacter::GoTo(CORO_PARAM, RMPoint destcoord, bool bReversed) { walkspeed = -walkspeed; walkstatus = 0; - bNeedToStop=true; + bNeedToStop = true; if ((walkspeed < 0 && !bReversed) || (walkspeed >= 0 && bReversed)) { if (nPatt != PAT_WALKUP) SetPattern(PAT_WALKUP); @@ -1237,7 +1198,7 @@ RMPoint RMCharacter::NearestPoint(const RMPoint &punto) { if ((difx<0) && (dify>0)) tofind=Searching(0,1,0,1,punto); if ((difx<0) && (dify<0)) tofind=Searching(1,0,0,1,punto); - // potrebbero essere tolti? Pensaci @@@@ + // Could be removed? Think @@@@ if ((difx= = 0) && (dify>0)) tofind=Searching(0,1,1,1,punto); if ((difx= = 0) && (dify<0)) tofind=Searching(1,0,1,1,punto); if ((dify= = 0) && (difx>0)) tofind=Searching(1,1,1,0,punto); @@ -1259,8 +1220,8 @@ short RMCharacter::ScanLine(const RMPoint &punto) { Lstart = m_pos; Lend = punto; - Ldx = Lstart.x-Lend.x; - Ldy = Lstart.y-Lend.y; + Ldx = Lstart.x - Lend.x; + Ldy = Lstart.y - Lend.y; Lfx = Ldx; Lfy = Ldy; Ldx = ABS(Ldx); @@ -1278,7 +1239,7 @@ short RMCharacter::ScanLine(const RMPoint &punto) { Lstatus = 0; } - Lscan = Lstart; // Inizio scansione + Lscan = Lstart; // Start scanning while (InWhichBox(Lscan) != -1) { Lcount++; if (Lstatus) { @@ -1298,7 +1259,9 @@ short RMCharacter::ScanLine(const RMPoint &punto) { return 0; } -// Calcola intersezioni tra la traiettoria rettilinea ed il più vicino BBOX +/** + * Calculates intersections between the straight line and the closest BBOX + */ RMPoint RMCharacter::InvScanLine(const RMPoint &punto) { int Ldx, Ldy, Lcount; float Lfx, Lfy, Lslope; @@ -1351,9 +1314,9 @@ RMPoint RMCharacter::InvScanLine(const RMPoint &punto) { } -/***************************************************************************/ -/* Ritorna la coordinata dell'HotSpot di uscita più vicino al giocatore */ -/***************************************************************************/ +/** + * Returns the HotSpot coordinate closest to the player + */ RMPoint RMCharacter::NearestHotSpot(int sourcebox, int destbox) { RMPoint puntocaldo; @@ -1396,21 +1359,21 @@ void RMCharacter::NewBoxEntered(int nBox) { RMBoxLoc *cur; bool bOldReverse; - // Richiama la On ExitBox + // Recall on ExitBox mpalQueryDoAction(3, curLocation, curbox); cur = theBoxes->GetBoxes(curLocation); bOldReverse = cur->boxes[curbox].bReversed; curbox = nBox; - // Se è cambiata la Z, dobbiamo rimuoverlo dalla OT + // If Z is changed, we must remove it from the OT if (cur->boxes[curbox].Zvalue != m_z) { bRemoveFromOT = true; m_z = cur->boxes[curbox].Zvalue; } - // Gestisce l'inversione del movimento SOLO se non siamo nel percorso minimo: se siamo in percorso - // minimo è direttamente la DoFrame a farlo + // Movement management is reversed, only if we are not in the shortest path. If we are in the shortest + // path, directly do the DoFrame if (bMovingWithoutMinpath) { if ((cur->boxes[curbox].bReversed && !bOldReverse) || (!cur->boxes[curbox].bReversed && bOldReverse)) { switch (GetCurPattern()) { @@ -1430,7 +1393,7 @@ void RMCharacter::NewBoxEntered(int nBox) { } } - // Richiama la On EnterBox + // Recall On EnterBox mpalQueryDoAction(2, curLocation, curbox); } @@ -1448,16 +1411,16 @@ void RMCharacter::DoFrame(CORO_PARAM, RMGfxTargetBuffer* bigBuf, int loc) { g_system->lockMutex(csMove); - // Se stiamo camminando... + // If we're walking.. if (status != STAND) { - // Se stiamo andando in orizzontale + // If we are going horizontally if (walkstatus == 1) { dx = walkspeed * walkcount; dy = slope * dx; m_pos.x = linestart.x + dx; m_pos.y = linestart.y + dy; - // Destra + // Right if (((walkspeed > 0) && (m_pos.x > lineend.x)) || ((walkspeed < 0) && (m_pos.x < lineend.x))) { m_pos = lineend; status = STAND; @@ -1465,14 +1428,14 @@ void RMCharacter::DoFrame(CORO_PARAM, RMGfxTargetBuffer* bigBuf, int loc) { } } - // Se stiamo andando in verticale + // If we are going vertical if (walkstatus == 0) { dy = walkspeed * walkcount; dx = slope * dy; m_pos.x = linestart.x + dx; m_pos.y = linestart.y + dy; - // Basso + // Down if (((walkspeed > 0) && (m_pos.y > lineend.y)) || ((walkspeed < 0) && (m_pos.y < lineend.y))) { m_pos = lineend; status = STAND; @@ -1480,15 +1443,13 @@ void RMCharacter::DoFrame(CORO_PARAM, RMGfxTargetBuffer* bigBuf, int loc) { } } - // Controlla se il personaggio è uscito dai BOX per errore, nel qual caso - // lo fa rientrare subito + // Check if the character came out of the BOX in error, in which case he returns immediately if (InWhichBox(m_pos) == -1) { m_pos.x = linestart.x + olddx; m_pos.y = linestart.y + olddy; } - // Se siamo appena arrivati alla destinazione temporanea ed è finito il percorso minimo, - // ci fermiamo definitivamente + // If we have just moved to a temporary location, and is over the shortest path, we stop permanently if (_ctx->bEndNow && minpath == 0) { if (!bEndOfPath) CORO_INVOKE_0(Stop); @@ -1498,35 +1459,35 @@ void RMCharacter::DoFrame(CORO_PARAM, RMGfxTargetBuffer* bigBuf, int loc) { walkcount++; - // Aggiorna la Z del personaggio @@@ bisognerebbe rimuoverlo solo se è cambiata la Z + // Update the character Z. @@@ Should remove only if the Z was changed - // Controlla se abbiamo cambiato box + // Check if the box was changed if (!theBoxes->IsInBox(curLocation, curbox, m_pos)) NewBoxEntered(InWhichBox(m_pos)); - // Aggiorna le vecchie coordinate + // Update the old coordinates olddx = dx; olddy = dy; } - // Se siamo fermi + // If we stop if (status == STAND) { - // Controlliamo se c'è ancora percorso minimo da calcolare + // Check if there is still the shortest path to calculate if (minpath == 1) { _ctx->cur = theBoxes->GetBoxes(curLocation); - // Se dobbiamo ancora attraversare un box + // If we still have to go through a box if (pathcount < pathlenght) { - // Controlliamo che il box su cui stiamo entrando sia attivo + // Check if the box we're going into is active if (_ctx->cur->boxes[path[pathcount-1]].attivo) { - // Muoviti in linea retta verso l'hotspot più vicino, tenendo conto del reversing please + // Move in a straight line towards the nearest hotspot, taking into account the reversing // NEWBOX = path[pathcount-1] CORO_INVOKE_2(GoTo, NearestHotSpot(path[pathcount-1], path[pathcount]), _ctx->cur->boxes[path[pathcount-1]].bReversed); pathcount++; } else { - // Se il box è disattivato, possiamo solo bloccare tutto - // @@@ Questo non dovrebbe più avvenire, dato che abbiamo migliorato - // la ricerca del percorso minimo + // If the box is off, we can only block all + // @@@ Whilst this should not happen, because have improved + // the search for the minimum path minpath = 0; if (!bEndOfPath) CORO_INVOKE_0(Stop); @@ -1534,8 +1495,8 @@ void RMCharacter::DoFrame(CORO_PARAM, RMGfxTargetBuffer* bigBuf, int loc) { CoroScheduler.pulseEvent(hEndOfPath); } } else { - // Se siamo già entrati nell'ultimo box, dobbiamo solo muoverci in linea retta verso il - // punto di arrivo + // If we have already entered the last box, we just have to move in a straight line towards the + // point of arrival // NEWBOX = InWhichBox(pathend) minpath = 0; CORO_INVOKE_2(GoTo, pathend, _ctx->cur->boxes[InWhichBox(pathend)].bReversed); @@ -1545,7 +1506,7 @@ void RMCharacter::DoFrame(CORO_PARAM, RMGfxTargetBuffer* bigBuf, int loc) { g_system->unlockMutex(csMove); - // Richiama il DoFrame dell'item + // Invoke the DoFrame of the item RMItem::DoFrame(bigBuf); CORO_END_CODE; @@ -1611,7 +1572,7 @@ void RMCharacter::Move(CORO_PARAM, RMPoint pt, bool *result) { bMoving = true; - // Se 0,0, non fare nulla, anzi fermati + // 0, 0 does not do anything, just stops the character if (pt.x == 0 && pt.y == 0) { minpath = 0; status = STAND; @@ -1621,10 +1582,10 @@ void RMCharacter::Move(CORO_PARAM, RMPoint pt, bool *result) { return; } - // Se clicko fuori dai box + // If clicked outside the box _ctx->numbox = InWhichBox(pt); if (_ctx->numbox == -1) { - // Trova il punto più vicino dentro i box + // Find neareste point inside the box _ctx->dest = NearestPoint(pt); // ???!?? @@ -1687,7 +1648,7 @@ void RMCharacter::SetPosition(const RMPoint &pt, int newloc) { if (newloc != -1) curLocation = newloc; - // Aggiorna la Z del personaggio + // Update the character's Z value box = theBoxes->GetBoxes(curLocation); curbox = InWhichBox(m_pos); assert(curbox != -1); @@ -1771,7 +1732,7 @@ void RMBox::ReadFromStream(RMDataStream &ds) { ds >> right; ds >> bottom; - // Adiacenza + // Adjacency for (i = 0; i < MAXBOXES; i++) { ds >> adj[i]; } @@ -1784,8 +1745,8 @@ void RMBox::ReadFromStream(RMDataStream &ds) { ds >> b; bReversed = b; - // Spazio di espansione - ds+=30; + // Reversed expansion space + ds += 30; // Hotspots for (i = 0; i < numhotspot; i++) { @@ -1818,18 +1779,18 @@ void RMBoxLoc::ReadFromStream(RMDataStream &ds) { char buf[2]; byte ver; - // ID and versione + // ID and version ds >> buf[0] >> buf[1] >> ver; assert(buf[0] == 'B' && buf[1] == 'X'); assert(ver == 3); - // Numero dei box + // Number of boxes ds >> numbbox; - // Alloca la memoria per i box + // Allocate memory for the boxes boxes = new RMBox[numbbox]; - // Li legge da disco + // Read in boxes for (i = 0; i < numbbox; i++) ds >> boxes[i]; } @@ -1950,7 +1911,7 @@ void RMGameBoxes::SaveState(byte *state) { // For each location, write out the number of boxes and their status for (i=1; i <= m_nLocBoxes; i++) { WRITE_LE_UINT32(state, m_allBoxes[i]->numbbox); - state+=4; + state += 4; for (j = 0; j < m_allBoxes[i]->numbbox; j++) *state++ = m_allBoxes[i]->boxes[j].attivo; @@ -1958,17 +1919,16 @@ void RMGameBoxes::SaveState(byte *state) { } void RMGameBoxes::LoadState(byte *state) { - int i,j; - int nloc,nbox; + int i, j; + int nloc, nbox; - // Load number of locations with box + // Load number of items nloc = *(int*)state; - state+=4; + state += 4; - // Controlla che siano meno di quelli correnti assert(nloc <= m_nLocBoxes); - // Per ogni locazione, salva il numero di box e il loro stato + // For each location, read the number of boxes and their status for (i = 1; i <= nloc; i++) { nbox = READ_LE_UINT32(state); state += 4; @@ -1985,17 +1945,12 @@ void RMGameBoxes::LoadState(byte *state) { } /****************************************************************************\ -* Metodi di RMLocation -\****************************************************************************/ - -/****************************************************************************\ -* -* Function: RMLocation::RMLocation(); -* -* Description: Costruttore standard -* +* RMLocation Methods \****************************************************************************/ +/** + * Standard constructor + */ RMLocation::RMLocation() { m_nItems = 0; m_items = NULL; @@ -2003,49 +1958,36 @@ RMLocation::RMLocation() { } -/****************************************************************************\ -* -* Function: bool RMLocation::Load(char *lpszFileName); -* -* Description: Carica una locazione (.LOC) da un file di cui viene fornito -* il pathname. -* -* Input: char *lpszFileName Nome del file di dati -* -* Return: true se tutto OK, false in caso di errore -* -\****************************************************************************/ - +/** + * Load a location (.LOC) from a file that is provided. + * + * @param lpszFileName Name of the file + */ bool RMLocation::Load(const char *lpszFileName) { Common::File f; bool bRet; - // Apre il file in lettura + // Open the file for reading if (!f.open(lpszFileName)) return false; - // Lo passa alla routine di loading da file aperto + // Passes to the method variation for loading from the opened file bRet = Load(f); - // Chiude il file + // Close the file f.close(); return bRet; } -/****************************************************************************\ -* -* Function: bool RMLocation::Load(HANDLE hFile); -* -* Description: Carica una locazione (.LOC) da un handle di file aperto -* -* Input: HANDLE hFile Handle del file -* -* Return: true se tutto OK, false in caso di errore -* -\****************************************************************************/ - +/** + * Load a location (.LOC) from a given open file + * + * @param hFile File reference + * + * @returns True if succeeded OK, false in case of error. + */ bool RMLocation::Load(Common::File &file) { int size; // byte *buf; @@ -2091,20 +2033,12 @@ bool RMLocation::Load(const byte *buf) { } - -/****************************************************************************\ -* -* Function: bool RMLocation::Load(byte *buf); -* -* Description: Carica una locazione (.LOC) parsando il file gia' caricato -* in memoria. -* -* Input: byte *buf Buffer con il file caricato -* -* Return: true se ok, false in caso di errore -* -\****************************************************************************/ - +/** + * Load a location (.LOC) from a given data stream + * + * @param ds Data stream + * @returns True if succeeded OK, false in case of error. + */ bool RMLocation::Load(RMDataStream &ds) { char id[3]; int dimx, dimy; @@ -2112,40 +2046,40 @@ bool RMLocation::Load(RMDataStream &ds) { byte cm; int i; - // Controlla l'ID + // Check the ID ds >> id[0] >> id[1] >> id[2]; - // Controlla se siamo in un LOX + // Check if we are in a LOX if (id[0] == 'L' && id[1] == 'O' && id[2] == 'X') return LoadLOX(ds); - // Altrimenti, controlla che sia un LOC normale + // Otherwise, check that it is a normal LOC if (id[0] != 'L' || id[1] != 'O' || id[2] != 'C') return false; - // Versione + // Version ds >> ver; assert(ver == 6); - // Nome della locazione + // Location name ds >> m_name; - // Skippa i salvataggi MPAL (64 bytes) + // Skip the MPAL bailouts (64 bytes) ds >> TEMPNumLoc; ds >> TEMPTonyStart.x >> TEMPTonyStart.y; ds += 64 - 4 * 3; - // Skippa il flag di background associato (?!) + // Skip flag associated with the background (?) ds += 1; - // Dimensioni della locazione + // Location dimensions ds >> dimx >> dimy; m_curScroll.Set(0, 0); - // Legge il color mode + // Read the colour mode ds >> cm; m_cmode = (RMColorMode)cm; - // Inizializza il source buffer e leggi la locazione dentro + // Initialise the source buffer and read the location switch (m_cmode) { case CM_256: m_buf = new RMGfxSourceBuffer8; @@ -2160,16 +2094,16 @@ bool RMLocation::Load(RMDataStream &ds) { break; }; - // Inizializza la surface, caricando anche la palette se necessario + // Initialise the surface, loading the palette if necessary m_buf->Init(ds, dimx, dimy, true); - // Controlla le dimensioni della locazione + // Check the size of the location // assert(dimy!=512); - // Numero oggetti + // Number of objects ds >> m_nItems; - // Creazione e lettura degli oggetti + // Create and read in the objects if (m_nItems > 0) m_items = new RMItem[m_nItems]; @@ -2179,7 +2113,7 @@ bool RMLocation::Load(RMDataStream &ds) { ds >> m_items[i]; _vm->UnfreezeTime(); - // Setta i pattern iniziali @@@ doppione!! + // Sets the initial pattern @@@ duplication! //for (i = 0;i<m_nItems;i++) // m_items[i].SetPattern(mpalQueryItemPattern(m_items[i].MpalCode())); @@ -2192,35 +2126,35 @@ bool RMLocation::LoadLOX(RMDataStream &ds) { byte ver; int i; - // Versione + // Version ds >> ver; assert(ver == 1); - // Nome locazione + // Location name ds >> m_name; - // Numero loc + // Location number ds >> TEMPNumLoc; ds >> TEMPTonyStart.x >> TEMPTonyStart.y; - // Dimensioni + // Dimensions ds >> dimx >> dimy; m_curScroll.Set(0, 0); - // Color mode è sempre 65K + // It's always 65K (16-bit) mode m_cmode = CM_65K; m_buf = new RMGfxSourceBuffer16; - // Inizializza la surface, caricando anche la palette se necessario + // Initialise the surface, loading in the palette if necessary m_buf->Init(ds, dimx, dimy, true); - // Controlla le dimensioni della locazione + // Check the size of the location // assert(dimy!=512); - // Numero oggetti + // Number of items ds >> m_nItems; - // Creazione e lettura degli oggetti + // Create and read objects if (m_nItems > 0) m_items = new RMItem[m_nItems]; @@ -2231,54 +2165,40 @@ bool RMLocation::LoadLOX(RMDataStream &ds) { } - -/****************************************************************************\ -* -* Function: void RMLocation::Draw(RMGfxTargetBuffer* bigBuf, -* RMGfxPrimitive* prim); -* -* Description: Metodo di drawing in overloading da RMGfxSourceBuffer8 -* -\****************************************************************************/ - +/** + * Draw method overloaded from RMGfxSourceBUffer8 + */ void RMLocation::Draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive *prim) { CORO_BEGIN_CONTEXT; CORO_END_CONTEXT(_ctx); CORO_BEGIN_CODE(_ctx); - // Setta la posizione sorgente dello scrolling + // Set the position of the source scrolling if (m_buf->Dimy()>RM_SY || m_buf->Dimx()>RM_SX) { prim->SetSrc(RMRect(m_curScroll,m_curScroll+RMPoint(640,480))); } prim->SetDst(m_fixedScroll); - // Richiama il metodo di drawing della classe dell'immagine, che disegnerà il background - // della locazione + // Invoke the drawing method fo the image class, which will draw the location background CORO_INVOKE_2(m_buf->Draw, bigBuf, prim); CORO_END_CODE; } -/****************************************************************************\ -* -* Function: void RMLocation::DoFrame(void); -* -* Description: Prepara un frame, aggiungendo alla OTList la locazione stessa -* e tutti gli item che hanno cambiato frame di animazione -* -\****************************************************************************/ - +/** + * Prepare a frame, adding the location to the OT list, and all the items that have changed animation frame. + */ void RMLocation::DoFrame(RMGfxTargetBuffer *bigBuf) { int i; - // Se la locazione non e' in OT list, la aggiunge + // If the location is not in the OT list, add it in if (!m_nInList) bigBuf->AddPrim(new RMGfxPrimitive(this)); - // Processa tutti gli item della locazione + // Process all the location items for (i = 0;i < m_nItems; i++) m_items[i].DoFrame(bigBuf); } @@ -2321,13 +2241,13 @@ RMLocation::~RMLocation() { } void RMLocation::Unload(void) { - // Cancella la memoria + // Clear memory if (m_items) { delete[] m_items; m_items = NULL; } - // Cancella il buffer + // Destroy the buffer if (m_buf) { delete m_buf; m_buf = NULL; @@ -2399,7 +2319,7 @@ void RMLocation::PauseSound(bool bPause) { /****************************************************************************\ -* Metodi di RMMessage +* RMMessage Methods \****************************************************************************/ RMMessage::RMMessage(uint32 dwId) { @@ -2432,16 +2352,16 @@ void RMMessage::ParseMessage(void) { p = lpPeriods[0] = lpMessage; for (;;) { - // Trova la fine del periodo corrente + // Find the end of the current period while (*p != '\0') p++; - // Se c'e' un altro '\0' siamo alla fine del messaggio + // If there is another '0' at the end of the string, the end has been found p++; if (*p == '\0') break; - // Altrimenti c'e' un altro periodo, e ci ricordiamo il suo inizio + // Otherwise there is another line, and remember it's start lpPeriods[nPeriods++] = p; } } diff --git a/engines/tony/loc.h b/engines/tony/loc.h index e25bdb500c..4b9a18f406 100644 --- a/engines/tony/loc.h +++ b/engines/tony/loc.h @@ -128,8 +128,8 @@ public: private: int m_speed; - RMPoint m_pos; // Coordinate babbo - RMPoint m_curPos; // Coordinate babbo+figlio + RMPoint m_pos; // Parent coordinates + RMPoint m_curPos; // Parent + child coordinates int m_bLoop; int m_nSlots; int m_nCurSlot; @@ -237,29 +237,29 @@ public: friend RMDataStream& operator>>(RMDataStream &ds, RMItem &item); - // Processa l'oggetto per fare andare avanti eventuale animazioni. Ritorna TRUE se dovrà - // essere ridisegnato il prossimo frame + // Process to make the object move on any animations. + // Returns TRUE if it should be redrawn on the next frame bool DoFrame(RMGfxTargetBuffer *bigBuf, bool bAddToList = true); - // Setta la posizione corrente di scrolling + // Sets the current scrolling position void SetScrollPosition(const RMPoint &scroll); - // Overloading della funzione per la rimozione da ot list + // Overloading of check whether to remove from active list virtual void RemoveThis(CORO_PARAM, bool &result); - // Overloading del draw + // Overloaded Draw virtual void Draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive *prim); - // Overloading della priorità: è la Z + // Overloaded priority: it's based on Z ordering virtual int Priority() { return m_z; } - // Numero di pattern + // Pattern number int NumPattern() { return m_nPatterns; } - // Setta un nuovo pattern di animazione, cambiando bruscamente da quello corrente + // Set anew animation pattern, changing abruptly from the current virtual void SetPattern(int nPattern, bool bPlayP0 = false); - // Setta un nuovo status. + // Set a new status void SetStatus(int nStatus); bool IsIn(const RMPoint &pt, int *size = NULL); @@ -267,13 +267,13 @@ public: bool GetName(RMString &name); int MpalCode() { return m_mpalCode; } - // Scarica l'item + // Unload void Unload(void); - // Aspetta la fine del pattern in play + // Wait for the end of the current pattern void WaitForEndPattern(CORO_PARAM, uint32 hCustomSkip = CORO_INVALID_PID_VALUE); - // Setta un nuovo hotspot per l'oggetto + // Sets a new hotspot fro the object void ChangeHotspot(const RMPoint &pt); void SetInitCurPattern(bool status) { m_bInitCurPattern=status; } @@ -285,30 +285,30 @@ void ReadFromStream(RMDataStream& ds, bool bLOX=false); void PauseSound(bool bPause); protected: - // Crea una primitiva che ha come task l'item stesso + // Create a primitive that has as it's task this item virtual RMGfxPrimitive *NewItemPrimitive(); - // Alloca la memoria per gli sprites - virtual RMGfxSourceBuffer* NewItemSpriteBuffer(int dimx, int dimy, bool bPreRLE); + // Allocate memory for the sprites + virtual RMGfxSourceBuffer *NewItemSpriteBuffer(int dimx, int dimy, bool bPreRLE); }; -#define MAXBOXES 50 // Non si puo' cambiare, comanda cosi' il boxed -#define MAXHOTSPOT 20 // Idem +#define MAXBOXES 50 // Maximum number of allowed boxes +#define MAXHOTSPOT 20 // Maximum nimber of allowed hotspots class RMBox { public: struct T_HOTSPOT { - int hotx, hoty; // coordinate HotSpot - int destination; // destinazione HotSpot + int hotx, hoty; // Hotspot coordinates + int destination; // Hotspot destination }; public: - int left,top,right,bottom; // Vertici BoundingBox - int adj[MAXBOXES]; // Lista di adjacenza - int numhotspot; // Numero HotSpot - uint8 Zvalue; // Zvalue per quel BoundingBox - T_HOTSPOT hotspot[MAXHOTSPOT]; // Lista degli HotSpot + int left, top, right, bottom; // Vertici bounding boxes + int adj[MAXBOXES]; // List of adjacent bounding boxes + int numhotspot; // Hotspot number + uint8 Zvalue; // Z value for the bounding box + T_HOTSPOT hotspot[MAXHOTSPOT]; // List of hotspots bool attivo; bool bReversed; @@ -351,19 +351,19 @@ public: void Init(void); void Close(void); - // Prende i box di una locazione + // Get binding boxes for a given location RMBoxLoc *GetBoxes(int nLoc); - // Calcola in quale box si trova il punto + // Return the box which contains a given point int WhichBox(int nLoc, const RMPoint &pt); - // Controlla che il punto sia dentro un certo box + // Check whether a point is inside a given box bool IsInBox(int nLoc, int nBox, const RMPoint &pt); - // Cambia lo stato di un box + // Change the status of a box void ChangeBoxStatus(int nLoc, int nBox, int status); - // Salvataggi + // Save state handling int GetSaveStateSize(void); void SaveState(byte *buf); void LoadState(byte *buf); @@ -429,38 +429,38 @@ protected: bool bMoving; bool bDrawNow; bool bNeedToStop; -// virtual RMGfxPrimitive* NewItemPrimitive(); +// virtual RMGfxPrimitive *NewItemPrimitive(); public: RMCharacter(); virtual ~RMCharacter(); - void LinkToBoxes(RMGameBoxes* theBoxes); + void LinkToBoxes(RMGameBoxes *theBoxes); virtual void RemoveThis(CORO_PARAM, bool &result); - // Aggiorna la posizione del personaggio + // Update the position of a character void DoFrame(CORO_PARAM, RMGfxTargetBuffer *bigBuf, int loc); - // Overloading del Draw + // Overloaded draw virtual void Draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive *prim); - // TRUE se si è appena fermato + // TRUE if you just stopped bool EndOfPath() { return bEndOfPath; } - // Cambia il pattern del personaggio per fermarlo + // Change the pattern of a character to STOP virtual void Stop(CORO_PARAM); - // Controlla se il personaggio si sta muovendo + // Check if the character is moving bool IsMoving() { return bMoving; } - // Muove il personaggio a una certa posizione + // Move the character to a certain position void Move(CORO_PARAM, RMPoint pt, bool *result = NULL); - // Posiziona il personaggio a una certa posizione SENZA farlo muovere + // Place the character in a certain position WITHOUT moving void SetPosition(const RMPoint &pt, int newloc = -1); - // Aspetta la fine del movimento + // Wait for the end of movement void WaitForEndMovement(CORO_PARAM); void SetFixedScroll(const RMPoint &fix) { m_fixedScroll = fix; } @@ -502,16 +502,16 @@ public: */ class RMLocation : public RMGfxTaskSetPrior { public: - RMString m_name; // Nome + RMString m_name; // Name private: - RMColorMode m_cmode; // Color mode - RMGfxSourceBuffer* m_buf; // Immagine della locazione + RMColorMode m_cmode; // Color mode + RMGfxSourceBuffer *m_buf; // Location picture - int m_nItems; // Numero oggetti -RMItem* m_items; // Oggetti + int m_nItems; // Number of objects + RMItem *m_items; // Objects - RMPoint m_curScroll; // Posizione corrente di scroll + RMPoint m_curScroll; // Current scroll position RMPoint m_fixedScroll; public: @@ -526,41 +526,41 @@ public: RMLocation(); virtual ~RMLocation(); - // Caricamento da disco + // Load variations bool Load(const char *lpszFileName); bool Load(Common::File &file); bool Load(const byte *buf); bool Load(RMDataStream &ds); bool LoadLOX(RMDataStream &ds); - // Scaricamento + // Unload void Unload(void); - // Overloading del Draw + // Overloaded draw virtual void Draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive *prim); - // Prepara un frame disegnando la locazione e tutti i suoi item + // Prepare a frame by drawing the location and all it's items void DoFrame(RMGfxTargetBuffer *bigBuf); - // Si fa dare il numero dell'item + // Return the item at a given point RMItem *WhichItemIsIn(const RMPoint &pt); - // Si fa dare un elemento dal suo codice MPAL - RMItem* GetItemFromCode(uint32 dwCode); + // Return the item based on it's MPAL code + RMItem *GetItemFromCode(uint32 dwCode); - // Setta la posizione corrente di scrolling + // Set the current scroll position void SetScrollPosition(const RMPoint &scroll); - // Setta un offset aggiuntivo di scrolling da aggiungere sempre + // Sets an additinal offset for scrolling void SetFixedScroll(const RMPoint &scroll); - // Aggiorna le coordinate di scrolling in modo da visualizzare sempre il punto fornito + // Update the scrolling coordinates to display the specified point void UpdateScrolling(const RMPoint &ptShowThis); - // Legge la posizione di scrolling corrente + // Read the current scroll position RMPoint ScrollPosition() { return m_curScroll; } - // Pausa sonoro + // Pause sound void PauseSound(bool bPause); }; @@ -589,7 +589,6 @@ public: char *operator[](int num) { return lpPeriods[num]; } }; - } // End of namespace Tony #endif /* TONY_H */ diff --git a/engines/tony/tony.cpp b/engines/tony/tony.cpp index 2dbe102424..c9abea04e0 100644 --- a/engines/tony/tony.cpp +++ b/engines/tony/tony.cpp @@ -124,14 +124,12 @@ Common::ErrorCode TonyEngine::Init() { // Link to the custom graphics engine _theEngine.InitCustomDll(); - - // Inizializza il gfxEngine _theEngine.Init(); - // Memoria per il thumbnail + // Allocate space for thumbnails when saving the game m_curThumbnail = new uint16[160 * 120]; - // Configurazione di default + // Set up global defaults GLOBALS.bCfgInvLocked = false; GLOBALS.bCfgInvNoScroll = false; GLOBALS.bCfgTimerizedText = true; @@ -358,14 +356,14 @@ void TonyEngine::InitMusic() { m_sfx[i] = m_utilSfx[i] = NULL; } - // Crea la critical section per la musica + // Create the mutex for controlling music access // csMusic = g_system->createMutex(); - // Carica effetti sonori + // Preload sound effects // PreloadUtilSFX(0,"AccendiOpzione.ADP"); // PreloadUtilSFX(1,"ApriInterfaccia.ADP"); - PreloadUtilSFX(0, "U01.ADP"); // invertiti!! + PreloadUtilSFX(0, "U01.ADP"); // Reversed!! PreloadUtilSFX(1, "U02.ADP"); } diff --git a/engines/tony/tony.h b/engines/tony/tony.h index 32332a871d..8d4e357079 100644 --- a/engines/tony/tony.h +++ b/engines/tony/tony.h @@ -149,10 +149,10 @@ public: Common::Error loadGameState(int slot); Common::Error saveGameState(int slot, const Common::String &desc); - // Avverte che siamo guidati dal GDI + // Warn when are being controlled by the GDI void GDIControl(bool bCon); - // Loop che gestisce i messaggi quando siamo in pausa + // Loop that handles messages when the game is paused void PauseLoop(void); void Play(); @@ -167,7 +167,7 @@ public: void ShowLocation(void) { m_bDrawLocation = true; } void HideLocation(void) { m_bDrawLocation = false; } - // Mette o leva la pausa + // Handle pause mode void Pause(bool bPause); bool IsPaused() { return m_bPaused; } @@ -195,19 +195,19 @@ public: void PreloadUtilSFX(int nSfx, const char *fn); void UnloadAllUtilSFX(void); - // Ferma tutta la parte audio + // Stop all the audio void PauseSound(bool bPause); void SetMusicVolume(int nChannel, int volume); int GetMusicVolume(int nChannel); - // Salvataggio + // Handle saving void AutoSave(CORO_PARAM); void SaveState(int n, const char *name); void LoadState(CORO_PARAM, int n); static Common::String GetSaveStateFileName(int n); - // Prende il thumbnail + // Get a thumbnail void GrabThumbnail(void); uint16 *GetThumbnail(void) { return m_curThumbnail; } diff --git a/engines/tony/tonychar.cpp b/engines/tony/tonychar.cpp index c612ebbf77..04b6193cd2 100644 --- a/engines/tony/tonychar.cpp +++ b/engines/tony/tonychar.cpp @@ -93,10 +93,10 @@ void RMTony::Init(void) { RMRes body(9999); RMDataStream ds; - // Mostra Tony di default - m_bShow=m_bShowOmbra = true; + // Tony is shown by default + m_bShow = m_bShowOmbra = true; - // Nessuna azione in attesa + // No action pending m_bActionPending = false; m_bAction = false; @@ -104,18 +104,18 @@ void RMTony::Init(void) { m_bIsTalking = false; m_bIsStaticTalk = false; - // Apre il buffer + // Opens the buffer ds.OpenBuffer(tony); - // Legge dallo stream l'oggetto corrente (cioè Tony) - ReadFromStream(ds, true); // da OGX + // Reads his details from the stream + ReadFromStream(ds, true); - // Chiude il buffer + // Closes the buffer ds.Close(); - // Legge il corpo di Tony + // Reads Tony's body ds.OpenBuffer(body); - m_body.ReadFromStream(ds, true); // da OGX + m_body.ReadFromStream(ds, true); ds.Close(); m_body.SetPattern(0); @@ -124,7 +124,7 @@ void RMTony::Init(void) { void RMTony::Close(void) { - // Disalloca @@@ Manca la disallocazione di un item + // Disalloca @@@ Deallocation of missing item m_ombra.Destroy(); } @@ -140,7 +140,7 @@ void RMTony::DoFrame(CORO_PARAM, RMGfxTargetBuffer *bigBuf, int curLoc) { SetSpeed(GLOBALS.nCfgTonySpeed); - // Esegue il movimento normale del personaggio + // Runs the normal character movement _ctx->time = _vm->GetTime(); do { @@ -149,9 +149,9 @@ void RMTony::DoFrame(CORO_PARAM, RMGfxTargetBuffer *bigBuf, int curLoc) { } while (_ctx->time > m_nTimeLastStep + (1000 / 40)); - // Controlla se siamo alla fine del percorso + // Check if we are at the end of a path if (EndOfPath() && m_bActionPending) { - // Bisogna eseguire l'azione sulla quale abbiamo clickato + // Must perform the action on which we clicked m_bActionPending = false; } @@ -239,17 +239,16 @@ void RMTony::MoveAndDoAction(CORO_PARAM, RMPoint dst, RMItem *item, int nAction, void RMTony::ExecuteAction(int nAction, int nActionItem, int nParm) { - // fixme: See if hThread can be converted to uint32 uint32 pid; if (nAction == TA_COMBINE) { pid = mpalQueryDoAction(TA_COMBINE, nParm, nActionItem); - // Se è fallito il combine, proviamo con il ReceiveCombine + // If you failed the combine, we have RECEIVECOMBINE as a fallback if (pid == CORO_INVALID_PID_VALUE) { pid = mpalQueryDoAction(TA_RECEIVECOMBINE, nActionItem, nParm); - // Se è fallito il receive, andiamo con quelli generici + // If you failed with that, go with the generic // @@@ CombineGive! if (pid == CORO_INVALID_PID_VALUE) { pid = mpalQueryDoAction(TA_COMBINE, nParm, 0); @@ -313,15 +312,15 @@ void RMTony::Stop(CORO_PARAM) { CORO_BEGIN_CODE(_ctx); if (m_ActionItem != NULL) { - // Richiama l'MPAL per scegliere la direzione + // Call MPAL to choose the direction _ctx->pid = mpalQueryDoAction(21, m_ActionItem->MpalCode(), 0); if (_ctx->pid == CORO_INVALID_PID_VALUE) CORO_INVOKE_0(RMCharacter::Stop); else { - bNeedToStop = false; // Se facciamo la OnWhichDirection, almeno dopo non dobbiamo fare la Stop() + bNeedToStop = false; // If we make the OnWhichDirection, we don't need at least after the Stop(). bMoving = false; - CORO_INVOKE_2(CoroScheduler.waitForSingleObject, _ctx->pid, CORO_INFINITE); // @@@ Mettere un assert dopo 10 secondi + CORO_INVOKE_2(CoroScheduler.waitForSingleObject, _ctx->pid, CORO_INFINITE); // @@@ Put an assert after 10 seconds } } else { CORO_INVOKE_0(RMCharacter::Stop); @@ -406,7 +405,7 @@ void RMTony::Take(int nWhere, int nPart) { if (nPart == 0) { switch (GetCurPattern()) { case PAT_STANDDOWN: - assert(0); // Non esiste il prende mentre sei in StandDown + assert(0); // Not while you're doing a StandDown break; case PAT_STANDUP: @@ -481,7 +480,7 @@ void RMTony::Put(int nWhere, int nPart) { if (nPart == 0) { switch (GetCurPattern()) { case PAT_STANDDOWN: - //assert(0); // Non esiste il prende mentre sei in StandDown + //assert(0); break; case PAT_STANDUP: @@ -560,7 +559,7 @@ bool RMTony::StartTalkCalculate(TALKTYPE nTalkType, int &headStartPat, int &body m_nPatB4Talking = GetCurPattern(); m_nTalkType = nTalkType; - // Setta la direzione di parlata SOLO se non siamo in una static animation (perché l'ha già fatto) + // Set the direction of speech ONLY if we are not in a static animation (since it would have already been done) if (!m_bIsStaticTalk) { switch (m_nPatB4Talking) { case PAT_STANDDOWN: @@ -591,12 +590,12 @@ bool RMTony::StartTalkCalculate(TALKTYPE nTalkType, int &headStartPat, int &body break; } - // Mette davanti il corpo di default + // Puts the body in front by default m_bCorpoDavanti = true; } if (m_bPastorella) { - // Da pastorella, c'è un solo parlato + // Talking whilst a shepherdess MainFreeze(); switch (m_TalkDirection) { case UP: @@ -967,8 +966,7 @@ bool RMTony::StartTalkCalculate(TALKTYPE nTalkType, int &headStartPat, int &body } break; - // La barba è l'unico caso in cui la testa è animata a parte - // mentre il corpo è quello standard + // The beard is the only case in which the head is animated separately while the body is the standard case TALK_CONBARBASTATIC: switch (m_TalkDirection) { case LEFT: @@ -1127,7 +1125,7 @@ void RMTony::StartTalk(CORO_PARAM, TALKTYPE nTalkType) { _ctx->headLoopPat, _ctx->bodyLoopPat)) return; - // Esegue il set dei pattern vero e proprio + // Perform the set pattern if (_ctx->headStartPat != 0 || _ctx->bodyStartPat != 0) { MainFreeze(); SetPattern(_ctx->headStartPat); @@ -1446,7 +1444,7 @@ void RMTony::EndTalk(CORO_PARAM) { if (!EndTalkCalculate(_ctx->headStandPat, _ctx->headEndPat, _ctx->bodyEndPat, _ctx->finalPat, _ctx->bStatic)) return; - // Gestisce la fine di una animazione static lasciando tutto invariato + // Handles the end of an animated and static, leaving everything unchanged if (m_bIsStaticTalk) { if (m_nTalkType == TALK_CONBARBASTATIC) { MainFreeze(); @@ -1471,7 +1469,7 @@ void RMTony::EndTalk(CORO_PARAM) { return; } - // Set dei pattern + // Set the pattern if (_ctx->headEndPat != 0 && _ctx->bodyEndPat != 0) { MainFreeze(); SetPattern(_ctx->headEndPat); diff --git a/engines/tony/tonychar.h b/engines/tony/tonychar.h index 201803dc5f..a7109256f5 100644 --- a/engines/tony/tonychar.h +++ b/engines/tony/tonychar.h @@ -106,13 +106,13 @@ private: uint32 hActionThread; protected: - // Overload dell'allocazione degli sprites per cambiare il tipo + // Overload of the allocation allocation of sprites virtual RMGfxSourceBuffer *NewItemSpriteBuffer(int dimx, int dimy, bool bPreRLE); - // Thread which waits for the end of an action + // Watch thread which waits for the end of an action static void WaitEndOfAction(CORO_PARAM, const void *param); -public: // per farlo rialzare, altrimenti private +public: enum PATTERNS { PAT_TAKEUP_UP1 = 9, PAT_TAKEUP_UP2, @@ -140,7 +140,7 @@ public: // per farlo rialzare, altrimenti private PAT_SIRIALZARIGHT, PAT_PERTERRARIGHT, - // Pastorella! + // Sheperdess! PAT_PAST_WALKUP, PAT_PAST_WALKDOWN, PAT_PAST_WALKLEFT, @@ -151,19 +151,19 @@ public: // per farlo rialzare, altrimenti private PAT_PAST_STANDLEFT, PAT_PAST_STANDRIGHT, - // Parlata + // Speech PAT_TALK_UP, PAT_TALK_DOWN, PAT_TALK_LEFT, PAT_TALK_RIGHT, - // Testa statica + // Static head PAT_TESTA_UP, PAT_TESTA_DOWN, PAT_TESTA_LEFT, PAT_TESTA_RIGHT, - // Risata + // Laugh PAT_RIDELEFT_START, PAT_RIDELEFT_LOOP, PAT_RIDELEFT_END, @@ -171,13 +171,13 @@ public: // per farlo rialzare, altrimenti private PAT_RIDERIGHT_LOOP, PAT_RIDERIGHT_END, - // Parlata da pastorella + // Speaking as a shepherdess PAT_PAST_TALKUP, PAT_PAST_TALKDOWN, PAT_PAST_TALKLEFT, PAT_PAST_TALKRIGHT, - // Spavento + // Fear PAT_SPAVENTOLEFT_START, PAT_SPAVENTOLEFT_LOOP, PAT_SPAVENTOLEFT_END, @@ -188,16 +188,16 @@ public: // per farlo rialzare, altrimenti private PAT_SPAVENTODOWN_LOOP, PAT_SPAVENTODOWN_END, - // Con oggetti: corpo completo + // With objects: full body PAT_CONBICCHIERE, PAT_CONCORDA, PAT_CONVERME, PAT_CONMARTELLO, - // Suona il fischietto + // Sound the whistle PAT_FISCHIETTORIGHT, - // Testa con barba + // Head with beard PAT_TALKBARBA_LEFT, PAT_TALKBARBA_RIGHT, @@ -205,7 +205,7 @@ public: // per farlo rialzare, altrimenti private PAT_SNIFFA_LEFT, PAT_SNIFFA_RIGHT, - // Schifato + // Disgusted PAT_SCHIFATOLEFT_START, PAT_SCHIFATOLEFT_LOOP, PAT_SCHIFATOLEFT_END, @@ -219,7 +219,7 @@ public: // per farlo rialzare, altrimenti private PAT_NAAHRIGHT_LOOP, PAT_NAAHRIGHT_END, - // Stand spaventato + // Stand scared PAT_SPAVENTOLEFT_STAND, PAT_SPAVENTORIGHT_STAND, PAT_SPAVENTODOWN_STAND, @@ -361,81 +361,80 @@ public: static void InitStatics(); RMTony(); - // Inizializza Tony + // Initialise Tony void Init(void); - // Libera tutta la memoria + // Free all memory void Close(void); - // Fa un frame di Tony, aggiornando il movimento, etc + // Tony makes a frame, updating the movement, etc. void DoFrame(CORO_PARAM, RMGfxTargetBuffer *bigBuf, int curLoc); - // Metodi di Draw, che controlla la variabile di show + // Draw method, which controls chararacter display virtual void Draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive *prim); - // Mostra o nascondi + // Show or hide void Show(void); void Hide(bool bShowOmbra = false); - // Si muove e fa un azione, se necessario + // Move and make an action, if necessary void MoveAndDoAction(CORO_PARAM, RMPoint dst, RMItem *item, int nAction, int nActionParm = 0); - // Ferma Tony (dalla parte giusta rispetto a un eventuale oggetto) + // Tony stops (on the right side with respect to any subject) virtual void Stop(CORO_PARAM); void StopNoAction(CORO_PARAM); - // Setta un pattern + // Set a pattern void SetPattern(int npatt, bool bPlayP0 = false); - // Legge il pattern corrente + // Reads the current pattern int GetCurPattern(); - // Attende la fine di un pattern + // Waits until the end of a pattern void WaitForEndPattern(CORO_PARAM, uint32 hCustomSkip = CORO_INVALID_PID_VALUE) { RMCharacter::WaitForEndPattern(coroParam, hCustomSkip); } - // Controlla se si trova in azione - bool InAction() { return (m_bActionPending&&m_Action != 0) | m_bAction; } + // Check if currently in an action + bool InAction() { return (m_bActionPending && m_Action != 0) | m_bAction; } - // Controlla se c'è da aggiornare il movimento di scrolling + // Check if there needs to be an update for scrolling movement bool MustUpdateScrolling() { return ((!InAction()) || (IsMoving())); } - // Prende la posizione di Tony + // Returns Tony's position RMPoint Position() { return m_pos; } - // Setta la posizione di scrolling + // Set the scrolling position void SetScrollPosition(const RMPoint &pt) { RMCharacter::SetScrollPosition(pt); } - // Setta l'animazione di Take + // Set the take animation void Take(int nWhere, int nPart); void Put(int nWhere, int nPart); - // Start e End Talk + // Start or End Talk bool StartTalkCalculate(TALKTYPE nTalkType, int &headStartPat, int &bodyStartPat, int &headLoopPat, int &bodyLoopPat); void StartTalk(CORO_PARAM, TALKTYPE nTalkType); bool EndTalkCalculate(int &headStandPat, int &headEndPat, int &bodyEndPat, int &finalPat, bool &bStatic); void EndTalk(CORO_PARAM); - // Start e End Static + // Start or End Static void StartStaticCalculate(TALKTYPE nTalk, int &headPat, int &headLoopPat, int &bodyStartPat, int &bodyLoopPat); void StartStatic(CORO_PARAM, TALKTYPE nTalkType); void EndStaticCalculate(TALKTYPE nTalk, int &bodyEndPat, int &finalPat, int &headEndPat); void EndStatic(CORO_PARAM, TALKTYPE nTalkType); - // Tony si traveste! + // Tony disguises himself! void SetPastorella(bool bIsPast) { m_bPastorella=bIsPast; } int GetPastorella(void) { return m_bPastorella; } - // Esegue una azione + // Perform an action void ExecuteAction(int nAction, int nActionItem, int nParm); void PlaySfx(int nSfx) { RMItem::PlaySfx(nSfx); } }; - } // End of namespace Tony #endif diff --git a/engines/tony/utils.cpp b/engines/tony/utils.cpp index d57640fee8..9aaffefceb 100644 --- a/engines/tony/utils.cpp +++ b/engines/tony/utils.cpp @@ -40,9 +40,9 @@ namespace Tony { * Constructor */ RMString::RMString() { - m_string=NULL; - m_length=0; - m_realLength=0; + m_string = NULL; + m_length = 0; + m_realLength = 0; } /** @@ -188,8 +188,8 @@ const RMString& RMString::operator=(const int ch) { // Destroy the current string if (m_realLength > 0) { delete [] m_string; - m_string=NULL; - m_length=m_realLength=0; + m_string = NULL; + m_length = m_realLength = 0; } } else { // Resize if necessary @@ -213,7 +213,7 @@ void RMString::Connect(const char *str, int size) { if (size > 0) { // Calculate the new lenght - nlen=m_length+size; + nlen = m_length+size; // Resize Resize(nlen + 1, true); @@ -242,7 +242,7 @@ const RMString &RMString::operator+=(RMString &str) { * @returns Refrence to our string */ const RMString &RMString::operator+=(const char *str) { - Connect(str,strlen(str)); + Connect(str, strlen(str)); return *this; } @@ -385,7 +385,7 @@ void RMString::Format(const char *str, ...) { } /****************************************************************************\ -* Metodi di RMFileStreamSlow +* RMFileStreamSlow Methods \****************************************************************************/ RMFileStreamSlow::RMFileStreamSlow() : RMDataStream() { @@ -410,7 +410,7 @@ bool RMFileStreamSlow::OpenFile(Common::File &file) { bool RMFileStreamSlow::OpenFile(const char *lpFN) { - // Apre il file in lettura + // Open file for reading Common::File f; if (!f.open(lpFN)) return false; @@ -679,13 +679,13 @@ int RMDataStream::Seek(int nBytes, RMDSPos origin) { break; case START: - m_pos=0; + m_pos = 0; break; case END: if (m_length == SIZENOTKNOWN) return m_pos; - m_pos=m_length; + m_pos = m_length; break; } @@ -741,8 +741,8 @@ RMPoint::RMPoint() { * Copy constructor */ RMPoint::RMPoint(const RMPoint &p) { - x=p.x; - y=p.y; + x = p.x; + y = p.y; } /** @@ -969,13 +969,13 @@ RMRect operator-(const RMRect& rc, RMPoint p) { RMRect operator+(RMPoint p, const RMRect& rc) { RMRect r(rc); - return (r+=p); + return (r += p); } RMRect operator-(RMPoint p, const RMRect& rc) { RMRect r(rc); - return (r+=p); + return (r += p); } bool RMRect::operator==(const RMRect& rc) { @@ -987,7 +987,7 @@ bool RMRect::operator!=(const RMRect& rc) { } void RMRect::NormalizeRect(void) { - SetRect(MIN(x1,x2), MIN(y1,y2), MAX(x1,x2), MAX(y1,y2)); + SetRect(MIN(x1, x2), MIN(y1, y2), MAX(x1, x2), MAX(y1, y2)); } RMDataStream &operator>>(RMDataStream &ds, RMRect &rc) { @@ -1029,7 +1029,7 @@ void RMResUpdate::Init(const Common::String &fileName) { _infos = new ResUpdInfo[_numUpd]; // Load the index of the resources in the file - for (i=0; i<_numUpd; ++i) { + for (i = 0; i < _numUpd; ++i) { ResUpdInfo &info = _infos[i]; info.dwRes = _hFile.readUint32LE(); @@ -1045,7 +1045,7 @@ HGLOBAL RMResUpdate::QueryResource(uint32 dwRes) { return NULL; uint32 i; - for (i=0; i < _numUpd; ++i) + for (i = 0; i < _numUpd; ++i) if (_infos[i].dwRes == dwRes) // Found the index break; diff --git a/engines/tony/utils.h b/engines/tony/utils.h index 1e3841c185..c823421c62 100644 --- a/engines/tony/utils.h +++ b/engines/tony/utils.h @@ -71,7 +71,7 @@ public: void OpenBuffer(const byte *buf, int size = SIZENOTKNOWN); void Close(void); - // Attributi + // Attributei int Length(); virtual int Pos(); @@ -86,14 +86,14 @@ public: friend RMDataStream &operator>>(RMDataStream &df, int &var); friend RMDataStream &operator>>(RMDataStream &df, uint32 &var); - // Lettura generica + // General read virtual bool Read(void *buf, int size); // Skipping & Seeking virtual RMDataStream &operator+=(int nBytes); virtual int Seek(int nBytes, RMDSPos origin = CUR); - // Gestione errori + // Error handling void SetError(int ecode); int GetError(); bool IsError(); @@ -111,7 +111,7 @@ public: RMFileStream(); virtual ~RMFileStream(); - // Apre lo stream da file + // Methods for opening file bool OpenFile(const char *lpFN); bool OpenFile(Common::File &file); @@ -165,7 +165,7 @@ public: RMString(const char *str); RMString(const int ch); - // Metodi generici + // General methods int Length() const; void Compact(); @@ -196,10 +196,10 @@ public: friend RMString operator+(RMString &str, const char *s); friend RMString operator+(const char *s, RMString &str); - // Estrazione da data stream + // Extraction from data streams friend RMDataStream& operator>>(RMDataStream& df, RMString &var); - // Formattazione di stringa + // String formatting void Format(const char *str, ...); private: @@ -220,11 +220,11 @@ public: RMPoint(const RMPoint &p); RMPoint(int x1, int y1); - // Copia + // Copy RMPoint& operator=(RMPoint p); // Set - void Set(int x1, int y1) { x=x1; y=y1; } + void Set(int x1, int y1) { x = x1; y = y1; } // Offset void Offset(int xOff, int yOff); @@ -235,7 +235,7 @@ public: RMPoint &operator-=(RMPoint p); RMPoint operator-(); - // Confronti + // Comparison bool operator==(RMPoint p); bool operator!=(RMPoint p); diff --git a/engines/tony/window.cpp b/engines/tony/window.cpp index 26dbaf88fc..481393c5ed 100644 --- a/engines/tony/window.cpp +++ b/engines/tony/window.cpp @@ -245,9 +245,9 @@ void RMSnapshot::GrabScreenshot(byte *lpBuf, int dezoom, uint16 *lpDestBuf) { else curv = v; - sommab += cursrc[curv*RM_BBX + u] & 0x1F; - sommag += (cursrc[curv*RM_BBX + u] >> 5) & 0x1F; - sommar += (cursrc[curv*RM_BBX + u] >> 10) & 0x1F; + sommab += cursrc[curv * RM_BBX + u] & 0x1F; + sommag += (cursrc[curv * RM_BBX + u] >> 5) & 0x1F; + sommar += (cursrc[curv * RM_BBX + u] >> 10) & 0x1F; } } rgb[k + 0] = (byte) (sommab * 8 / (dezoom * dezoom)); diff --git a/engines/tony/window.h b/engines/tony/window.h index 9483f693ab..73cc6d2005 100644 --- a/engines/tony/window.h +++ b/engines/tony/window.h @@ -78,21 +78,21 @@ public: RMWindow(); ~RMWindow(); - // Initialization + // Initialisation void Init(/*HINSTANCE hInst*/); void InitDirectDraw(void); void Close(void); - // Repaint grafico tramite DirectDraw + // Drawing void Repaint(void); - // Switch tra windowed e fullscreen + // Switch between windowed and fullscreen void SwitchFullscreen(bool bFull) {} - // Legge il prossimo frame + // Reads the next frame void GetNewFrame(byte *lpBuf, Common::Rect *rcBoundEllipse); - // Avverte di grabbare un thumbnail per il salvataggio + // Request a thumbnail be grabbed during the next frame void GrabThumbnail(uint16 *buf); int getFps() const { return fps; } |