TONY: Converting Italian comments to English and formatting

This commit is contained in:
Paul Gilbert 2012-05-20 13:54:59 +10:00
parent 333c30b8c7
commit 0450275c44
10 changed files with 433 additions and 519 deletions

File diff suppressed because it is too large Load diff

View file

@ -128,8 +128,8 @@ public:
private: private:
int m_speed; int m_speed;
RMPoint m_pos; // Coordinate babbo RMPoint m_pos; // Parent coordinates
RMPoint m_curPos; // Coordinate babbo+figlio RMPoint m_curPos; // Parent + child coordinates
int m_bLoop; int m_bLoop;
int m_nSlots; int m_nSlots;
int m_nCurSlot; int m_nCurSlot;
@ -237,29 +237,29 @@ public:
friend RMDataStream& operator>>(RMDataStream &ds, RMItem &item); friend RMDataStream& operator>>(RMDataStream &ds, RMItem &item);
// Processa l'oggetto per fare andare avanti eventuale animazioni. Ritorna TRUE se dovrà // Process to make the object move on any animations.
// essere ridisegnato il prossimo frame // Returns TRUE if it should be redrawn on the next frame
bool DoFrame(RMGfxTargetBuffer *bigBuf, bool bAddToList = true); bool DoFrame(RMGfxTargetBuffer *bigBuf, bool bAddToList = true);
// Setta la posizione corrente di scrolling // Sets the current scrolling position
void SetScrollPosition(const RMPoint &scroll); 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); virtual void RemoveThis(CORO_PARAM, bool &result);
// Overloading del draw // Overloaded Draw
virtual void Draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive *prim); 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; } virtual int Priority() { return m_z; }
// Numero di pattern // Pattern number
int NumPattern() { return m_nPatterns; } 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); virtual void SetPattern(int nPattern, bool bPlayP0 = false);
// Setta un nuovo status. // Set a new status
void SetStatus(int nStatus); void SetStatus(int nStatus);
bool IsIn(const RMPoint &pt, int *size = NULL); bool IsIn(const RMPoint &pt, int *size = NULL);
@ -267,13 +267,13 @@ public:
bool GetName(RMString &name); bool GetName(RMString &name);
int MpalCode() { return m_mpalCode; } int MpalCode() { return m_mpalCode; }
// Scarica l'item // Unload
void Unload(void); 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); 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 ChangeHotspot(const RMPoint &pt);
void SetInitCurPattern(bool status) { m_bInitCurPattern=status; } void SetInitCurPattern(bool status) { m_bInitCurPattern=status; }
@ -285,30 +285,30 @@ void ReadFromStream(RMDataStream& ds, bool bLOX=false);
void PauseSound(bool bPause); void PauseSound(bool bPause);
protected: 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(); virtual RMGfxPrimitive *NewItemPrimitive();
// Alloca la memoria per gli sprites // Allocate memory for the sprites
virtual RMGfxSourceBuffer* NewItemSpriteBuffer(int dimx, int dimy, bool bPreRLE); virtual RMGfxSourceBuffer *NewItemSpriteBuffer(int dimx, int dimy, bool bPreRLE);
}; };
#define MAXBOXES 50 // Non si puo' cambiare, comanda cosi' il boxed #define MAXBOXES 50 // Maximum number of allowed boxes
#define MAXHOTSPOT 20 // Idem #define MAXHOTSPOT 20 // Maximum nimber of allowed hotspots
class RMBox { class RMBox {
public: public:
struct T_HOTSPOT { struct T_HOTSPOT {
int hotx, hoty; // coordinate HotSpot int hotx, hoty; // Hotspot coordinates
int destination; // destinazione HotSpot int destination; // Hotspot destination
}; };
public: public:
int left,top,right,bottom; // Vertici BoundingBox int left, top, right, bottom; // Vertici bounding boxes
int adj[MAXBOXES]; // Lista di adjacenza int adj[MAXBOXES]; // List of adjacent bounding boxes
int numhotspot; // Numero HotSpot int numhotspot; // Hotspot number
uint8 Zvalue; // Zvalue per quel BoundingBox uint8 Zvalue; // Z value for the bounding box
T_HOTSPOT hotspot[MAXHOTSPOT]; // Lista degli HotSpot T_HOTSPOT hotspot[MAXHOTSPOT]; // List of hotspots
bool attivo; bool attivo;
bool bReversed; bool bReversed;
@ -351,19 +351,19 @@ public:
void Init(void); void Init(void);
void Close(void); void Close(void);
// Prende i box di una locazione // Get binding boxes for a given location
RMBoxLoc *GetBoxes(int nLoc); 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); 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); 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); void ChangeBoxStatus(int nLoc, int nBox, int status);
// Salvataggi // Save state handling
int GetSaveStateSize(void); int GetSaveStateSize(void);
void SaveState(byte *buf); void SaveState(byte *buf);
void LoadState(byte *buf); void LoadState(byte *buf);
@ -429,38 +429,38 @@ protected:
bool bMoving; bool bMoving;
bool bDrawNow; bool bDrawNow;
bool bNeedToStop; bool bNeedToStop;
// virtual RMGfxPrimitive* NewItemPrimitive(); // virtual RMGfxPrimitive *NewItemPrimitive();
public: public:
RMCharacter(); RMCharacter();
virtual ~RMCharacter(); virtual ~RMCharacter();
void LinkToBoxes(RMGameBoxes* theBoxes); void LinkToBoxes(RMGameBoxes *theBoxes);
virtual void RemoveThis(CORO_PARAM, bool &result); 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); void DoFrame(CORO_PARAM, RMGfxTargetBuffer *bigBuf, int loc);
// Overloading del Draw // Overloaded draw
virtual void Draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive *prim); virtual void Draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive *prim);
// TRUE se si è appena fermato // TRUE if you just stopped
bool EndOfPath() { return bEndOfPath; } bool EndOfPath() { return bEndOfPath; }
// Cambia il pattern del personaggio per fermarlo // Change the pattern of a character to STOP
virtual void Stop(CORO_PARAM); virtual void Stop(CORO_PARAM);
// Controlla se il personaggio si sta muovendo // Check if the character is moving
bool IsMoving() { return bMoving; } 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); 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); void SetPosition(const RMPoint &pt, int newloc = -1);
// Aspetta la fine del movimento // Wait for the end of movement
void WaitForEndMovement(CORO_PARAM); void WaitForEndMovement(CORO_PARAM);
void SetFixedScroll(const RMPoint &fix) { m_fixedScroll = fix; } void SetFixedScroll(const RMPoint &fix) { m_fixedScroll = fix; }
@ -502,16 +502,16 @@ public:
*/ */
class RMLocation : public RMGfxTaskSetPrior { class RMLocation : public RMGfxTaskSetPrior {
public: public:
RMString m_name; // Nome RMString m_name; // Name
private: private:
RMColorMode m_cmode; // Color mode RMColorMode m_cmode; // Color mode
RMGfxSourceBuffer* m_buf; // Immagine della locazione RMGfxSourceBuffer *m_buf; // Location picture
int m_nItems; // Numero oggetti int m_nItems; // Number of objects
RMItem* m_items; // Oggetti RMItem *m_items; // Objects
RMPoint m_curScroll; // Posizione corrente di scroll RMPoint m_curScroll; // Current scroll position
RMPoint m_fixedScroll; RMPoint m_fixedScroll;
public: public:
@ -526,41 +526,41 @@ public:
RMLocation(); RMLocation();
virtual ~RMLocation(); virtual ~RMLocation();
// Caricamento da disco // Load variations
bool Load(const char *lpszFileName); bool Load(const char *lpszFileName);
bool Load(Common::File &file); bool Load(Common::File &file);
bool Load(const byte *buf); bool Load(const byte *buf);
bool Load(RMDataStream &ds); bool Load(RMDataStream &ds);
bool LoadLOX(RMDataStream &ds); bool LoadLOX(RMDataStream &ds);
// Scaricamento // Unload
void Unload(void); void Unload(void);
// Overloading del Draw // Overloaded draw
virtual void Draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive *prim); 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); void DoFrame(RMGfxTargetBuffer *bigBuf);
// Si fa dare il numero dell'item // Return the item at a given point
RMItem *WhichItemIsIn(const RMPoint &pt); RMItem *WhichItemIsIn(const RMPoint &pt);
// Si fa dare un elemento dal suo codice MPAL // Return the item based on it's MPAL code
RMItem* GetItemFromCode(uint32 dwCode); RMItem *GetItemFromCode(uint32 dwCode);
// Setta la posizione corrente di scrolling // Set the current scroll position
void SetScrollPosition(const RMPoint &scroll); 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); 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); void UpdateScrolling(const RMPoint &ptShowThis);
// Legge la posizione di scrolling corrente // Read the current scroll position
RMPoint ScrollPosition() { return m_curScroll; } RMPoint ScrollPosition() { return m_curScroll; }
// Pausa sonoro // Pause sound
void PauseSound(bool bPause); void PauseSound(bool bPause);
}; };
@ -589,7 +589,6 @@ public:
char *operator[](int num) { return lpPeriods[num]; } char *operator[](int num) { return lpPeriods[num]; }
}; };
} // End of namespace Tony } // End of namespace Tony
#endif /* TONY_H */ #endif /* TONY_H */

