Skip to content

Commit

Permalink
TONY: Some more code formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
Strangerke committed May 21, 2012
1 parent 6856fa2 commit 94d3c8e
Show file tree
Hide file tree
Showing 20 changed files with 1,544 additions and 1,464 deletions.
2 changes: 1 addition & 1 deletion engines/tony/detection.cpp
Expand Up @@ -147,7 +147,7 @@ void TonyMetaEngine::removeSaveState(const char *target, int slot) const {
SaveStateDescriptor TonyMetaEngine::querySaveMetaInfos(const char *target, int slot) const {
Tony::RMString saveName;
byte difficulty;
byte thumbData[160 * 120 * 2];
byte thumbData[160 * 120 * 2];

if (Tony::RMOptionScreen::LoadThumbnailFromSaveState(slot, thumbData, saveName, difficulty)) {
// Convert the 565 thumbnail data to the needed overlay format
Expand Down
30 changes: 15 additions & 15 deletions engines/tony/font.cpp
Expand Up @@ -51,10 +51,10 @@ RMFont::~RMFont() {

/**
* Dumps a font to a buffer
* @param buf Buffer for font contents
* @param nChars Number of characters (max 256)
* @param dimx X dimension in pixels
* @param dimy Y dimension in pixels
* @param buf Buffer for font contents
* @param nChars Number of characters (max 256)
* @param dimx X dimension in pixels
* @param dimy Y dimension in pixels
*
\****************************************************************************/

Expand Down Expand Up @@ -323,7 +323,7 @@ void RMFontParla::Init(void) {
lTable['E'] = 10;
lTable['F'] = 11;

if (_vm->getLanguage() == Common::PL_POL) {
if (_vm->getLanguage() == Common::PL_POL) {
// Polish characters
//AaCcEeLlNnOoSsZzZz
//¥¹ÆæÊꣳÑñÓ󌜯¿Ÿ
Expand Down Expand Up @@ -370,7 +370,7 @@ void RMFontParla::Init(void) {

// Russian Characters
// WARNING: The Russian font uses many of the ISO-Latin-1 font,
// allowing for further translations. To support Tonyin other langauges,
// allowing for further translations. To support Tonyin other langauges,
// these mappings could be used as a basis

cTable[(byte)'À'] = 130;
Expand Down Expand Up @@ -575,7 +575,7 @@ void RMFontParla::Init(void) {
lTable[(byte)'ù'] = 13;
lTable[(byte)'ú'] = 13;

} else if (_vm->getLanguage() == Common::FR_FRA) {
} else if (_vm->getLanguage() == Common::FR_FRA) {
// French

cTable[(byte)'â'] = 226;
Expand Down Expand Up @@ -687,7 +687,7 @@ void RMFontMacc::Init(void) {
//cTable[(byte)''] = 100; // u with ball
cTable[(byte)'ç'] = 101;

if (_vm->getLanguage() == Common::PL_POL) {
if (_vm->getLanguage() == Common::PL_POL) {
// Polish characters
//AaCcEeLlNnOoSsZzZz
//¥¹ÆæÊꣳÑñÓ󌜯¿Ÿ
Expand Down Expand Up @@ -733,7 +733,7 @@ void RMFontMacc::Init(void) {
} else if (_vm->getLanguage() == Common::RU_RUS) {
// Russian Characters
// WARNING: The Russian font uses many of the ISO-Latin-1 font,
// allowing for further translations. To support Tonyin other langauges,
// allowing for further translations. To support Tonyin other langauges,
// these mappings could be used as a basis
cTable[(byte)'À'] = 120;
cTable[(byte)'Á'] = 121;
Expand Down Expand Up @@ -1183,7 +1183,7 @@ void RMFontCredits::Init(void) {
} else if (_vm->getLanguage() == Common::RU_RUS) {
// Russian Characters
// WARNING: The Russian font uses many of the ISO-Latin-1 font,
// allowing for further translations. To support Tonyin other langauges,
// allowing for further translations. To support Tonyin other langauges,
// these mappings could be used as a basis
cTable[(byte)'À'] = 130;
cTable[(byte)'Á'] = 131;
Expand Down Expand Up @@ -1581,7 +1581,7 @@ void RMFontObj::Init(void) {
SetBothCase('R', 'R', 1);
SetBothCase('R', 'U', 3);

if (_vm->getLanguage() == Common::PL_POL) {
if (_vm->getLanguage() == Common::PL_POL) {
// Polish characters
//¥¹ÆæÊꣳÑñÓ󌜯¿Ÿ
//AaCcEeLlNnOoSsZzZz
Expand Down Expand Up @@ -1614,8 +1614,8 @@ void RMFontObj::Init(void) {

} else if (_vm->getLanguage() == Common::RU_RUS) {
// Russian Characters
// WARNING: The Russian font uses many of the ISO-Latin-1 font,
// allowing for further translations. To support Tonyin other langauges,
// WARNING: The Russian font uses many of the ISO-Latin-1 font,
// allowing for further translations. To support Tonyin other langauges,
// these mappings could be used as a basis

cTable[(byte)'¥'] = cTable[(byte)'¹'] = 85;
Expand Down Expand Up @@ -1725,7 +1725,7 @@ void RMFontObj::Init(void) {
lTable[(byte)'Ù'] = lTable[(byte)'ù'] = 16;
lTable[(byte)'Ú'] = lTable[(byte)'ú'] = 16;

} else if (_vm->getLanguage() == Common::FR_FRA) {
} else if (_vm->getLanguage() == Common::FR_FRA) {
// French

// Translate accented characters as normal letters
Expand Down Expand Up @@ -1854,7 +1854,7 @@ void RMText::WriteText(const RMString &text, RMFontColor *font, int *time) {
// Back to the first usable space
//
// BERNIE: In the original, sentences containing words that exceed the
// width of a line caused discontinuation of the whole sentence.
// width of a line caused discontinuation of the whole sentence.
// This workaround has the partial word broken up so it will still display
//
old_p = p;
Expand Down
2 changes: 1 addition & 1 deletion engines/tony/game.cpp
Expand Up @@ -43,7 +43,7 @@ namespace Tony {
using namespace MPAL;

/****************************************/
/* Global functions */
/* Global functions */
/****************************************/

uint32 MainLoadLocation(int nLoc, RMPoint pt, RMPoint start) {
Expand Down
16 changes: 8 additions & 8 deletions engines/tony/gfxcore.cpp
Expand Up @@ -173,7 +173,7 @@ bool RMGfxSourceBuffer::Clip2D(int &x1, int &y1, int &u, int &v, int &width, int

if (x1 > destw - 1)
return false;

if (y1 > desth - 1)
return false;

Expand Down Expand Up @@ -206,11 +206,11 @@ bool RMGfxSourceBuffer::Clip2D(int &x1, int &y1, int &u, int &v, int &width, int
/**
* Initialises a surface by resource Id
*
* @param resID Resource ID
* @param dimx Buffer X dimension
* @param dimy Buffer Y dimension
* @param resID Resource ID
* @param dimx Buffer X dimension
* @param dimy Buffer Y dimension
*/
int RMGfxSourceBuffer::Init(uint32 resID, int dimx, int dimy, bool bLoadPalette) {
int RMGfxSourceBuffer::Init(uint32 resID, int dimx, int dimy, bool bLoadPalette) {
return Init(RMRes(resID), dimx, dimy, bLoadPalette);
}

Expand Down Expand Up @@ -478,7 +478,7 @@ RMGfxSourceBuffer4::RMGfxSourceBuffer4(int dimx, int dimy, bool bUseDDraw)
/**
* Returns the number of bits per pixel of the surface
*
* @returns Bit per pixel
* @returns Bit per pixel
*/
int RMGfxSourceBuffer4::Bpp() {
return 4;
Expand Down Expand Up @@ -565,7 +565,7 @@ RMGfxSourceBuffer8::RMGfxSourceBuffer8(bool bTrasp0) {
/**
* Returns the number of bits per pixel of the surface
*
* @returns Bit per pixel
* @returns Bit per pixel
*/
int RMGfxSourceBuffer8::Bpp() {
return 8;
Expand Down Expand Up @@ -1894,7 +1894,7 @@ RMGfxSourceBuffer16::RMGfxSourceBuffer16(int dimx, int dimy, bool bUseDDraw)
/**
* Returns the number of bits per pixel of the surface
*
* @returns Bit per pixel
* @returns Bit per pixel
*/
int RMGfxSourceBuffer16::Bpp() {
return 16;
Expand Down
2 changes: 1 addition & 1 deletion engines/tony/gfxcore.h
Expand Up @@ -39,7 +39,7 @@ namespace Tony {
* Prototipi di classi
\****************************************************************************/

// Class Name Family Treee Abstract?
// Class Name Family Treee Abstract?
class RMGfxTask; // Yes
class RMGfxTaskSetPrior; // Task Yes
class RMGfxBuffer; //
Expand Down
18 changes: 9 additions & 9 deletions engines/tony/inventory.cpp
Expand Up @@ -100,7 +100,7 @@ void RMInventory::Init(void) {

assert(res.IsValid());

// Initialise the MPAL inventory item by reading it in.
// Initialise the MPAL inventory item by reading it in.
m_items[i].icon.SetInitCurPattern(false);
ds.OpenBuffer(res);
ds >> m_items[i].icon;
Expand Down Expand Up @@ -149,9 +149,9 @@ void RMInventory::Init(void) {
RMMessage msg2(13);
RMMessage msg3(14);

m_hints[0].WriteText(msg1[0], 1); // Examine
m_hints[1].WriteText(msg2[0], 1); // Take
m_hints[2].WriteText(msg3[0], 1); // Use
m_hints[0].WriteText(msg1[0], 1); // Examine
m_hints[1].WriteText(msg2[0], 1); // Take
m_hints[2].WriteText(msg3[0], 1); // Use


// Prepare initial inventory
Expand Down Expand Up @@ -921,11 +921,11 @@ void RMInterface::Init(void) {
RMMessage msg3(15);
RMMessage msg4(16);

m_hints[0].WriteText(msg0[0], 1); // Take
m_hints[1].WriteText(msg1[0], 1); // Talk
m_hints[2].WriteText(msg2[0], 1); // Use
m_hints[3].WriteText(msg3[0], 1); // Examine
m_hints[4].WriteText(msg4[0], 1); // Show Yourself
m_hints[0].WriteText(msg0[0], 1); // Take
m_hints[1].WriteText(msg1[0], 1); // Talk
m_hints[2].WriteText(msg2[0], 1); // Use
m_hints[3].WriteText(msg3[0], 1); // Examine
m_hints[4].WriteText(msg4[0], 1); // Show Yourself

m_bActive = false;
m_bPalesati = false;
Expand Down
35 changes: 22 additions & 13 deletions engines/tony/inventory.h
Expand Up @@ -40,7 +40,7 @@ namespace Tony {

struct RMInventoryItem {
RMItem icon;
RMGfxSourceBuffer8RLEByteAA *pointer;
RMGfxSourceBuffer8RLEByteAA *pointer;
int status;
};

Expand All @@ -57,7 +57,7 @@ class RMInventory : public RMGfxWoodyBuffer {
protected:
int m_nItems;
RMInventoryItem *m_items;

int m_inv[256];
int m_nInv;
int m_curPutY;
Expand All @@ -69,13 +69,13 @@ class RMInventory : public RMGfxWoodyBuffer {
int m_nSelectObj;
int m_nCombine;
bool m_bCombining;

bool m_bBlinkingRight, m_bBlinkingLeft;

int miniAction;
RMItem miniInterface;
RMText m_hints[3];

OSystem::MutexRef m_csModifyInterface;

protected:
Expand All @@ -90,7 +90,7 @@ class RMInventory : public RMGfxWoodyBuffer {
virtual ~RMInventory();

// Prepare a frame
void DoFrame(RMGfxTargetBuffer& bigBuf, RMPointer &ptr, RMPoint mpos, bool bCanOpen);
void DoFrame(RMGfxTargetBuffer &bigBuf, RMPointer &ptr, RMPoint mpos, bool bCanOpen);

// Initialisation and closing
void Init(void);
Expand All @@ -111,20 +111,29 @@ class RMInventory : public RMGfxWoodyBuffer {

// Handle the left mouse click (only when the inventory has the focus)
bool LeftClick(const RMPoint &mpos, int &nCombineObj);

// Handle the right mouse button (only when the inventory has the focus)
void RightClick(const RMPoint &mpos);
bool RightRelease(const RMPoint &mpos, RMTonyAction &curAction);

// Warn that an item combine is over
void EndCombine(void);
public:

public:
// Add an item to the inventory
void AddItem(int code);
RMInventory& operator+=(RMItem *item) { AddItem(item->MpalCode()); return *this; }
RMInventory& operator+=(RMItem &item) { AddItem(item.MpalCode()); return *this; }
RMInventory& operator+=(int code) { AddItem(code); return *this; }
RMInventory &operator+=(RMItem *item) {
AddItem(item->MpalCode());
return *this;
}
RMInventory &operator+=(RMItem &item) {
AddItem(item.MpalCode());
return *this;
}
RMInventory &operator+=(int code) {
AddItem(code);
return *this;
}

// Removes an item
void RemoveItem(int code);
Expand Down Expand Up @@ -163,10 +172,10 @@ class RMInterface : public RMGfxSourceBuffer8RLEByte {
virtual ~RMInterface();

// The usual DoFrame (poll the graphics engine)
void DoFrame(RMGfxTargetBuffer& bigBuf, RMPoint mousepos);
void DoFrame(RMGfxTargetBuffer &bigBuf, RMPoint mousepos);

// TRUE if it is active (you can select items)
bool Active();
bool Active();

// Initialisation
void Init(void);
Expand Down

0 comments on commit 94d3c8e

Please sign in to comment.