Skip to content

Commit

Permalink
TONY: Move functions comment to doxygen format
Browse files Browse the repository at this point in the history
  • Loading branch information
Strangerke committed Jun 17, 2012
1 parent 31c0210 commit a46b06a
Show file tree
Hide file tree
Showing 15 changed files with 249 additions and 121 deletions.
2 changes: 1 addition & 1 deletion engines/tony/font.cpp
Expand Up @@ -2380,7 +2380,7 @@ void RMDialogChoice::setNumChoices(int num) {
_drawedStrings = new RMText[num];
_ptDrawStrings = new RMPoint[num];

// Initialisation
// Initialization
for (i = 0; i < _numChoices; i++) {
_drawedStrings[i].setColor(0, 255, 0);
_drawedStrings[i].setAlignType(RMText::HLEFTPAR, RMText::VTOP);
Expand Down
6 changes: 3 additions & 3 deletions engines/tony/font.h
Expand Up @@ -89,7 +89,7 @@ class RMFont : public RMGfxTaskSetPrior {
RMFont();
virtual ~RMFont();

// Initialisation and closing
// Initialization and closing
virtual void init(void) = 0;
virtual void close(void);

Expand Down Expand Up @@ -366,11 +366,11 @@ class RMDialogChoice : public RMGfxWoodyBuffer {
void Unregister(void);

public:
// Initialisation
// Initialization
RMDialogChoice();
virtual ~RMDialogChoice();

// Initialisation and closure
// Initialization and closure
void init(void);
void close(void);

Expand Down
8 changes: 1 addition & 7 deletions engines/tony/game.cpp
Expand Up @@ -316,8 +316,6 @@ void RMOptionSlide::addToList(RMGfxTargetBuffer &bigBuf) {
bigBuf.addPrim(new RMGfxPrimitive(this));
}



/****************************************************************************\
* RMOptionScreen Methods
\****************************************************************************/
Expand Down Expand Up @@ -379,7 +377,6 @@ RMOptionScreen::RMOptionScreen(void) {
_nLastState = MENUGAME;
}


RMOptionScreen::~RMOptionScreen(void) {
closeState();
}
Expand Down Expand Up @@ -567,7 +564,6 @@ void RMOptionScreen::refreshThumbnails(void) {
}
}


void RMOptionScreen::initState(CORO_PARAM) {
CORO_BEGIN_CONTEXT;
RMResRaw *raw;
Expand Down Expand Up @@ -1097,7 +1093,6 @@ void RMOptionScreen::doFrame(CORO_PARAM, RMInput *input) {
_ctx->bRefresh |= _buttonSave_ArrowLeft->doFrame(_ctx->mousePos, _ctx->bLeftClick, _ctx->bRightClick);
if (_statePos < 90)
_ctx->bRefresh |= _buttonSave_ArrowRight->doFrame(_ctx->mousePos, _ctx->bLeftClick, _ctx->bRightClick);

}
}

Expand Down Expand Up @@ -1195,7 +1190,7 @@ void RMOptionScreen::doFrame(CORO_PARAM, RMInput *input) {
if (_buttonSave_States[_ctx->i]->isActive()) {
// There by saving or loading!!!
if (_nState == MENULOAD && _curThumb[_ctx->i] != NULL) {
// Caricamento
// Loading
CORO_INVOKE_1(_vm->loadState, _statePos + _ctx->i);
close();
} else if (_nState == MENUSAVE && (_statePos != 0 || _ctx->i != 0)) {
Expand Down Expand Up @@ -1468,7 +1463,6 @@ bool RMOptionScreen::loadThumbnailFromSaveState(int nState, byte *lpDestBuf, RMS
return true;
}


/****************************************************************************\
* RMPointer Methods
\****************************************************************************/
Expand Down
58 changes: 43 additions & 15 deletions engines/tony/game.h
Expand Up @@ -81,32 +81,48 @@ class RMPointer {
};

public:
// Constructor & destructor
/**
* Constructor & destructor
*/
RMPointer();
virtual ~RMPointer();

// Initialisation
/**
* Initialization
*/
void init(void);

// Deinitialisation
/**
* Deinitialization
*/
void close(void);

// Process a frame
/**
* Process a frame
*/
void doFrame(RMGfxTargetBuffer *bigBuf);

// Overloading of priorities
/**
* Overloading of priorities
*/
int priority();

// draw method
/**
* draw method
*/
void draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive *prim);

// Sets a new action as current
/**
* Sets a new action as current
*/
void setAction(RMTonyAction action) {
_nCurPointer = action;
updateCursor();
}

// Sets a new pointer
/**
* Sets a new pointer
*/
void setSpecialPointer(PointerType ptr) {
_nCurSpecialPointer = ptr;
if (_nCurSpecialPointer && _nCurSpecialPointer != PTR_CUSTOM)
Expand All @@ -118,19 +134,27 @@ class RMPointer {
return (PointerType)_nCurSpecialPointer;
}

// Set the new custom pointer
/**
* Set the new custom pointer
*/
void setCustomPointer(RMGfxSourceBuffer8 *ptr) {
_nCurCustomPointer = ptr;
updateCursor();
}

// Return the current action to be applied according to the pointer
/**
* Return the current action to be applied according to the pointer
*/
int curAction(void);

/** Show the cursor */
/**
* Show the cursor
*/
void showCursor();

/** Hide the cursor */
/**
* Hide the cursor
*/
void hideCursor();
};

Expand Down Expand Up @@ -280,15 +304,19 @@ class RMOptionScreen : public RMGfxWoodyBuffer {
virtual void draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive *prim);
virtual void removeThis(CORO_PARAM, bool &result);

// Polling for the option screen
/**
* Polling for the option screen
*/
void doFrame(CORO_PARAM, RMInput *m_input);

// Retrieves a savegame's thumbnail, description, and difficulty level
/**
* Retrieves a savegame's thumbnail, description, and difficulty level
*/
static bool loadThumbnailFromSaveState(int numState, byte *lpDestBuf, RMString &name, byte &diff);

protected:

// Initialisation and state change
// Initialization and state change
void initState(CORO_PARAM);
void closeState(void);
void changeState(CORO_PARAM, OptionScreenState newState);
Expand Down
14 changes: 7 additions & 7 deletions engines/tony/gfxcore.h
Expand Up @@ -324,7 +324,7 @@ class RMGfxSourceBuffer16 : public RMGfxSourceBuffer {
RMGfxSourceBuffer16(int dimx, int dimy, bool bUseDDraw = false);
virtual ~RMGfxSourceBuffer16();

// Initialisation
// Initialization
void create(int dimx, int dimy, bool bUseDDraw = false);

int getBpp();
Expand Down Expand Up @@ -369,7 +369,7 @@ class RMGfxSourceBuffer8 : public RMGfxSourceBufferPal {
RMGfxSourceBuffer8(int dimx, int dimy, bool bUseDDraw = false);
virtual ~RMGfxSourceBuffer8();

// Initialisation
// Initialization
void create(int dimx, int dimy, bool bUseDDraw = false);

int getBpp();
Expand Down Expand Up @@ -414,15 +414,15 @@ class RMGfxSourceBuffer8RLE : public virtual RMGfxSourceBuffer8 {
void compressRLE(void);

protected:
// Overriding initialisation methods
// Overriding initialization methods
virtual void prepareImage(void);
virtual void preparePalette(void);

public:
RMGfxSourceBuffer8RLE();
virtual ~RMGfxSourceBuffer8RLE();

// Overload of the initialisation method
// Overload of the initialization method
virtual void init(RMDataStream &ds, int dimx, int dimy, bool bLoadPalette = false);
virtual int init(const byte *buf, int dimx, int dimy, bool bLoadPalette = false);

Expand Down Expand Up @@ -505,7 +505,7 @@ class RMGfxSourceBuffer8RLEByteAA : public RMGfxSourceBuffer8RLEByte, public RMG
public:
virtual void draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive *prim);

// Overloaded initialisation methods
// Overloaded initialization methods
virtual void init(RMDataStream &ds, int dimx, int dimy, bool bLoadPalette = false);
virtual int init(const byte *buf, int dimx, int dimy, bool bLoadPalette = false);

Expand All @@ -519,7 +519,7 @@ class RMGfxSourceBuffer8RLEWordAA : public RMGfxSourceBuffer8RLEWord, public RMG
public:
virtual void draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive *prim);

// Overloaded initialisation methods
// Overloaded initialization methods
virtual void init(RMDataStream &ds, int dimx, int dimy, bool bLoadPalette = false);
virtual int init(byte *buf, int dimx, int dimy, bool bLoadPalette = false);

Expand All @@ -535,7 +535,7 @@ class RMGfxSourceBuffer4 : public RMGfxSourceBufferPal {
RMGfxSourceBuffer4();
RMGfxSourceBuffer4(int dimx, int dimy, bool bUseDDraw = false);

// Initialisation
// Initialization
void create(int dimx, int dimy, bool bUseDDraw = false);

int getBpp();
Expand Down
2 changes: 0 additions & 2 deletions engines/tony/gfxengine.cpp
Expand Up @@ -353,7 +353,6 @@ void RMGfxEngine::doFrame(CORO_PARAM, bool bDrawLocation) {
CORO_END_CODE;
}


void RMGfxEngine::initCustomDll(void) {
setupGlobalVars(&_tony, &_point, &_vm->_theBoxes, &_loc, &_inv, &_input);
}
Expand All @@ -378,7 +377,6 @@ void RMGfxEngine::itemIrq(uint32 dwItem, int nPattern, int nStatus) {
}
}


void RMGfxEngine::initForNewLocation(int nLoc, RMPoint ptTonyStart, RMPoint start) {
if (start._x == -1 || start._y == -1) {
start._x = ptTonyStart._x - RM_SX / 2;
Expand Down
5 changes: 0 additions & 5 deletions engines/tony/globals.h
Expand Up @@ -43,10 +43,8 @@ namespace Tony {
#define TAPPETI_MARE 6
#define TAPPETI_MAREMETA 7


#define MAX_PATH 255


struct CharacterStruct {
uint32 _code;
RMItem *_item;
Expand Down Expand Up @@ -254,7 +252,6 @@ class Globals {
/**
* @defgroup MPAL variables
*/
//@{
uint32 _mpalError;
LPITEMIRQFUNCTION _lpiifCustom;
LPLPCUSTOMFUNCTION _lplpFunctions;
Expand Down Expand Up @@ -292,8 +289,6 @@ class Globals {
uint32 _nExecutingDialog;
uint32 _nExecutingChoice;
uint32 _nSelectedChoice;

//@}
};

} // End of namespace Tony
Expand Down
32 changes: 24 additions & 8 deletions engines/tony/input.h
Expand Up @@ -47,32 +47,46 @@ class RMInput {
// Keyboard related fields
bool _keyDown[350];
private:
// Deinitialize DirectInput
/**
* Deinitialize DirectInput
*/
void DIClose(void);

public:
RMInput();
~RMInput();

// Class initialisation
/**
* Class initialization
*/
void init(/*uint32 hInst*/);

// Closes the class
/**
* Closes the class
*/
void close(void);

// Polling (must be performed once per frame)
/**
* Polling (must be performed once per frame)
*/
void poll(void);

// Reading of the mouse
/**
* Reading of the mouse
*/
RMPoint mousePos() {
return _mousePos;
}

// Current status of the mouse buttons
/**
* Current status of the mouse buttons
*/
bool mouseLeft();
bool mouseRight();

// Events of mouse clicks
/**
* Events of mouse clicks
*/
bool mouseLeftClicked() {
return _leftClickMouse;
}
Expand All @@ -92,7 +106,9 @@ class RMInput {
return _leftReleaseMouse && _rightReleaseMouse;
}

// Returns true if the given key is pressed
/**
* Returns true if the given key is pressed
*/
bool getAsyncKeyState(Common::KeyCode kc);
};

Expand Down

0 comments on commit a46b06a

Please sign in to comment.