View file

@ -124,14 +124,12 @@ Common::ErrorCode TonyEngine::Init() {
// Link to the custom graphics engine // Link to the custom graphics engine
_theEngine.InitCustomDll(); _theEngine.InitCustomDll();
// Inizializza il gfxEngine
_theEngine.Init(); _theEngine.Init();
// Memoria per il thumbnail // Allocate space for thumbnails when saving the game
m_curThumbnail = new uint16[160 * 120]; m_curThumbnail = new uint16[160 * 120];
// Configurazione di default // Set up global defaults
GLOBALS.bCfgInvLocked = false; GLOBALS.bCfgInvLocked = false;
GLOBALS.bCfgInvNoScroll = false; GLOBALS.bCfgInvNoScroll = false;
GLOBALS.bCfgTimerizedText = true; GLOBALS.bCfgTimerizedText = true;
@ -358,14 +356,14 @@ void TonyEngine::InitMusic() {
m_sfx[i] = m_utilSfx[i] = NULL; 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(); // csMusic = g_system->createMutex();
// Carica effetti sonori // Preload sound effects
// PreloadUtilSFX(0,"AccendiOpzione.ADP"); // PreloadUtilSFX(0,"AccendiOpzione.ADP");
// PreloadUtilSFX(1,"ApriInterfaccia.ADP"); // PreloadUtilSFX(1,"ApriInterfaccia.ADP");
PreloadUtilSFX(0, "U01.ADP"); // invertiti!! PreloadUtilSFX(0, "U01.ADP"); // Reversed!!
PreloadUtilSFX(1, "U02.ADP"); PreloadUtilSFX(1, "U02.ADP");
} }

View file

@ -149,10 +149,10 @@ public:
Common::Error loadGameState(int slot); Common::Error loadGameState(int slot);
Common::Error saveGameState(int slot, const Common::String &desc); 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); 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 PauseLoop(void);
void Play(); void Play();
@ -167,7 +167,7 @@ public:
void ShowLocation(void) { m_bDrawLocation = true; } void ShowLocation(void) { m_bDrawLocation = true; }
void HideLocation(void) { m_bDrawLocation = false; } void HideLocation(void) { m_bDrawLocation = false; }
// Mette o leva la pausa // Handle pause mode
void Pause(bool bPause); void Pause(bool bPause);
bool IsPaused() { return m_bPaused; } bool IsPaused() { return m_bPaused; }
@ -195,19 +195,19 @@ public:
void PreloadUtilSFX(int nSfx, const char *fn); void PreloadUtilSFX(int nSfx, const char *fn);
void UnloadAllUtilSFX(void); void UnloadAllUtilSFX(void);
// Ferma tutta la parte audio // Stop all the audio
void PauseSound(bool bPause); void PauseSound(bool bPause);
void SetMusicVolume(int nChannel, int volume); void SetMusicVolume(int nChannel, int volume);
int GetMusicVolume(int nChannel); int GetMusicVolume(int nChannel);
// Salvataggio // Handle saving
void AutoSave(CORO_PARAM); void AutoSave(CORO_PARAM);
void SaveState(int n, const char *name); void SaveState(int n, const char *name);
void LoadState(CORO_PARAM, int n); void LoadState(CORO_PARAM, int n);
static Common::String GetSaveStateFileName(int n); static Common::String GetSaveStateFileName(int n);
// Prende il thumbnail // Get a thumbnail
void GrabThumbnail(void); void GrabThumbnail(void);
uint16 *GetThumbnail(void) { return m_curThumbnail; } uint16 *GetThumbnail(void) { return m_curThumbnail; }

View file

@ -93,10 +93,10 @@ void RMTony::Init(void) {
RMRes body(9999); RMRes body(9999);
RMDataStream ds; RMDataStream ds;
// Mostra Tony di default // Tony is shown by default
m_bShow=m_bShowOmbra = true; m_bShow = m_bShowOmbra = true;
// Nessuna azione in attesa // No action pending
m_bActionPending = false; m_bActionPending = false;
m_bAction = false; m_bAction = false;
@ -104,18 +104,18 @@ void RMTony::Init(void) {
m_bIsTalking = false; m_bIsTalking = false;
m_bIsStaticTalk = false; m_bIsStaticTalk = false;
// Apre il buffer // Opens the buffer
ds.OpenBuffer(tony); ds.OpenBuffer(tony);
// Legge dallo stream l'oggetto corrente (cioè Tony) // Reads his details from the stream
ReadFromStream(ds, true); // da OGX ReadFromStream(ds, true);
// Chiude il buffer // Closes the buffer
ds.Close(); ds.Close();
// Legge il corpo di Tony // Reads Tony's body
ds.OpenBuffer(body); ds.OpenBuffer(body);
m_body.ReadFromStream(ds, true); // da OGX m_body.ReadFromStream(ds, true);
ds.Close(); ds.Close();
m_body.SetPattern(0); m_body.SetPattern(0);
@ -124,7 +124,7 @@ void RMTony::Init(void) {
void RMTony::Close(void) { void RMTony::Close(void) {
// Disalloca @@@ Manca la disallocazione di un item // Disalloca @@@ Deallocation of missing item
m_ombra.Destroy(); m_ombra.Destroy();
} }
@ -140,7 +140,7 @@ void RMTony::DoFrame(CORO_PARAM, RMGfxTargetBuffer *bigBuf, int curLoc) {
SetSpeed(GLOBALS.nCfgTonySpeed); SetSpeed(GLOBALS.nCfgTonySpeed);
// Esegue il movimento normale del personaggio // Runs the normal character movement
_ctx->time = _vm->GetTime(); _ctx->time = _vm->GetTime();
do { do {
@ -149,9 +149,9 @@ void RMTony::DoFrame(CORO_PARAM, RMGfxTargetBuffer *bigBuf, int curLoc) {
} while (_ctx->time > m_nTimeLastStep + (1000 / 40)); } 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) { if (EndOfPath() && m_bActionPending) {
// Bisogna eseguire l'azione sulla quale abbiamo clickato // Must perform the action on which we clicked
m_bActionPending = false; 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) { void RMTony::ExecuteAction(int nAction, int nActionItem, int nParm) {
// fixme: See if hThread can be converted to uint32
uint32 pid; uint32 pid;
if (nAction == TA_COMBINE) { if (nAction == TA_COMBINE) {
pid = mpalQueryDoAction(TA_COMBINE, nParm, nActionItem); 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) { if (pid == CORO_INVALID_PID_VALUE) {
pid = mpalQueryDoAction(TA_RECEIVECOMBINE, nActionItem, nParm); pid = mpalQueryDoAction(TA_RECEIVECOMBINE, nActionItem, nParm);
// Se è fallito il receive, andiamo con quelli generici // If you failed with that, go with the generic
// @@@ CombineGive! // @@@ CombineGive!
if (pid == CORO_INVALID_PID_VALUE) { if (pid == CORO_INVALID_PID_VALUE) {
pid = mpalQueryDoAction(TA_COMBINE, nParm, 0); pid = mpalQueryDoAction(TA_COMBINE, nParm, 0);
@ -313,15 +312,15 @@ void RMTony::Stop(CORO_PARAM) {
CORO_BEGIN_CODE(_ctx); CORO_BEGIN_CODE(_ctx);
if (m_ActionItem != NULL) { 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); _ctx->pid = mpalQueryDoAction(21, m_ActionItem->MpalCode(), 0);
if (_ctx->pid == CORO_INVALID_PID_VALUE) if (_ctx->pid == CORO_INVALID_PID_VALUE)
CORO_INVOKE_0(RMCharacter::Stop); CORO_INVOKE_0(RMCharacter::Stop);
else { 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; 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 { } else {
CORO_INVOKE_0(RMCharacter::Stop); CORO_INVOKE_0(RMCharacter::Stop);
@ -406,7 +405,7 @@ void RMTony::Take(int nWhere, int nPart) {
if (nPart == 0) { if (nPart == 0) {
switch (GetCurPattern()) { switch (GetCurPattern()) {
case PAT_STANDDOWN: case PAT_STANDDOWN:
assert(0); // Non esiste il prende mentre sei in StandDown assert(0); // Not while you're doing a StandDown
break; break;
case PAT_STANDUP: case PAT_STANDUP:
@ -481,7 +480,7 @@ void RMTony::Put(int nWhere, int nPart) {
if (nPart == 0) { if (nPart == 0) {
switch (GetCurPattern()) { switch (GetCurPattern()) {
case PAT_STANDDOWN: case PAT_STANDDOWN:
//assert(0); // Non esiste il prende mentre sei in StandDown //assert(0);
break; break;
case PAT_STANDUP: case PAT_STANDUP:
@ -560,7 +559,7 @@ bool RMTony::StartTalkCalculate(TALKTYPE nTalkType, int &headStartPat, int &body
m_nPatB4Talking = GetCurPattern(); m_nPatB4Talking = GetCurPattern();
m_nTalkType = nTalkType; 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) { if (!m_bIsStaticTalk) {
switch (m_nPatB4Talking) { switch (m_nPatB4Talking) {
case PAT_STANDDOWN: case PAT_STANDDOWN:
@ -591,12 +590,12 @@ bool RMTony::StartTalkCalculate(TALKTYPE nTalkType, int &headStartPat, int &body
break; break;
} }
// Mette davanti il corpo di default // Puts the body in front by default
m_bCorpoDavanti = true; m_bCorpoDavanti = true;
} }
if (m_bPastorella) { if (m_bPastorella) {
// Da pastorella, c'è un solo parlato // Talking whilst a shepherdess
MainFreeze(); MainFreeze();
switch (m_TalkDirection) { switch (m_TalkDirection) {
case UP: case UP:
@ -967,8 +966,7 @@ bool RMTony::StartTalkCalculate(TALKTYPE nTalkType, int &headStartPat, int &body
} }
break; break;
// La barba è l'unico caso in cui la testa è animata a parte // The beard is the only case in which the head is animated separately while the body is the standard
// mentre il corpo è quello standard
case TALK_CONBARBASTATIC: case TALK_CONBARBASTATIC:
switch (m_TalkDirection) { switch (m_TalkDirection) {
case LEFT: case LEFT:
@ -1127,7 +1125,7 @@ void RMTony::StartTalk(CORO_PARAM, TALKTYPE nTalkType) {
_ctx->headLoopPat, _ctx->bodyLoopPat)) _ctx->headLoopPat, _ctx->bodyLoopPat))
return; return;
// Esegue il set dei pattern vero e proprio // Perform the set pattern
if (_ctx->headStartPat != 0 || _ctx->bodyStartPat != 0) { if (_ctx->headStartPat != 0 || _ctx->bodyStartPat != 0) {
MainFreeze(); MainFreeze();
SetPattern(_ctx->headStartPat); SetPattern(_ctx->headStartPat);
@ -1446,7 +1444,7 @@ void RMTony::EndTalk(CORO_PARAM) {
if (!EndTalkCalculate(_ctx->headStandPat, _ctx->headEndPat, _ctx->bodyEndPat, _ctx->finalPat, _ctx->bStatic)) if (!EndTalkCalculate(_ctx->headStandPat, _ctx->headEndPat, _ctx->bodyEndPat, _ctx->finalPat, _ctx->bStatic))
return; 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_bIsStaticTalk) {
if (m_nTalkType == TALK_CONBARBASTATIC) { if (m_nTalkType == TALK_CONBARBASTATIC) {
MainFreeze(); MainFreeze();
@ -1471,7 +1469,7 @@ void RMTony::EndTalk(CORO_PARAM) {
return; return;
} }
// Set dei pattern // Set the pattern
if (_ctx->headEndPat != 0 && _ctx->bodyEndPat != 0) { if (_ctx->headEndPat != 0 && _ctx->bodyEndPat != 0) {
MainFreeze(); MainFreeze();
SetPattern(_ctx->headEndPat); SetPattern(_ctx->headEndPat);

View file

@ -106,13 +106,13 @@ private:
uint32 hActionThread; uint32 hActionThread;
protected: 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); 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); static void WaitEndOfAction(CORO_PARAM, const void *param);
public: // per farlo rialzare, altrimenti private public:
enum PATTERNS { enum PATTERNS {
PAT_TAKEUP_UP1 = 9, PAT_TAKEUP_UP1 = 9,
PAT_TAKEUP_UP2, PAT_TAKEUP_UP2,
@ -140,7 +140,7 @@ public: // per farlo rialzare, altrimenti private
PAT_SIRIALZARIGHT, PAT_SIRIALZARIGHT,
PAT_PERTERRARIGHT, PAT_PERTERRARIGHT,
// Pastorella! // Sheperdess!
PAT_PAST_WALKUP, PAT_PAST_WALKUP,
PAT_PAST_WALKDOWN, PAT_PAST_WALKDOWN,
PAT_PAST_WALKLEFT, PAT_PAST_WALKLEFT,
@ -151,19 +151,19 @@ public: // per farlo rialzare, altrimenti private
PAT_PAST_STANDLEFT, PAT_PAST_STANDLEFT,
PAT_PAST_STANDRIGHT, PAT_PAST_STANDRIGHT,
// Parlata // Speech
PAT_TALK_UP, PAT_TALK_UP,
PAT_TALK_DOWN, PAT_TALK_DOWN,
PAT_TALK_LEFT, PAT_TALK_LEFT,
PAT_TALK_RIGHT, PAT_TALK_RIGHT,
// Testa statica // Static head
PAT_TESTA_UP, PAT_TESTA_UP,
PAT_TESTA_DOWN, PAT_TESTA_DOWN,
PAT_TESTA_LEFT, PAT_TESTA_LEFT,
PAT_TESTA_RIGHT, PAT_TESTA_RIGHT,
// Risata // Laugh
PAT_RIDELEFT_START, PAT_RIDELEFT_START,
PAT_RIDELEFT_LOOP, PAT_RIDELEFT_LOOP,
PAT_RIDELEFT_END, PAT_RIDELEFT_END,
@ -171,13 +171,13 @@ public: // per farlo rialzare, altrimenti private
PAT_RIDERIGHT_LOOP, PAT_RIDERIGHT_LOOP,
PAT_RIDERIGHT_END, PAT_RIDERIGHT_END,
// Parlata da pastorella // Speaking as a shepherdess
PAT_PAST_TALKUP, PAT_PAST_TALKUP,
PAT_PAST_TALKDOWN, PAT_PAST_TALKDOWN,
PAT_PAST_TALKLEFT, PAT_PAST_TALKLEFT,
PAT_PAST_TALKRIGHT, PAT_PAST_TALKRIGHT,
// Spavento // Fear
PAT_SPAVENTOLEFT_START, PAT_SPAVENTOLEFT_START,
PAT_SPAVENTOLEFT_LOOP, PAT_SPAVENTOLEFT_LOOP,
PAT_SPAVENTOLEFT_END, PAT_SPAVENTOLEFT_END,
@ -188,16 +188,16 @@ public: // per farlo rialzare, altrimenti private
PAT_SPAVENTODOWN_LOOP, PAT_SPAVENTODOWN_LOOP,
PAT_SPAVENTODOWN_END, PAT_SPAVENTODOWN_END,
// Con oggetti: corpo completo // With objects: full body
PAT_CONBICCHIERE, PAT_CONBICCHIERE,
PAT_CONCORDA, PAT_CONCORDA,
PAT_CONVERME, PAT_CONVERME,
PAT_CONMARTELLO, PAT_CONMARTELLO,
// Suona il fischietto // Sound the whistle
PAT_FISCHIETTORIGHT, PAT_FISCHIETTORIGHT,
// Testa con barba // Head with beard
PAT_TALKBARBA_LEFT, PAT_TALKBARBA_LEFT,
PAT_TALKBARBA_RIGHT, PAT_TALKBARBA_RIGHT,
@ -205,7 +205,7 @@ public: // per farlo rialzare, altrimenti private
PAT_SNIFFA_LEFT, PAT_SNIFFA_LEFT,
PAT_SNIFFA_RIGHT, PAT_SNIFFA_RIGHT,
// Schifato // Disgusted
PAT_SCHIFATOLEFT_START, PAT_SCHIFATOLEFT_START,
PAT_SCHIFATOLEFT_LOOP, PAT_SCHIFATOLEFT_LOOP,
PAT_SCHIFATOLEFT_END, PAT_SCHIFATOLEFT_END,
@ -219,7 +219,7 @@ public: // per farlo rialzare, altrimenti private
PAT_NAAHRIGHT_LOOP, PAT_NAAHRIGHT_LOOP,
PAT_NAAHRIGHT_END, PAT_NAAHRIGHT_END,
// Stand spaventato // Stand scared
PAT_SPAVENTOLEFT_STAND, PAT_SPAVENTOLEFT_STAND,
PAT_SPAVENTORIGHT_STAND, PAT_SPAVENTORIGHT_STAND,
PAT_SPAVENTODOWN_STAND, PAT_SPAVENTODOWN_STAND,
@ -361,81 +361,80 @@ public:
static void InitStatics(); static void InitStatics();
RMTony(); RMTony();
// Inizializza Tony // Initialise Tony
void Init(void); void Init(void);
// Libera tutta la memoria // Free all memory
void Close(void); 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); 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); virtual void Draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive *prim);
// Mostra o nascondi // Show or hide
void Show(void); void Show(void);
void Hide(bool bShowOmbra = false); 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); 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); virtual void Stop(CORO_PARAM);
void StopNoAction(CORO_PARAM); void StopNoAction(CORO_PARAM);
// Setta un pattern // Set a pattern
void SetPattern(int npatt, bool bPlayP0 = false); void SetPattern(int npatt, bool bPlayP0 = false);
// Legge il pattern corrente // Reads the current pattern
int GetCurPattern(); 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) { void WaitForEndPattern(CORO_PARAM, uint32 hCustomSkip = CORO_INVALID_PID_VALUE) {
RMCharacter::WaitForEndPattern(coroParam, hCustomSkip); RMCharacter::WaitForEndPattern(coroParam, hCustomSkip);
} }
// Controlla se si trova in azione // Check if currently in an action
bool InAction() { return (m_bActionPending&&m_Action != 0) | m_bAction; } 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())); } bool MustUpdateScrolling() { return ((!InAction()) || (IsMoving())); }
// Prende la posizione di Tony // Returns Tony's position
RMPoint Position() { return m_pos; } RMPoint Position() { return m_pos; }
// Setta la posizione di scrolling // Set the scrolling position
void SetScrollPosition(const RMPoint &pt) { RMCharacter::SetScrollPosition(pt); } void SetScrollPosition(const RMPoint &pt) { RMCharacter::SetScrollPosition(pt); }
// Setta l'animazione di Take // Set the take animation
void Take(int nWhere, int nPart); void Take(int nWhere, int nPart);
void Put(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, bool StartTalkCalculate(TALKTYPE nTalkType, int &headStartPat, int &bodyStartPat,
int &headLoopPat, int &bodyLoopPat); int &headLoopPat, int &bodyLoopPat);
void StartTalk(CORO_PARAM, TALKTYPE nTalkType); void StartTalk(CORO_PARAM, TALKTYPE nTalkType);
bool EndTalkCalculate(int &headStandPat, int &headEndPat, int &bodyEndPat, int &finalPat, bool &bStatic); bool EndTalkCalculate(int &headStandPat, int &headEndPat, int &bodyEndPat, int &finalPat, bool &bStatic);
void EndTalk(CORO_PARAM); void EndTalk(CORO_PARAM);
// Start e End Static // Start or End Static
void StartStaticCalculate(TALKTYPE nTalk, int &headPat, int &headLoopPat, void StartStaticCalculate(TALKTYPE nTalk, int &headPat, int &headLoopPat,
int &bodyStartPat, int &bodyLoopPat); int &bodyStartPat, int &bodyLoopPat);
void StartStatic(CORO_PARAM, TALKTYPE nTalkType); void StartStatic(CORO_PARAM, TALKTYPE nTalkType);
void EndStaticCalculate(TALKTYPE nTalk, int &bodyEndPat, int &finalPat, int &headEndPat); void EndStaticCalculate(TALKTYPE nTalk, int &bodyEndPat, int &finalPat, int &headEndPat);
void EndStatic(CORO_PARAM, TALKTYPE nTalkType); void EndStatic(CORO_PARAM, TALKTYPE nTalkType);
// Tony si traveste! // Tony disguises himself!
void SetPastorella(bool bIsPast) { m_bPastorella=bIsPast; } void SetPastorella(bool bIsPast) { m_bPastorella=bIsPast; }
int GetPastorella(void) { return m_bPastorella; } int GetPastorella(void) { return m_bPastorella; }
// Esegue una azione // Perform an action
void ExecuteAction(int nAction, int nActionItem, int nParm); void ExecuteAction(int nAction, int nActionItem, int nParm);
void PlaySfx(int nSfx) { RMItem::PlaySfx(nSfx); } void PlaySfx(int nSfx) { RMItem::PlaySfx(nSfx); }
}; };
} // End of namespace Tony } // End of namespace Tony
#endif #endif

View file

@ -40,9 +40,9 @@ namespace Tony {
* Constructor * Constructor
*/ */
RMString::RMString() { RMString::RMString() {
m_string=NULL; m_string = NULL;
m_length=0; m_length = 0;
m_realLength=0; m_realLength = 0;
} }
/** /**
@ -188,8 +188,8 @@ const RMString& RMString::operator=(const int ch) {
// Destroy the current string // Destroy the current string
if (m_realLength > 0) { if (m_realLength > 0) {
delete [] m_string; delete [] m_string;
m_string=NULL; m_string = NULL;
m_length=m_realLength=0; m_length = m_realLength = 0;
} }
} else { } else {
// Resize if necessary // Resize if necessary
@ -213,7 +213,7 @@ void RMString::Connect(const char *str, int size) {
if (size > 0) { if (size > 0) {
// Calculate the new lenght // Calculate the new lenght
nlen=m_length+size; nlen = m_length+size;
// Resize // Resize
Resize(nlen + 1, true); Resize(nlen + 1, true);
@ -242,7 +242,7 @@ const RMString &RMString::operator+=(RMString &str) {
* @returns Refrence to our string * @returns Refrence to our string
*/ */
const RMString &RMString::operator+=(const char *str) { const RMString &RMString::operator+=(const char *str) {
Connect(str,strlen(str)); Connect(str, strlen(str));
return *this; return *this;
} }
@ -385,7 +385,7 @@ void RMString::Format(const char *str, ...) {
} }
/****************************************************************************\ /****************************************************************************\
* Metodi di RMFileStreamSlow * RMFileStreamSlow Methods
\****************************************************************************/ \****************************************************************************/
RMFileStreamSlow::RMFileStreamSlow() : RMDataStream() { RMFileStreamSlow::RMFileStreamSlow() : RMDataStream() {
@ -410,7 +410,7 @@ bool RMFileStreamSlow::OpenFile(Common::File &file) {
bool RMFileStreamSlow::OpenFile(const char *lpFN) { bool RMFileStreamSlow::OpenFile(const char *lpFN) {
// Apre il file in lettura // Open file for reading
Common::File f; Common::File f;
if (!f.open(lpFN)) if (!f.open(lpFN))
return false; return false;
@ -679,13 +679,13 @@ int RMDataStream::Seek(int nBytes, RMDSPos origin) {
break; break;
case START: case START:
m_pos=0; m_pos = 0;
break; break;
case END: case END:
if (m_length == SIZENOTKNOWN) if (m_length == SIZENOTKNOWN)
return m_pos; return m_pos;
m_pos=m_length; m_pos = m_length;
break; break;
} }
@ -741,8 +741,8 @@ RMPoint::RMPoint() {
* Copy constructor * Copy constructor
*/ */
RMPoint::RMPoint(const RMPoint &p) { RMPoint::RMPoint(const RMPoint &p) {
x=p.x; x = p.x;
y=p.y; y = p.y;
} }
/** /**
@ -969,13 +969,13 @@ RMRect operator-(const RMRect& rc, RMPoint p) {
RMRect operator+(RMPoint p, const RMRect& rc) { RMRect operator+(RMPoint p, const RMRect& rc) {
RMRect r(rc); RMRect r(rc);
return (r+=p); return (r += p);
} }
RMRect operator-(RMPoint p, const RMRect& rc) { RMRect operator-(RMPoint p, const RMRect& rc) {
RMRect r(rc); RMRect r(rc);
return (r+=p); return (r += p);
} }
bool RMRect::operator==(const RMRect& rc) { bool RMRect::operator==(const RMRect& rc) {
@ -987,7 +987,7 @@ bool RMRect::operator!=(const RMRect& rc) {
} }
void RMRect::NormalizeRect(void) { 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) { RMDataStream &operator>>(RMDataStream &ds, RMRect &rc) {
@ -1029,7 +1029,7 @@ void RMResUpdate::Init(const Common::String &fileName) {
_infos = new ResUpdInfo[_numUpd]; _infos = new ResUpdInfo[_numUpd];
// Load the index of the resources in the file // 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]; ResUpdInfo &info = _infos[i];
info.dwRes = _hFile.readUint32LE(); info.dwRes = _hFile.readUint32LE();
@ -1045,7 +1045,7 @@ HGLOBAL RMResUpdate::QueryResource(uint32 dwRes) {
return NULL; return NULL;
uint32 i; uint32 i;
for (i=0; i < _numUpd; ++i) for (i = 0; i < _numUpd; ++i)
if (_infos[i].dwRes == dwRes) if (_infos[i].dwRes == dwRes)
// Found the index // Found the index
break; break;

View file

@ -71,7 +71,7 @@ public:
void OpenBuffer(const byte *buf, int size = SIZENOTKNOWN); void OpenBuffer(const byte *buf, int size = SIZENOTKNOWN);
void Close(void); void Close(void);
// Attributi // Attributei
int Length(); int Length();
virtual int Pos(); virtual int Pos();
@ -86,14 +86,14 @@ public:
friend RMDataStream &operator>>(RMDataStream &df, int &var); friend RMDataStream &operator>>(RMDataStream &df, int &var);
friend RMDataStream &operator>>(RMDataStream &df, uint32 &var); friend RMDataStream &operator>>(RMDataStream &df, uint32 &var);
// Lettura generica // General read
virtual bool Read(void *buf, int size); virtual bool Read(void *buf, int size);
// Skipping & Seeking // Skipping & Seeking
virtual RMDataStream &operator+=(int nBytes); virtual RMDataStream &operator+=(int nBytes);
virtual int Seek(int nBytes, RMDSPos origin = CUR); virtual int Seek(int nBytes, RMDSPos origin = CUR);
// Gestione errori // Error handling
void SetError(int ecode); void SetError(int ecode);
int GetError(); int GetError();
bool IsError(); bool IsError();
@ -111,7 +111,7 @@ public:
RMFileStream(); RMFileStream();
virtual ~RMFileStream(); virtual ~RMFileStream();
// Apre lo stream da file // Methods for opening file
bool OpenFile(const char *lpFN); bool OpenFile(const char *lpFN);
bool OpenFile(Common::File &file); bool OpenFile(Common::File &file);
@ -165,7 +165,7 @@ public:
RMString(const char *str); RMString(const char *str);
RMString(const int ch); RMString(const int ch);
// Metodi generici // General methods
int Length() const; int Length() const;
void Compact(); void Compact();
@ -196,10 +196,10 @@ public:
friend RMString operator+(RMString &str, const char *s); friend RMString operator+(RMString &str, const char *s);
friend RMString operator+(const char *s, RMString &str); friend RMString operator+(const char *s, RMString &str);
// Estrazione da data stream // Extraction from data streams
friend RMDataStream& operator>>(RMDataStream& df, RMString &var); friend RMDataStream& operator>>(RMDataStream& df, RMString &var);
// Formattazione di stringa // String formatting
void Format(const char *str, ...); void Format(const char *str, ...);
private: private:
@ -220,11 +220,11 @@ public:
RMPoint(const RMPoint &p); RMPoint(const RMPoint &p);
RMPoint(int x1, int y1); RMPoint(int x1, int y1);
// Copia // Copy
RMPoint& operator=(RMPoint p); RMPoint& operator=(RMPoint p);
// Set // Set
void Set(int x1, int y1) { x=x1; y=y1; } void Set(int x1, int y1) { x = x1; y = y1; }
// Offset // Offset
void Offset(int xOff, int yOff); void Offset(int xOff, int yOff);
@ -235,7 +235,7 @@ public:
RMPoint &operator-=(RMPoint p); RMPoint &operator-=(RMPoint p);
RMPoint operator-(); RMPoint operator-();
// Confronti // Comparison
bool operator==(RMPoint p); bool operator==(RMPoint p);
bool operator!=(RMPoint p); bool operator!=(RMPoint p);

View file

@ -245,9 +245,9 @@ void RMSnapshot::GrabScreenshot(byte *lpBuf, int dezoom, uint16 *lpDestBuf) {
else else
curv = v; curv = v;
sommab += cursrc[curv*RM_BBX + u] & 0x1F; sommab += cursrc[curv * RM_BBX + u] & 0x1F;
sommag += (cursrc[curv*RM_BBX + u] >> 5) & 0x1F; sommag += (cursrc[curv * RM_BBX + u] >> 5) & 0x1F;
sommar += (cursrc[curv*RM_BBX + u] >> 10) & 0x1F; sommar += (cursrc[curv * RM_BBX + u] >> 10) & 0x1F;
} }
} }
rgb[k + 0] = (byte) (sommab * 8 / (dezoom * dezoom)); rgb[k + 0] = (byte) (sommab * 8 / (dezoom * dezoom));

View file

@ -78,21 +78,21 @@ public:
RMWindow(); RMWindow();
~RMWindow(); ~RMWindow();
// Initialization // Initialisation
void Init(/*HINSTANCE hInst*/); void Init(/*HINSTANCE hInst*/);
void InitDirectDraw(void); void InitDirectDraw(void);
void Close(void); void Close(void);
// Repaint grafico tramite DirectDraw // Drawing
void Repaint(void); void Repaint(void);
// Switch tra windowed e fullscreen // Switch between windowed and fullscreen
void SwitchFullscreen(bool bFull) {} void SwitchFullscreen(bool bFull) {}
// Legge il prossimo frame // Reads the next frame
void GetNewFrame(byte *lpBuf, Common::Rect *rcBoundEllipse); 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); void GrabThumbnail(uint16 *buf);
int getFps() const { return fps; } int getFps() const { return fps; }