TONY: Rename variables and functions in utils.h
This commit is contained in:
parent
53bd99ce87
commit
f12ab3e521
18 changed files with 481 additions and 481 deletions
|
@ -574,7 +574,7 @@ DECLARE_CUSTOM_FUNCTION(ChangeLocation)(CORO_PARAM, uint32 nLoc, uint32 tX, uint
|
||||||
}
|
}
|
||||||
|
|
||||||
DECLARE_CUSTOM_FUNCTION(SetLocStartPosition)(CORO_PARAM, uint32 nLoc, uint32 lX, uint32 lY, uint32) {
|
DECLARE_CUSTOM_FUNCTION(SetLocStartPosition)(CORO_PARAM, uint32 nLoc, uint32 lX, uint32 lY, uint32) {
|
||||||
GLOBALS.StartLocPos[nLoc].Set(lX, lY);
|
GLOBALS.StartLocPos[nLoc].set(lX, lY);
|
||||||
}
|
}
|
||||||
|
|
||||||
DECLARE_CUSTOM_FUNCTION(SaveTonyPosition)(CORO_PARAM, uint32, uint32, uint32, uint32) {
|
DECLARE_CUSTOM_FUNCTION(SaveTonyPosition)(CORO_PARAM, uint32, uint32, uint32, uint32) {
|
||||||
|
@ -1223,21 +1223,21 @@ DECLARE_CUSTOM_FUNCTION(ScrollLocation)(CORO_PARAM, uint32 nX, uint32 nY, uint32
|
||||||
if (_ctx->lx > 0) {
|
if (_ctx->lx > 0) {
|
||||||
_ctx->lx -= (int32)sX;
|
_ctx->lx -= (int32)sX;
|
||||||
if (_ctx->lx < 0) _ctx->lx = 0;
|
if (_ctx->lx < 0) _ctx->lx = 0;
|
||||||
_ctx->pt.Offset((int32)sX, 0);
|
_ctx->pt.offset((int32)sX, 0);
|
||||||
} else if (_ctx->lx < 0) {
|
} else if (_ctx->lx < 0) {
|
||||||
_ctx->lx += (int32)sX;
|
_ctx->lx += (int32)sX;
|
||||||
if (_ctx->lx > 0) _ctx->lx = 0;
|
if (_ctx->lx > 0) _ctx->lx = 0;
|
||||||
_ctx->pt.Offset(-(int32)sX, 0);
|
_ctx->pt.offset(-(int32)sX, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_ctx->ly > 0) {
|
if (_ctx->ly > 0) {
|
||||||
_ctx->ly -= sY;
|
_ctx->ly -= sY;
|
||||||
if (_ctx->ly < 0) _ctx->ly = 0;
|
if (_ctx->ly < 0) _ctx->ly = 0;
|
||||||
_ctx->pt.Offset(0, sY);
|
_ctx->pt.offset(0, sY);
|
||||||
} else if (_ctx->ly < 0) {
|
} else if (_ctx->ly < 0) {
|
||||||
_ctx->ly += sY;
|
_ctx->ly += sY;
|
||||||
if (_ctx->ly > 0) _ctx->ly = 0;
|
if (_ctx->ly > 0) _ctx->ly = 0;
|
||||||
_ctx->pt.Offset(0, -(int32)sY);
|
_ctx->pt.offset(0, -(int32)sY);
|
||||||
}
|
}
|
||||||
|
|
||||||
CORO_INVOKE_0(GLOBALS.WaitFrame);
|
CORO_INVOKE_0(GLOBALS.WaitFrame);
|
||||||
|
|
|
@ -100,7 +100,7 @@ bool Debugger::Cmd_Scene(int argc, const char **argv) {
|
||||||
// Get the box areas for the scene, and choose one so as to have a default
|
// Get the box areas for the scene, and choose one so as to have a default
|
||||||
// position for Tony that will be in the walkable areas
|
// position for Tony that will be in the walkable areas
|
||||||
RMBoxLoc *box = _vm->_theBoxes.getBoxes(sceneNumber);
|
RMBoxLoc *box = _vm->_theBoxes.getBoxes(sceneNumber);
|
||||||
scenePos.Set(box->boxes[0].hotspot[0].hotx, box->boxes[0].hotspot[0].hoty);
|
scenePos.set(box->boxes[0].hotspot[0].hotx, box->boxes[0].hotspot[0].hoty);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set up a process to change the scene
|
// Set up a process to change the scene
|
||||||
|
|
|
@ -82,8 +82,8 @@ void RMFont::load(const byte *buf, int nChars, int dimx, int dimy, uint32 palRes
|
||||||
void RMFont::load(uint32 resID, int nChars, int dimx, int dimy, uint32 palResID) {
|
void RMFont::load(uint32 resID, int nChars, int dimx, int dimy, uint32 palResID) {
|
||||||
RMRes res(resID);
|
RMRes res(resID);
|
||||||
|
|
||||||
if ((int)res.Size() < nChars * (dimy * dimx + 8))
|
if ((int)res.size() < nChars * (dimy * dimx + 8))
|
||||||
nChars = res.Size() / (dimy * dimx + 8);
|
nChars = res.size() / (dimy * dimx + 8);
|
||||||
|
|
||||||
load(res, nChars, dimx, dimy, palResID);
|
load(res, nChars, dimx, dimy, palResID);
|
||||||
}
|
}
|
||||||
|
@ -137,7 +137,7 @@ int RMFont::stringLen(const RMString &text) {
|
||||||
int len, i;
|
int len, i;
|
||||||
|
|
||||||
len = 0;
|
len = 0;
|
||||||
for (i = 0; i < text.Length() - 1; i++)
|
for (i = 0; i < text.length() - 1; i++)
|
||||||
len += letterLength(text[i], text[i + 1]);
|
len += letterLength(text[i], text[i + 1]);
|
||||||
len += letterLength(text[i]);
|
len += letterLength(text[i]);
|
||||||
|
|
||||||
|
@ -1968,9 +1968,9 @@ void RMText::draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive *prim) {
|
||||||
CORO_BEGIN_CODE(_ctx);
|
CORO_BEGIN_CODE(_ctx);
|
||||||
// Horizontally
|
// Horizontally
|
||||||
if (aHorType == HCENTER)
|
if (aHorType == HCENTER)
|
||||||
prim->Dst().TopLeft() -= RMPoint(_dimx / 2, 0);
|
prim->Dst().topLeft() -= RMPoint(_dimx / 2, 0);
|
||||||
else if (aHorType == HRIGHT)
|
else if (aHorType == HRIGHT)
|
||||||
prim->Dst().TopLeft() -= RMPoint(_dimx, 0);
|
prim->Dst().topLeft() -= RMPoint(_dimx, 0);
|
||||||
|
|
||||||
|
|
||||||
// Vertically
|
// Vertically
|
||||||
|
@ -2146,7 +2146,7 @@ void RMTextDialog::draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive *p
|
||||||
|
|
||||||
if (_bShowed) {
|
if (_bShowed) {
|
||||||
if (GLOBALS.bCfgSottotitoli || _bAlwaysDisplay) {
|
if (GLOBALS.bCfgSottotitoli || _bAlwaysDisplay) {
|
||||||
prim->Dst().TopLeft() = dst;
|
prim->Dst().topLeft() = dst;
|
||||||
CORO_INVOKE_2(RMText::draw, bigBuf, prim);
|
CORO_INVOKE_2(RMText::draw, bigBuf, prim);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2285,7 +2285,7 @@ void RMTextItemName::draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// Set the destination coordinates of the mouse
|
// Set the destination coordinates of the mouse
|
||||||
prim->Dst().TopLeft() = _mpos - RMPoint(0, 30);
|
prim->Dst().topLeft() = _mpos - RMPoint(0, 30);
|
||||||
|
|
||||||
CORO_INVOKE_2(RMText::draw, bigBuf, prim);
|
CORO_INVOKE_2(RMText::draw, bigBuf, prim);
|
||||||
|
|
||||||
|
@ -2308,7 +2308,7 @@ bool RMTextItemName::isItemSelected() {
|
||||||
}
|
}
|
||||||
|
|
||||||
bool RMTextItemName::isNormalItemSelected() {
|
bool RMTextItemName::isNormalItemSelected() {
|
||||||
return _item != NULL && _itemName.Length() > 0;
|
return _item != NULL && _itemName.length() > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -2321,8 +2321,8 @@ RMDialogChoice::RMDialogChoice() {
|
||||||
RMResRaw dlg2(RES_I_DLGTEXTLINE);
|
RMResRaw dlg2(RES_I_DLGTEXTLINE);
|
||||||
RMRes dlgpal(RES_I_DLGTEXTPAL);
|
RMRes dlgpal(RES_I_DLGTEXTPAL);
|
||||||
|
|
||||||
DlgText.init(dlg1, dlg1.Width(), dlg1.Height());
|
DlgText.init(dlg1, dlg1.width(), dlg1.height());
|
||||||
DlgTextLine.init(dlg2, dlg2.Width(), dlg2.Height());
|
DlgTextLine.init(dlg2, dlg2.width(), dlg2.height());
|
||||||
|
|
||||||
DlgText.loadPaletteWA(dlgpal);
|
DlgText.loadPaletteWA(dlgpal);
|
||||||
DlgTextLine.loadPaletteWA(dlgpal);
|
DlgTextLine.loadPaletteWA(dlgpal);
|
||||||
|
@ -2407,18 +2407,18 @@ void RMDialogChoice::prepare(CORO_PARAM) {
|
||||||
addPrim(new RMGfxPrimitive(&DlgTextLine, RMPoint(0, 155 + 83 + 83)));
|
addPrim(new RMGfxPrimitive(&DlgTextLine, RMPoint(0, 155 + 83 + 83)));
|
||||||
addPrim(new RMGfxPrimitive(&DlgTextLine, RMPoint(0, 155 + 83 + 83 + 83)));
|
addPrim(new RMGfxPrimitive(&DlgTextLine, RMPoint(0, 155 + 83 + 83 + 83)));
|
||||||
|
|
||||||
_ctx->ptPos.Set(20, 90);
|
_ctx->ptPos.set(20, 90);
|
||||||
|
|
||||||
for (_ctx->i = 0; _ctx->i < _numChoices; _ctx->i++) {
|
for (_ctx->i = 0; _ctx->i < _numChoices; _ctx->i++) {
|
||||||
addPrim(new RMGfxPrimitive(&_drawedStrings[_ctx->i], _ctx->ptPos));
|
addPrim(new RMGfxPrimitive(&_drawedStrings[_ctx->i], _ctx->ptPos));
|
||||||
_ptDrawStrings[_ctx->i] = _ctx->ptPos;
|
_ptDrawStrings[_ctx->i] = _ctx->ptPos;
|
||||||
_ctx->ptPos.Offset(0, _drawedStrings[_ctx->i].getDimy() + 15);
|
_ctx->ptPos.offset(0, _drawedStrings[_ctx->i].getDimy() + 15);
|
||||||
}
|
}
|
||||||
|
|
||||||
CORO_INVOKE_0(drawOT);
|
CORO_INVOKE_0(drawOT);
|
||||||
clearOT();
|
clearOT();
|
||||||
|
|
||||||
_ptDrawPos.Set(0, 480 - _ctx->ptPos.y);
|
_ptDrawPos.set(0, 480 - _ctx->ptPos.y);
|
||||||
|
|
||||||
CORO_END_CODE;
|
CORO_END_CODE;
|
||||||
}
|
}
|
||||||
|
@ -2438,8 +2438,8 @@ void RMDialogChoice::setSelected(CORO_PARAM, int pos) {
|
||||||
|
|
||||||
if (_curSelection != -1) {
|
if (_curSelection != -1) {
|
||||||
_ctx->box.SetColor(0xCC, 0xCC, 0xFF);
|
_ctx->box.SetColor(0xCC, 0xCC, 0xFF);
|
||||||
_ctx->rc.TopLeft() = RMPoint(18, _ptDrawStrings[_curSelection].y);
|
_ctx->rc.topLeft() = RMPoint(18, _ptDrawStrings[_curSelection].y);
|
||||||
_ctx->rc.BottomRight() = _ctx->rc.TopLeft() + RMPoint(597, _drawedStrings[_curSelection].getDimy());
|
_ctx->rc.bottomRight() = _ctx->rc.topLeft() + RMPoint(597, _drawedStrings[_curSelection].getDimy());
|
||||||
addPrim(new RMGfxPrimitive(&_ctx->box, _ctx->rc));
|
addPrim(new RMGfxPrimitive(&_ctx->box, _ctx->rc));
|
||||||
|
|
||||||
addPrim(new RMGfxPrimitive(&_drawedStrings[_curSelection], _ptDrawStrings[_curSelection]));
|
addPrim(new RMGfxPrimitive(&_drawedStrings[_curSelection], _ptDrawStrings[_curSelection]));
|
||||||
|
@ -2449,8 +2449,8 @@ void RMDialogChoice::setSelected(CORO_PARAM, int pos) {
|
||||||
|
|
||||||
if (pos != -1) {
|
if (pos != -1) {
|
||||||
_ctx->box.SetColor(100, 100, 100);
|
_ctx->box.SetColor(100, 100, 100);
|
||||||
_ctx->rc.TopLeft() = RMPoint(18, _ptDrawStrings[pos].y);
|
_ctx->rc.topLeft() = RMPoint(18, _ptDrawStrings[pos].y);
|
||||||
_ctx->rc.BottomRight() = _ctx->rc.TopLeft() + RMPoint(597, _drawedStrings[pos].getDimy());
|
_ctx->rc.bottomRight() = _ctx->rc.topLeft() + RMPoint(597, _drawedStrings[pos].getDimy());
|
||||||
addPrim(new RMGfxPrimitive(&_ctx->box, _ctx->rc));
|
addPrim(new RMGfxPrimitive(&_ctx->box, _ctx->rc));
|
||||||
addPrim(new RMGfxPrimitive(&_drawedStrings[pos], _ptDrawStrings[pos]));
|
addPrim(new RMGfxPrimitive(&_drawedStrings[pos], _ptDrawStrings[pos]));
|
||||||
}
|
}
|
||||||
|
@ -2485,7 +2485,7 @@ void RMDialogChoice::show(CORO_PARAM, RMGfxTargetBuffer *bigBuf) {
|
||||||
_ctx->starttime = _vm->getTime();
|
_ctx->starttime = _vm->getTime();
|
||||||
_ctx->deltay = 480 - _ptDrawPos.y;
|
_ctx->deltay = 480 - _ptDrawPos.y;
|
||||||
_ctx->destpt = _ptDrawPos;
|
_ctx->destpt = _ptDrawPos;
|
||||||
_ptDrawPos.Set(0, 480);
|
_ptDrawPos.set(0, 480);
|
||||||
|
|
||||||
if (!_nInList && bigBuf != NULL)
|
if (!_nInList && bigBuf != NULL)
|
||||||
bigBuf->addPrim(new RMGfxPrimitive(this));
|
bigBuf->addPrim(new RMGfxPrimitive(this));
|
||||||
|
|
|
@ -124,11 +124,11 @@ void mainSetPalesati(bool bPalesati) {
|
||||||
|
|
||||||
RMOptionButton::RMOptionButton(uint32 dwRes, RMPoint pt, bool bDoubleState) {
|
RMOptionButton::RMOptionButton(uint32 dwRes, RMPoint pt, bool bDoubleState) {
|
||||||
RMResRaw raw(dwRes);
|
RMResRaw raw(dwRes);
|
||||||
assert(raw.IsValid());
|
assert(raw.isValid());
|
||||||
_buf = new RMGfxSourceBuffer16(false);
|
_buf = new RMGfxSourceBuffer16(false);
|
||||||
_buf->init(raw, raw.Width(), raw.Height());
|
_buf->init(raw, raw.width(), raw.height());
|
||||||
|
|
||||||
_rect.SetRect(pt.x, pt.y, pt.x + raw.Width() - 1, pt.y + raw.Height() - 1);
|
_rect.setRect(pt.x, pt.y, pt.x + raw.width() - 1, pt.y + raw.height() - 1);
|
||||||
_bActive = false;
|
_bActive = false;
|
||||||
_bHasGfx = true;
|
_bHasGfx = true;
|
||||||
_bDoubleState = bDoubleState;
|
_bDoubleState = bDoubleState;
|
||||||
|
@ -149,7 +149,7 @@ RMOptionButton::~RMOptionButton() {
|
||||||
|
|
||||||
bool RMOptionButton::doFrame(const RMPoint &mousePos, bool bLeftClick, bool bRightClick) {
|
bool RMOptionButton::doFrame(const RMPoint &mousePos, bool bLeftClick, bool bRightClick) {
|
||||||
if (!_bDoubleState) {
|
if (!_bDoubleState) {
|
||||||
if (_rect.PtInRect(mousePos)) {
|
if (_rect.ptInRect(mousePos)) {
|
||||||
if (!_bActive) {
|
if (!_bActive) {
|
||||||
_bActive = true;
|
_bActive = true;
|
||||||
return true;
|
return true;
|
||||||
|
@ -161,7 +161,7 @@ bool RMOptionButton::doFrame(const RMPoint &mousePos, bool bLeftClick, bool bRig
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (bLeftClick && _rect.PtInRect(mousePos)) {
|
if (bLeftClick && _rect.ptInRect(mousePos)) {
|
||||||
_bActive = !_bActive;
|
_bActive = !_bActive;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -511,12 +511,12 @@ void RMOptionScreen::refreshAll(CORO_PARAM) {
|
||||||
RMString s;
|
RMString s;
|
||||||
|
|
||||||
if (_bEditSaveName && _nEditPos == _ctx->i)
|
if (_bEditSaveName && _nEditPos == _ctx->i)
|
||||||
s.Format("%02d)%s*", _statePos + _ctx->i, _EditName);
|
s.format("%02d)%s*", _statePos + _ctx->i, _EditName);
|
||||||
else {
|
else {
|
||||||
if (_statePos == 0 && _ctx->i == 0)
|
if (_statePos == 0 && _ctx->i == 0)
|
||||||
s.Format("Autosave");
|
s.format("Autosave");
|
||||||
else
|
else
|
||||||
s.Format("%02d)%s", _statePos + _ctx->i, (const char *)_curThumbName[_ctx->i]);
|
s.format("%02d)%s", _statePos + _ctx->i, (const char *)_curThumbName[_ctx->i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
_ctx->num[_ctx->i] = new RMText;
|
_ctx->num[_ctx->i] = new RMText;
|
||||||
|
@ -585,10 +585,10 @@ void RMOptionScreen::initState(CORO_PARAM) {
|
||||||
error("Invalid state");
|
error("Invalid state");
|
||||||
}
|
}
|
||||||
|
|
||||||
assert(_ctx->raw->IsValid());
|
assert(_ctx->raw->isValid());
|
||||||
assert(_menu == NULL);
|
assert(_menu == NULL);
|
||||||
_menu = new RMGfxSourceBuffer16(false);
|
_menu = new RMGfxSourceBuffer16(false);
|
||||||
_menu->init(*_ctx->raw, _ctx->raw->Width(), _ctx->raw->Height());
|
_menu->init(*_ctx->raw, _ctx->raw->width(), _ctx->raw->height());
|
||||||
delete _ctx->raw;
|
delete _ctx->raw;
|
||||||
|
|
||||||
if (_nState == MENULOAD || _nState == MENUSAVE) {
|
if (_nState == MENULOAD || _nState == MENUSAVE) {
|
||||||
|
@ -647,10 +647,10 @@ void RMOptionScreen::initState(CORO_PARAM) {
|
||||||
_ButtonSoundMenu = new RMOptionButton(RMRect(212, 32, 306, 64));
|
_ButtonSoundMenu = new RMOptionButton(RMRect(212, 32, 306, 64));
|
||||||
|
|
||||||
_ctx->raw = new RMResRaw(20021);
|
_ctx->raw = new RMResRaw(20021);
|
||||||
assert(_ctx->raw->IsValid());
|
assert(_ctx->raw->isValid());
|
||||||
assert(_QuitConfirm == NULL);
|
assert(_QuitConfirm == NULL);
|
||||||
_QuitConfirm = new RMGfxSourceBuffer16(false);
|
_QuitConfirm = new RMGfxSourceBuffer16(false);
|
||||||
_QuitConfirm->init(*_ctx->raw, _ctx->raw->Width(), _ctx->raw->Height());
|
_QuitConfirm->init(*_ctx->raw, _ctx->raw->width(), _ctx->raw->height());
|
||||||
delete _ctx->raw;
|
delete _ctx->raw;
|
||||||
|
|
||||||
assert(_ButtonQuitYes == NULL);
|
assert(_ButtonQuitYes == NULL);
|
||||||
|
@ -662,10 +662,10 @@ void RMOptionScreen::initState(CORO_PARAM) {
|
||||||
|
|
||||||
if (_bNoLoadSave) {
|
if (_bNoLoadSave) {
|
||||||
_ctx->raw = new RMResRaw(20028);
|
_ctx->raw = new RMResRaw(20028);
|
||||||
assert(_ctx->raw->IsValid());
|
assert(_ctx->raw->isValid());
|
||||||
assert(_HideLoadSave == NULL);
|
assert(_HideLoadSave == NULL);
|
||||||
_HideLoadSave = new RMGfxSourceBuffer16(false);
|
_HideLoadSave = new RMGfxSourceBuffer16(false);
|
||||||
_HideLoadSave->init(*_ctx->raw, _ctx->raw->Width(), _ctx->raw->Height());
|
_HideLoadSave->init(*_ctx->raw, _ctx->raw->width(), _ctx->raw->height());
|
||||||
delete _ctx->raw;
|
delete _ctx->raw;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1485,7 +1485,7 @@ void RMPointer::init(void) {
|
||||||
RMResRaw res(RES_P_GO + i);
|
RMResRaw res(RES_P_GO + i);
|
||||||
|
|
||||||
_pointer[i] = new RMGfxSourceBuffer8RLEByteAA;
|
_pointer[i] = new RMGfxSourceBuffer8RLEByteAA;
|
||||||
_pointer[i]->init(res, res.Width(), res.Height(), false);
|
_pointer[i]->init(res, res.width(), res.height(), false);
|
||||||
_pointer[i]->loadPaletteWA(RES_P_PAL);
|
_pointer[i]->loadPaletteWA(RES_P_PAL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1493,17 +1493,17 @@ void RMPointer::init(void) {
|
||||||
RMRes res(RES_P_PAP1 + i);
|
RMRes res(RES_P_PAP1 + i);
|
||||||
RMDataStream ds;
|
RMDataStream ds;
|
||||||
|
|
||||||
ds.OpenBuffer(res);
|
ds.openBuffer(res);
|
||||||
_specialPointer[i] = new RMItem;
|
_specialPointer[i] = new RMItem;
|
||||||
ds >> *_specialPointer[i];
|
ds >> *_specialPointer[i];
|
||||||
}
|
}
|
||||||
|
|
||||||
//m_hotspot[0].Set(19,5);
|
//m_hotspot[0].set(19,5);
|
||||||
_hotspot[0].Set(5, 1);
|
_hotspot[0].set(5, 1);
|
||||||
_hotspot[1].Set(32, 28);
|
_hotspot[1].set(32, 28);
|
||||||
_hotspot[2].Set(45, 23);
|
_hotspot[2].set(45, 23);
|
||||||
_hotspot[3].Set(35, 25);
|
_hotspot[3].set(35, 25);
|
||||||
_hotspot[4].Set(32, 28);
|
_hotspot[4].set(32, 28);
|
||||||
|
|
||||||
// Default=GO
|
// Default=GO
|
||||||
_nCurPointer = 0;
|
_nCurPointer = 0;
|
||||||
|
|
|
@ -39,18 +39,18 @@ namespace Tony {
|
||||||
|
|
||||||
#define INIT_GFX16_FROMRAW(dwRes, buf16) \
|
#define INIT_GFX16_FROMRAW(dwRes, buf16) \
|
||||||
raw = new RMResRaw(dwRes); \
|
raw = new RMResRaw(dwRes); \
|
||||||
assert(raw->IsValid()); \
|
assert(raw->isValid()); \
|
||||||
assert((buf16) == NULL); \
|
assert((buf16) == NULL); \
|
||||||
(buf16) = new RMGfxSourceBuffer16(false); \
|
(buf16) = new RMGfxSourceBuffer16(false); \
|
||||||
(buf16)->init(*raw,raw->Width(),raw->Height()); \
|
(buf16)->init(*raw,raw->width(),raw->height()); \
|
||||||
delete raw;
|
delete raw;
|
||||||
|
|
||||||
#define INIT_GFX8_FROMRAW(raw, dwRes, buf8) \
|
#define INIT_GFX8_FROMRAW(raw, dwRes, buf8) \
|
||||||
raw = new RMResRaw(dwRes); \
|
raw = new RMResRaw(dwRes); \
|
||||||
assert(raw->IsValid()); \
|
assert(raw->isValid()); \
|
||||||
assert((buf8) == NULL); \
|
assert((buf8) == NULL); \
|
||||||
(buf8) = new RMGfxSourceBuffer8RLEByte(); \
|
(buf8) = new RMGfxSourceBuffer8RLEByte(); \
|
||||||
(buf8)->init(*raw, raw->Width(), raw->Height(), true); \
|
(buf8)->init(*raw, raw->width(), raw->height(), true); \
|
||||||
delete raw;
|
delete raw;
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -146,7 +146,7 @@ int RMGfxSourceBuffer::init(const byte *buf, int dimx, int dimy, bool bLoadPalet
|
||||||
|
|
||||||
void RMGfxSourceBuffer::init(RMDataStream &ds, int dimx, int dimy, bool bLoadPalette) {
|
void RMGfxSourceBuffer::init(RMDataStream &ds, int dimx, int dimy, bool bLoadPalette) {
|
||||||
create(dimx, dimy, Bpp());
|
create(dimx, dimy, Bpp());
|
||||||
ds.Read(_buf, dimx * dimy * Bpp() / 8);
|
ds.read(_buf, dimx * dimy * Bpp() / 8);
|
||||||
|
|
||||||
// Invokes the method for preparing the surface (inherited)
|
// Invokes the method for preparing the surface (inherited)
|
||||||
prepareImage();
|
prepareImage();
|
||||||
|
@ -448,7 +448,7 @@ void RMGfxSourceBufferPal::init(RMDataStream &ds, int dimx, int dimy, bool bLoad
|
||||||
// Load the palette if necessary
|
// Load the palette if necessary
|
||||||
if (bLoadPalette) {
|
if (bLoadPalette) {
|
||||||
byte *suxpal = new byte[256 * 3];
|
byte *suxpal = new byte[256 * 3];
|
||||||
ds.Read(suxpal, 256 * 3);
|
ds.read(suxpal, 256 * 3);
|
||||||
loadPaletteWA(suxpal);
|
loadPaletteWA(suxpal);
|
||||||
delete[] suxpal;
|
delete[] suxpal;
|
||||||
}
|
}
|
||||||
|
@ -512,8 +512,8 @@ void RMGfxSourceBuffer8::draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimit
|
||||||
u = prim->Src().x1;
|
u = prim->Src().x1;
|
||||||
v = prim->Src().y1;
|
v = prim->Src().y1;
|
||||||
|
|
||||||
width = prim->Src().Width();
|
width = prim->Src().width();
|
||||||
height = prim->Src().Height();
|
height = prim->Src().height();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!clip2D(dst.x1, dst.y1, u, v, width, height, prim->haveSrc(), &bigBuf))
|
if (!clip2D(dst.x1, dst.y1, u, v, width, height, prim->haveSrc(), &bigBuf))
|
||||||
|
@ -620,8 +620,8 @@ void RMGfxSourceBuffer8AB::draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrim
|
||||||
u = prim->Src().x1;
|
u = prim->Src().x1;
|
||||||
v = prim->Src().y1;
|
v = prim->Src().y1;
|
||||||
|
|
||||||
width = prim->Src().Width();
|
width = prim->Src().width();
|
||||||
height = prim->Src().Height();
|
height = prim->Src().height();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!clip2D(dst.x1, dst.y1, u, v, width, height, prim->haveSrc(), &bigBuf))
|
if (!clip2D(dst.x1, dst.y1, u, v, width, height, prim->haveSrc(), &bigBuf))
|
||||||
|
@ -702,7 +702,7 @@ void RMGfxSourceBuffer8RLE::init(RMDataStream &ds, int dimx, int dimy, bool bLoa
|
||||||
|
|
||||||
ds >> size;
|
ds >> size;
|
||||||
_buf = new byte[size];
|
_buf = new byte[size];
|
||||||
ds.Read(_buf, size);
|
ds.read(_buf, size);
|
||||||
|
|
||||||
_dimx = dimx;
|
_dimx = dimx;
|
||||||
_dimy = dimy;
|
_dimy = dimy;
|
||||||
|
@ -1767,7 +1767,7 @@ void RMGfxSourceBuffer8RLEByteAA::init(RMDataStream &ds, int dimx, int dimy, boo
|
||||||
if (!bNeedRLECompress) {
|
if (!bNeedRLECompress) {
|
||||||
// Load the anti-aliasing mask
|
// Load the anti-aliasing mask
|
||||||
_aabuf = new byte[dimx * dimy];
|
_aabuf = new byte[dimx * dimy];
|
||||||
ds.Read(_aabuf, dimx * dimy);
|
ds.read(_aabuf, dimx * dimy);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1805,7 +1805,7 @@ void RMGfxSourceBuffer8RLEWordAA::init(RMDataStream &ds, int dimx, int dimy, boo
|
||||||
if (!bNeedRLECompress) {
|
if (!bNeedRLECompress) {
|
||||||
// Load the anti-aliasing mask
|
// Load the anti-aliasing mask
|
||||||
_aabuf = new byte[dimx * dimy];
|
_aabuf = new byte[dimx * dimy];
|
||||||
ds.Read(_aabuf, dimx * dimy);
|
ds.read(_aabuf, dimx * dimy);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1839,8 +1839,8 @@ void RMGfxSourceBuffer16::draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimi
|
||||||
if (prim->haveSrc()) {
|
if (prim->haveSrc()) {
|
||||||
u = prim->Src().x1;
|
u = prim->Src().x1;
|
||||||
v = prim->Src().y1;
|
v = prim->Src().y1;
|
||||||
dimx = prim->Src().Width();
|
dimx = prim->Src().width();
|
||||||
dimy = prim->Src().Height();
|
dimy = prim->Src().height();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (prim->haveDst()) {
|
if (prim->haveDst()) {
|
||||||
|
@ -1932,11 +1932,11 @@ void RMGfxBox::draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive *prim)
|
||||||
buf += rcDst.y1 * bigBuf.getDimx() + rcDst.x1;
|
buf += rcDst.y1 * bigBuf.getDimx() + rcDst.x1;
|
||||||
|
|
||||||
// Loop through the pixels
|
// Loop through the pixels
|
||||||
for (j = 0; j < rcDst.Height(); j++) {
|
for (j = 0; j < rcDst.height(); j++) {
|
||||||
for (i = 0; i < rcDst.Width(); i++)
|
for (i = 0; i < rcDst.width(); i++)
|
||||||
*buf ++ = wFillColor;
|
*buf ++ = wFillColor;
|
||||||
|
|
||||||
buf += bigBuf.getDimx() - rcDst.Width();
|
buf += bigBuf.getDimx() - rcDst.width();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -110,8 +110,8 @@ public:
|
||||||
RMGfxPrimitive() {
|
RMGfxPrimitive() {
|
||||||
_bFlag = 0;
|
_bFlag = 0;
|
||||||
_task = NULL;
|
_task = NULL;
|
||||||
_src.SetEmpty();
|
_src.setEmpty();
|
||||||
_dst.SetEmpty();
|
_dst.setEmpty();
|
||||||
}
|
}
|
||||||
|
|
||||||
RMGfxPrimitive(RMGfxTask *task) {
|
RMGfxPrimitive(RMGfxTask *task) {
|
||||||
|
@ -124,41 +124,41 @@ public:
|
||||||
_src = src;
|
_src = src;
|
||||||
_dst = dst;
|
_dst = dst;
|
||||||
_bFlag = 0;
|
_bFlag = 0;
|
||||||
_bStretch = (src.Width() != dst.Width() || src.Height() != dst.Height());
|
_bStretch = (src.width() != dst.width() || src.height() != dst.height());
|
||||||
}
|
}
|
||||||
|
|
||||||
RMGfxPrimitive(RMGfxTask *task, const RMPoint &src, RMRect &dst) {
|
RMGfxPrimitive(RMGfxTask *task, const RMPoint &src, RMRect &dst) {
|
||||||
_task = task;
|
_task = task;
|
||||||
_src.TopLeft() = src;
|
_src.topLeft() = src;
|
||||||
_dst = dst;
|
_dst = dst;
|
||||||
_bFlag = 0;
|
_bFlag = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
RMGfxPrimitive(RMGfxTask *task, const RMPoint &src, RMPoint &dst) {
|
RMGfxPrimitive(RMGfxTask *task, const RMPoint &src, RMPoint &dst) {
|
||||||
_task = task;
|
_task = task;
|
||||||
_src.TopLeft() = src;
|
_src.topLeft() = src;
|
||||||
_dst.TopLeft() = dst;
|
_dst.topLeft() = dst;
|
||||||
_bFlag = 0;
|
_bFlag = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
RMGfxPrimitive(RMGfxTask *task, const RMRect &src, RMPoint &dst) {
|
RMGfxPrimitive(RMGfxTask *task, const RMRect &src, RMPoint &dst) {
|
||||||
_task = task;
|
_task = task;
|
||||||
_src = src;
|
_src = src;
|
||||||
_dst.TopLeft() = dst;
|
_dst.topLeft() = dst;
|
||||||
_bFlag = 0;
|
_bFlag = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
RMGfxPrimitive(RMGfxTask *task, const RMRect &dst) {
|
RMGfxPrimitive(RMGfxTask *task, const RMRect &dst) {
|
||||||
_task = task;
|
_task = task;
|
||||||
_dst = dst;
|
_dst = dst;
|
||||||
_src.SetEmpty();
|
_src.setEmpty();
|
||||||
_bFlag = 0;
|
_bFlag = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
RMGfxPrimitive(RMGfxTask *task, const RMPoint &dst) {
|
RMGfxPrimitive(RMGfxTask *task, const RMPoint &dst) {
|
||||||
_task = task;
|
_task = task;
|
||||||
_dst.TopLeft() = dst;
|
_dst.topLeft() = dst;
|
||||||
_src.SetEmpty();
|
_src.setEmpty();
|
||||||
_bFlag = 0;
|
_bFlag = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -174,27 +174,27 @@ public:
|
||||||
_src = src;
|
_src = src;
|
||||||
}
|
}
|
||||||
void setSrc(const RMPoint &src) {
|
void setSrc(const RMPoint &src) {
|
||||||
_src.TopLeft() = src;
|
_src.topLeft() = src;
|
||||||
}
|
}
|
||||||
void setDst(const RMRect &dst) {
|
void setDst(const RMRect &dst) {
|
||||||
_dst = dst;
|
_dst = dst;
|
||||||
}
|
}
|
||||||
void setDst(const RMPoint &dst) {
|
void setDst(const RMPoint &dst) {
|
||||||
_dst.TopLeft() = dst;
|
_dst.topLeft() = dst;
|
||||||
}
|
}
|
||||||
void setStrecth(bool bStretch) {
|
void setStrecth(bool bStretch) {
|
||||||
_bStretch = bStretch;
|
_bStretch = bStretch;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool haveDst() {
|
bool haveDst() {
|
||||||
return !_dst.IsEmpty();
|
return !_dst.isEmpty();
|
||||||
}
|
}
|
||||||
RMRect &Dst() {
|
RMRect &Dst() {
|
||||||
return _dst;
|
return _dst;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool haveSrc() {
|
bool haveSrc() {
|
||||||
return !_src.IsEmpty();
|
return !_src.isEmpty();
|
||||||
}
|
}
|
||||||
RMRect &Src() {
|
RMRect &Src() {
|
||||||
return _src;
|
return _src;
|
||||||
|
|
|
@ -412,7 +412,7 @@ uint32 RMGfxEngine::loadLocation(int nLoc, RMPoint ptTonyStart, RMPoint start) {
|
||||||
for (i = 0; i < 5; i++) {
|
for (i = 0; i < 5; i++) {
|
||||||
// Try the loading of the location
|
// Try the loading of the location
|
||||||
RMRes res(_nCurLoc);
|
RMRes res(_nCurLoc);
|
||||||
if (!res.IsValid())
|
if (!res.isValid())
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
_loc.load(res);
|
_loc.load(res);
|
||||||
|
|
|
@ -34,7 +34,7 @@ namespace Tony {
|
||||||
RMInput::RMInput() {
|
RMInput::RMInput() {
|
||||||
// Setup mouse fields
|
// Setup mouse fields
|
||||||
_clampMouse = false;
|
_clampMouse = false;
|
||||||
_mousePos.Set(0, 0);
|
_mousePos.set(0, 0);
|
||||||
_leftButton = _rightButton = false;
|
_leftButton = _rightButton = false;
|
||||||
_leftClickMouse = _leftReleaseMouse = false;
|
_leftClickMouse = _leftReleaseMouse = false;
|
||||||
_rightClickMouse = _rightReleaseMouse = false;
|
_rightClickMouse = _rightReleaseMouse = false;
|
||||||
|
@ -60,7 +60,7 @@ void RMInput::poll(void) {
|
||||||
case Common::EVENT_LBUTTONUP:
|
case Common::EVENT_LBUTTONUP:
|
||||||
case Common::EVENT_RBUTTONDOWN:
|
case Common::EVENT_RBUTTONDOWN:
|
||||||
case Common::EVENT_RBUTTONUP:
|
case Common::EVENT_RBUTTONUP:
|
||||||
_mousePos.Set(_event.mouse.x, _event.mouse.y);
|
_mousePos.set(_event.mouse.x, _event.mouse.y);
|
||||||
|
|
||||||
if (_event.type == Common::EVENT_LBUTTONDOWN) {
|
if (_event.type == Common::EVENT_LBUTTONDOWN) {
|
||||||
_leftButton = true;
|
_leftButton = true;
|
||||||
|
|
|
@ -97,13 +97,13 @@ void RMInventory::init(void) {
|
||||||
RMRes res(curres);
|
RMRes res(curres);
|
||||||
RMDataStream ds;
|
RMDataStream ds;
|
||||||
|
|
||||||
assert(res.IsValid());
|
assert(res.isValid());
|
||||||
|
|
||||||
// Initialise the MPAL inventory item by reading it in.
|
// Initialise the MPAL inventory item by reading it in.
|
||||||
_items[i].icon.setInitCurPattern(false);
|
_items[i].icon.setInitCurPattern(false);
|
||||||
ds.OpenBuffer(res);
|
ds.openBuffer(res);
|
||||||
ds >> _items[i].icon;
|
ds >> _items[i].icon;
|
||||||
ds.Close();
|
ds.close();
|
||||||
|
|
||||||
// Puts in the default pattern 1
|
// Puts in the default pattern 1
|
||||||
_items[i].pointer = NULL;
|
_items[i].pointer = NULL;
|
||||||
|
@ -120,9 +120,9 @@ void RMInventory::init(void) {
|
||||||
for (j = 0; j < _items[i].icon.numPattern(); j++) {
|
for (j = 0; j < _items[i].icon.numPattern(); j++) {
|
||||||
RMResRaw raw(curres);
|
RMResRaw raw(curres);
|
||||||
|
|
||||||
assert(raw.IsValid());
|
assert(raw.isValid());
|
||||||
|
|
||||||
_items[i].pointer[j].init((const byte *)raw, raw.Width(), raw.Height(), true);
|
_items[i].pointer[j].init((const byte *)raw, raw.width(), raw.height(), true);
|
||||||
curres++;
|
curres++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -133,11 +133,11 @@ void RMInventory::init(void) {
|
||||||
// Download interface
|
// Download interface
|
||||||
RMDataStream ds;
|
RMDataStream ds;
|
||||||
RMRes res(RES_I_MINIINTER);
|
RMRes res(RES_I_MINIINTER);
|
||||||
assert(res.IsValid());
|
assert(res.isValid());
|
||||||
ds.OpenBuffer(res);
|
ds.openBuffer(res);
|
||||||
ds >> miniInterface;
|
ds >> miniInterface;
|
||||||
miniInterface.setPattern(1);
|
miniInterface.setPattern(1);
|
||||||
ds.Close();
|
ds.close();
|
||||||
|
|
||||||
// Create the text for hints on the mini interface
|
// Create the text for hints on the mini interface
|
||||||
_hints[0].setAlignType(RMText::HCENTER, RMText::VTOP);
|
_hints[0].setAlignType(RMText::HCENTER, RMText::VTOP);
|
||||||
|
@ -202,11 +202,11 @@ void RMInventory::draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive *pr
|
||||||
if (_state == SELECTING) {
|
if (_state == SELECTING) {
|
||||||
|
|
||||||
if (!GLOBALS.bCfgInvUp) {
|
if (!GLOBALS.bCfgInvUp) {
|
||||||
_ctx->pos.Set((_nSelectObj + 1) * 64 - 20, RM_SY - 113);
|
_ctx->pos.set((_nSelectObj + 1) * 64 - 20, RM_SY - 113);
|
||||||
_ctx->pos2.Set((_nSelectObj + 1) * 64 + 34, RM_SY - 150);
|
_ctx->pos2.set((_nSelectObj + 1) * 64 + 34, RM_SY - 150);
|
||||||
} else {
|
} else {
|
||||||
_ctx->pos.Set((_nSelectObj + 1) * 64 - 20, 72 - 4); // The brown part is at the top :(
|
_ctx->pos.set((_nSelectObj + 1) * 64 - 20, 72 - 4); // The brown part is at the top :(
|
||||||
_ctx->pos2.Set((_nSelectObj + 1) * 64 + 34, 119 - 4);
|
_ctx->pos2.set((_nSelectObj + 1) * 64 + 34, 119 - 4);
|
||||||
}
|
}
|
||||||
|
|
||||||
_ctx->p = new RMGfxPrimitive(prim->_task, _ctx->pos);
|
_ctx->p = new RMGfxPrimitive(prim->_task, _ctx->pos);
|
||||||
|
@ -774,7 +774,7 @@ int RMInterface::onWhichBox(RMPoint pt) {
|
||||||
|
|
||||||
// Find the verb
|
// Find the verb
|
||||||
for (i = 0; i < max; i++)
|
for (i = 0; i < max; i++)
|
||||||
if (_hotbbox[i].PtInRect(pt))
|
if (_hotbbox[i].ptInRect(pt))
|
||||||
return i;
|
return i;
|
||||||
|
|
||||||
// Found no verb
|
// Found no verb
|
||||||
|
@ -788,13 +788,13 @@ void RMInterface::draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive *pr
|
||||||
|
|
||||||
CORO_BEGIN_CODE(_ctx);
|
CORO_BEGIN_CODE(_ctx);
|
||||||
|
|
||||||
prim->Dst().TopLeft() = _openStart;
|
prim->Dst().topLeft() = _openStart;
|
||||||
CORO_INVOKE_2(RMGfxSourceBuffer8RLEByte::draw, bigBuf, prim);
|
CORO_INVOKE_2(RMGfxSourceBuffer8RLEByte::draw, bigBuf, prim);
|
||||||
|
|
||||||
// Check if there is a draw hot zone
|
// Check if there is a draw hot zone
|
||||||
_ctx->h = onWhichBox(_mpos);
|
_ctx->h = onWhichBox(_mpos);
|
||||||
if (_ctx->h != -1) {
|
if (_ctx->h != -1) {
|
||||||
prim->Dst().TopLeft() = _openStart;
|
prim->Dst().topLeft() = _openStart;
|
||||||
CORO_INVOKE_2(_hotzone[_ctx->h].draw, bigBuf, prim);
|
CORO_INVOKE_2(_hotzone[_ctx->h].draw, bigBuf, prim);
|
||||||
|
|
||||||
if (_lastHotZone != _ctx->h) {
|
if (_lastHotZone != _ctx->h) {
|
||||||
|
@ -803,7 +803,7 @@ void RMInterface::draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive *pr
|
||||||
}
|
}
|
||||||
|
|
||||||
if (GLOBALS.bCfgInterTips) {
|
if (GLOBALS.bCfgInterTips) {
|
||||||
prim->Dst().TopLeft() = _openStart + RMPoint(70, 177);
|
prim->Dst().topLeft() = _openStart + RMPoint(70, 177);
|
||||||
CORO_INVOKE_2(_hints[_ctx->h].draw, bigBuf, prim);
|
CORO_INVOKE_2(_hints[_ctx->h].draw, bigBuf, prim);
|
||||||
}
|
}
|
||||||
} else
|
} else
|
||||||
|
@ -896,21 +896,21 @@ void RMInterface::init(void) {
|
||||||
|
|
||||||
setPriority(191);
|
setPriority(191);
|
||||||
|
|
||||||
RMGfxSourceBuffer::init(inter, inter.Width(), inter.Height());
|
RMGfxSourceBuffer::init(inter, inter.width(), inter.height());
|
||||||
loadPaletteWA(RES_I_INTERPAL);
|
loadPaletteWA(RES_I_INTERPAL);
|
||||||
|
|
||||||
for (i = 0; i < 5; i++) {
|
for (i = 0; i < 5; i++) {
|
||||||
RMResRaw part(RES_I_INTERP1 + i);
|
RMResRaw part(RES_I_INTERP1 + i);
|
||||||
|
|
||||||
_hotzone[i].init(part, part.Width(), part.Height());
|
_hotzone[i].init(part, part.width(), part.height());
|
||||||
_hotzone[i].loadPaletteWA(pal);
|
_hotzone[i].loadPaletteWA(pal);
|
||||||
}
|
}
|
||||||
|
|
||||||
_hotbbox[0].SetRect(126, 123, 159, 208); // Take
|
_hotbbox[0].setRect(126, 123, 159, 208); // Take
|
||||||
_hotbbox[1].SetRect(90, 130, 125, 186); // About
|
_hotbbox[1].setRect(90, 130, 125, 186); // About
|
||||||
_hotbbox[2].SetRect(110, 60, 152, 125);
|
_hotbbox[2].setRect(110, 60, 152, 125);
|
||||||
_hotbbox[3].SetRect(56, 51, 93, 99);
|
_hotbbox[3].setRect(56, 51, 93, 99);
|
||||||
_hotbbox[4].SetRect(51, 105, 82, 172);
|
_hotbbox[4].setRect(51, 105, 82, 172);
|
||||||
|
|
||||||
_hints[0].setAlignType(RMText::HRIGHT, RMText::VTOP);
|
_hints[0].setAlignType(RMText::HRIGHT, RMText::VTOP);
|
||||||
_hints[1].setAlignType(RMText::HRIGHT, RMText::VTOP);
|
_hints[1].setAlignType(RMText::HRIGHT, RMText::VTOP);
|
||||||
|
|
|
@ -50,7 +50,7 @@ using namespace ::Tony::MPAL;
|
||||||
* @returns Reference to the data stream
|
* @returns Reference to the data stream
|
||||||
*/
|
*/
|
||||||
RMDataStream &operator>>(RMDataStream &ds, RMPalette &pal) {
|
RMDataStream &operator>>(RMDataStream &ds, RMPalette &pal) {
|
||||||
ds.Read(pal._data, 1024);
|
ds.read(pal._data, 1024);
|
||||||
return ds;
|
return ds;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -129,7 +129,7 @@ void RMPattern::readFromStream(RMDataStream &ds, bool bLOX) {
|
||||||
// Create and read the slots
|
// Create and read the slots
|
||||||
_slots = new RMSlot[_nSlots];
|
_slots = new RMSlot[_nSlots];
|
||||||
|
|
||||||
for (i = 0; i < _nSlots && !ds.IsError(); i++) {
|
for (i = 0; i < _nSlots && !ds.isError(); i++) {
|
||||||
if (bLOX)
|
if (bLOX)
|
||||||
_slots[i].readFromStream(ds, true);
|
_slots[i].readFromStream(ds, true);
|
||||||
else
|
else
|
||||||
|
@ -319,20 +319,20 @@ void RMSprite::init(RMGfxSourceBuffer *buf) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void RMSprite::LOXGetSizeFromStream(RMDataStream &ds, int *dimx, int *dimy) {
|
void RMSprite::LOXGetSizeFromStream(RMDataStream &ds, int *dimx, int *dimy) {
|
||||||
int pos = ds.Pos();
|
int pos = ds.pos();
|
||||||
|
|
||||||
ds >> *dimx >> *dimy;
|
ds >> *dimx >> *dimy;
|
||||||
|
|
||||||
ds.Seek(pos, ds.START);
|
ds.seek(pos, ds.START);
|
||||||
}
|
}
|
||||||
|
|
||||||
void RMSprite::getSizeFromStream(RMDataStream &ds, int *dimx, int *dimy) {
|
void RMSprite::getSizeFromStream(RMDataStream &ds, int *dimx, int *dimy) {
|
||||||
int pos = ds.Pos();
|
int pos = ds.pos();
|
||||||
|
|
||||||
ds >> _name;
|
ds >> _name;
|
||||||
ds >> *dimx >> *dimy;
|
ds >> *dimx >> *dimy;
|
||||||
|
|
||||||
ds.Seek(pos, ds.START);
|
ds.seek(pos, ds.START);
|
||||||
}
|
}
|
||||||
|
|
||||||
void RMSprite::readFromStream(RMDataStream &ds, bool bLOX) {
|
void RMSprite::readFromStream(RMDataStream &ds, bool bLOX) {
|
||||||
|
@ -404,7 +404,7 @@ void RMSfx::readFromStream(RMDataStream &ds, bool bLOX) {
|
||||||
ds >> size;
|
ds >> size;
|
||||||
|
|
||||||
// Upload the sound effect identifier from the buffer
|
// Upload the sound effect identifier from the buffer
|
||||||
ds.Read(id, 4);
|
ds.read(id, 4);
|
||||||
|
|
||||||
// Ensure it's a RIFF
|
// Ensure it's a RIFF
|
||||||
assert(id[0] == 'R' && id[1] == 'I' && id[2] == 'F' && id[3] == 'F');
|
assert(id[0] == 'R' && id[1] == 'I' && id[2] == 'F' && id[3] == 'F');
|
||||||
|
@ -414,7 +414,7 @@ void RMSfx::readFromStream(RMDataStream &ds, bool bLOX) {
|
||||||
|
|
||||||
// Read the raw WAV data
|
// Read the raw WAV data
|
||||||
raw = new byte[size];
|
raw = new byte[size];
|
||||||
ds.Read(raw, size);
|
ds.read(raw, size);
|
||||||
|
|
||||||
// Create the sound effect
|
// Create the sound effect
|
||||||
_fx = _vm->createSFX(raw);
|
_fx = _vm->createSFX(raw);
|
||||||
|
@ -522,18 +522,18 @@ bool RMItem::isIn(const RMPoint &pt, int *size) {
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
// Search for the right bounding box to use - use the sprite's if it has one, otherwise use the generic one
|
// Search for the right bounding box to use - use the sprite's if it has one, otherwise use the generic one
|
||||||
if (_nCurPattern != 0 && !_sprites[_nCurSprite]._rcBox.IsEmpty())
|
if (_nCurPattern != 0 && !_sprites[_nCurSprite]._rcBox.isEmpty())
|
||||||
rc = _sprites[_nCurSprite]._rcBox + calculatePos();
|
rc = _sprites[_nCurSprite]._rcBox + calculatePos();
|
||||||
else if (!_rcBox.IsEmpty())
|
else if (!_rcBox.isEmpty())
|
||||||
rc = _rcBox;
|
rc = _rcBox;
|
||||||
// If no box, return immediately
|
// If no box, return immediately
|
||||||
else
|
else
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (size != NULL)
|
if (size != NULL)
|
||||||
*size = rc.Size();
|
*size = rc.size();
|
||||||
|
|
||||||
return rc.PtInRect(pt + _curScroll);
|
return rc.ptInRect(pt + _curScroll);
|
||||||
}
|
}
|
||||||
|
|
||||||
void RMItem::readFromStream(RMDataStream &ds, bool bLOX) {
|
void RMItem::readFromStream(RMDataStream &ds, bool bLOX) {
|
||||||
|
@ -592,8 +592,8 @@ void RMItem::readFromStream(RMDataStream &ds, bool bLOX) {
|
||||||
_patterns = new RMPattern[_nPatterns + 1];
|
_patterns = new RMPattern[_nPatterns + 1];
|
||||||
|
|
||||||
// Read in class data
|
// Read in class data
|
||||||
if (!ds.IsError())
|
if (!ds.isError())
|
||||||
for (i = 0; i < _nSprites && !ds.IsError(); i++) {
|
for (i = 0; i < _nSprites && !ds.isError(); i++) {
|
||||||
// Download the sprites
|
// Download the sprites
|
||||||
if (bLOX) {
|
if (bLOX) {
|
||||||
_sprites[i].LOXGetSizeFromStream(ds, &dimx, &dimy);
|
_sprites[i].LOXGetSizeFromStream(ds, &dimx, &dimy);
|
||||||
|
@ -609,8 +609,8 @@ void RMItem::readFromStream(RMDataStream &ds, bool bLOX) {
|
||||||
_sprites[i].setPalette(_pal._data);
|
_sprites[i].setPalette(_pal._data);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!ds.IsError())
|
if (!ds.isError())
|
||||||
for (i = 0; i < _nSfx && !ds.IsError(); i++) {
|
for (i = 0; i < _nSfx && !ds.isError(); i++) {
|
||||||
if (bLOX)
|
if (bLOX)
|
||||||
_sfx[i].readFromStream(ds, true);
|
_sfx[i].readFromStream(ds, true);
|
||||||
else
|
else
|
||||||
|
@ -618,8 +618,8 @@ void RMItem::readFromStream(RMDataStream &ds, bool bLOX) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Read the pattern from pattern 1
|
// Read the pattern from pattern 1
|
||||||
if (!ds.IsError())
|
if (!ds.isError())
|
||||||
for (i = 1; i <= _nPatterns && !ds.IsError(); i++) {
|
for (i = 1; i <= _nPatterns && !ds.isError(); i++) {
|
||||||
if (bLOX)
|
if (bLOX)
|
||||||
_patterns[i].readFromStream(ds, true);
|
_patterns[i].readFromStream(ds, true);
|
||||||
else
|
else
|
||||||
|
@ -695,11 +695,11 @@ void RMItem::draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive *prim) {
|
||||||
prim->setFlag(_bCurFlag);
|
prim->setFlag(_bCurFlag);
|
||||||
|
|
||||||
// Offset direction for scrolling
|
// Offset direction for scrolling
|
||||||
prim->Dst().Offset(-_curScroll);
|
prim->Dst().offset(-_curScroll);
|
||||||
|
|
||||||
// We must offset the cordinates of the item inside the primitive
|
// We must offset the cordinates of the item inside the primitive
|
||||||
// It is estimated as nonno + (babbo + figlio)
|
// It is estimated as nonno + (babbo + figlio)
|
||||||
prim->Dst().Offset(calculatePos());
|
prim->Dst().offset(calculatePos());
|
||||||
|
|
||||||
// No stretching, please
|
// No stretching, please
|
||||||
prim->setStrecth(false);
|
prim->setStrecth(false);
|
||||||
|
@ -781,7 +781,7 @@ RMItem::RMItem() {
|
||||||
_patterns = NULL;
|
_patterns = NULL;
|
||||||
_sprites = NULL;
|
_sprites = NULL;
|
||||||
_sfx = NULL;
|
_sfx = NULL;
|
||||||
_curScroll.Set(0, 0);
|
_curScroll.set(0, 0);
|
||||||
_bInitCurPattern = true;
|
_bInitCurPattern = true;
|
||||||
_nCurPattern = 0;
|
_nCurPattern = 0;
|
||||||
_z = 0;
|
_z = 0;
|
||||||
|
@ -904,9 +904,9 @@ void RMWipe::initFade(int type) {
|
||||||
RMRes res(RES_W_CERCHIO);
|
RMRes res(RES_W_CERCHIO);
|
||||||
RMDataStream ds;
|
RMDataStream ds;
|
||||||
|
|
||||||
ds.OpenBuffer(res);
|
ds.openBuffer(res);
|
||||||
ds >> _wip0r;
|
ds >> _wip0r;
|
||||||
ds.Close();
|
ds.close();
|
||||||
|
|
||||||
_wip0r.setPattern(1);
|
_wip0r.setPattern(1);
|
||||||
|
|
||||||
|
@ -1688,7 +1688,7 @@ RMCharacter::RMCharacter() {
|
||||||
bDrawNow = false;
|
bDrawNow = false;
|
||||||
bNeedToStop = false;
|
bNeedToStop = false;
|
||||||
|
|
||||||
_pos.Set(0, 0);
|
_pos.set(0, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
RMCharacter::~RMCharacter() {
|
RMCharacter::~RMCharacter() {
|
||||||
|
@ -1824,14 +1824,14 @@ void RMGameBoxes::init(void) {
|
||||||
for (i = 1; i <= _nLocBoxes; i++) {
|
for (i = 1; i <= _nLocBoxes; i++) {
|
||||||
RMRes res(10000 + i);
|
RMRes res(10000 + i);
|
||||||
|
|
||||||
ds.OpenBuffer(res);
|
ds.openBuffer(res);
|
||||||
|
|
||||||
_allBoxes[i] = new RMBoxLoc();
|
_allBoxes[i] = new RMBoxLoc();
|
||||||
ds >> *_allBoxes[i];
|
ds >> *_allBoxes[i];
|
||||||
|
|
||||||
_allBoxes[i]->recalcAllAdj();
|
_allBoxes[i]->recalcAllAdj();
|
||||||
|
|
||||||
ds.Close();
|
ds.close();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1985,9 +1985,9 @@ bool RMLocation::load(Common::File &file) {
|
||||||
|
|
||||||
RMFileStreamSlow fs;
|
RMFileStreamSlow fs;
|
||||||
|
|
||||||
fs.OpenFile(file);
|
fs.openFile(file);
|
||||||
bRet = load(fs);
|
bRet = load(fs);
|
||||||
fs.Close();
|
fs.close();
|
||||||
|
|
||||||
return bRet;
|
return bRet;
|
||||||
}
|
}
|
||||||
|
@ -1997,9 +1997,9 @@ bool RMLocation::load(const byte *buf) {
|
||||||
RMDataStream ds;
|
RMDataStream ds;
|
||||||
bool bRet;
|
bool bRet;
|
||||||
|
|
||||||
ds.OpenBuffer(buf);
|
ds.openBuffer(buf);
|
||||||
bRet = load(ds);
|
bRet = load(ds);
|
||||||
ds.Close();
|
ds.close();
|
||||||
return bRet;
|
return bRet;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2045,7 +2045,7 @@ bool RMLocation::load(RMDataStream &ds) {
|
||||||
|
|
||||||
// Location dimensions
|
// Location dimensions
|
||||||
ds >> dimx >> dimy;
|
ds >> dimx >> dimy;
|
||||||
_curScroll.Set(0, 0);
|
_curScroll.set(0, 0);
|
||||||
|
|
||||||
// Read the colour mode
|
// Read the colour mode
|
||||||
ds >> cm;
|
ds >> cm;
|
||||||
|
@ -2081,11 +2081,11 @@ bool RMLocation::load(RMDataStream &ds) {
|
||||||
|
|
||||||
|
|
||||||
_vm->freezeTime();
|
_vm->freezeTime();
|
||||||
for (i = 0; i < _nItems && !ds.IsError(); i++)
|
for (i = 0; i < _nItems && !ds.isError(); i++)
|
||||||
ds >> _items[i];
|
ds >> _items[i];
|
||||||
_vm->unfreezeTime();
|
_vm->unfreezeTime();
|
||||||
|
|
||||||
return ds.IsError();
|
return ds.isError();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -2107,7 +2107,7 @@ bool RMLocation::loadLOX(RMDataStream &ds) {
|
||||||
|
|
||||||
// Dimensions
|
// Dimensions
|
||||||
ds >> dimx >> dimy;
|
ds >> dimx >> dimy;
|
||||||
_curScroll.Set(0, 0);
|
_curScroll.set(0, 0);
|
||||||
|
|
||||||
// It's always 65K (16-bit) mode
|
// It's always 65K (16-bit) mode
|
||||||
_cmode = CM_65K;
|
_cmode = CM_65K;
|
||||||
|
@ -2123,10 +2123,10 @@ bool RMLocation::loadLOX(RMDataStream &ds) {
|
||||||
if (_nItems > 0)
|
if (_nItems > 0)
|
||||||
_items = new RMItem[_nItems];
|
_items = new RMItem[_nItems];
|
||||||
|
|
||||||
for (i = 0; i < _nItems && !ds.IsError(); i++)
|
for (i = 0; i < _nItems && !ds.isError(); i++)
|
||||||
_items[i].readFromStream(ds, true);
|
_items[i].readFromStream(ds, true);
|
||||||
|
|
||||||
return ds.IsError();
|
return ds.isError();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -37,42 +37,42 @@ namespace MPAL {
|
||||||
* @param resId MPAL resource to open
|
* @param resId MPAL resource to open
|
||||||
*/
|
*/
|
||||||
RMRes::RMRes(uint32 resID) {
|
RMRes::RMRes(uint32 resID) {
|
||||||
m_h = _vm->_resUpdate.QueryResource(resID);
|
_h = _vm->_resUpdate.queryResource(resID);
|
||||||
if (m_h == NULL)
|
if (_h == NULL)
|
||||||
m_h = mpalQueryResource(resID);
|
_h = mpalQueryResource(resID);
|
||||||
if (m_h != NULL)
|
if (_h != NULL)
|
||||||
m_buf = (byte *)GlobalLock(m_h);
|
_buf = (byte *)GlobalLock(_h);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Destructor
|
* Destructor
|
||||||
*/
|
*/
|
||||||
RMRes::~RMRes() {
|
RMRes::~RMRes() {
|
||||||
if (m_h != NULL) {
|
if (_h != NULL) {
|
||||||
GlobalUnlock(m_h);
|
GlobalUnlock(_h);
|
||||||
GlobalFree(m_h);
|
GlobalFree(_h);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns a pointer to the resource
|
* Returns a pointer to the resource
|
||||||
*/
|
*/
|
||||||
const byte *RMRes::DataPointer() {
|
const byte *RMRes::dataPointer() {
|
||||||
return m_buf;
|
return _buf;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns a pointer to the resource
|
* Returns a pointer to the resource
|
||||||
*/
|
*/
|
||||||
RMRes::operator const byte *() {
|
RMRes::operator const byte *() {
|
||||||
return DataPointer();
|
return dataPointer();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the size of the resource
|
* Returns the size of the resource
|
||||||
*/
|
*/
|
||||||
unsigned int RMRes::Size() {
|
unsigned int RMRes::size() {
|
||||||
return GlobalSize(m_h);
|
return GlobalSize(_h);
|
||||||
}
|
}
|
||||||
|
|
||||||
/****************************************************************************\
|
/****************************************************************************\
|
||||||
|
@ -86,19 +86,19 @@ RMResRaw::~RMResRaw() {
|
||||||
}
|
}
|
||||||
|
|
||||||
const byte *RMResRaw::DataPointer() {
|
const byte *RMResRaw::DataPointer() {
|
||||||
return m_buf + 8;
|
return _buf + 8;
|
||||||
}
|
}
|
||||||
|
|
||||||
RMResRaw::operator const byte *() {
|
RMResRaw::operator const byte *() {
|
||||||
return DataPointer();
|
return DataPointer();
|
||||||
}
|
}
|
||||||
|
|
||||||
int RMResRaw::Width() {
|
int RMResRaw::width() {
|
||||||
return READ_LE_UINT16(m_buf + 4);
|
return READ_LE_UINT16(_buf + 4);
|
||||||
}
|
}
|
||||||
|
|
||||||
int RMResRaw::Height() {
|
int RMResRaw::height() {
|
||||||
return READ_LE_UINT16(m_buf + 6);
|
return READ_LE_UINT16(_buf + 6);
|
||||||
}
|
}
|
||||||
|
|
||||||
} // end of namespace MPAL
|
} // end of namespace MPAL
|
||||||
|
|
|
@ -33,17 +33,17 @@ namespace MPAL {
|
||||||
|
|
||||||
class RMRes {
|
class RMRes {
|
||||||
protected:
|
protected:
|
||||||
HGLOBAL m_h;
|
HGLOBAL _h;
|
||||||
byte *m_buf;
|
byte *_buf;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
RMRes(uint32 resID);
|
RMRes(uint32 resID);
|
||||||
virtual ~RMRes();
|
virtual ~RMRes();
|
||||||
|
|
||||||
// Attributes
|
// Attributes
|
||||||
unsigned int Size();
|
unsigned int size();
|
||||||
const byte *DataPointer();
|
const byte *dataPointer();
|
||||||
bool IsValid() { return m_h != NULL; }
|
bool isValid() { return _h != NULL; }
|
||||||
|
|
||||||
// Casting for access to data
|
// Casting for access to data
|
||||||
operator const byte*();
|
operator const byte*();
|
||||||
|
@ -57,8 +57,8 @@ public:
|
||||||
const byte *DataPointer();
|
const byte *DataPointer();
|
||||||
operator const byte*();
|
operator const byte*();
|
||||||
|
|
||||||
int Width();
|
int width();
|
||||||
int Height();
|
int height();
|
||||||
};
|
};
|
||||||
|
|
||||||
} // end of namespace MPAL
|
} // end of namespace MPAL
|
||||||
|
|
|
@ -127,7 +127,7 @@ Common::ErrorCode TonyEngine::init() {
|
||||||
return Common::kUnknownError;
|
return Common::kUnknownError;
|
||||||
|
|
||||||
// Initialise the update resources
|
// Initialise the update resources
|
||||||
_resUpdate.Init("ROASTED.MPU");
|
_resUpdate.init("ROASTED.MPU");
|
||||||
|
|
||||||
// Initialise the music
|
// Initialise the music
|
||||||
initMusic();
|
initMusic();
|
||||||
|
|
|
@ -105,18 +105,18 @@ void RMTony::init(void) {
|
||||||
_bIsStaticTalk = false;
|
_bIsStaticTalk = false;
|
||||||
|
|
||||||
// Opens the buffer
|
// Opens the buffer
|
||||||
ds.OpenBuffer(tony);
|
ds.openBuffer(tony);
|
||||||
|
|
||||||
// Reads his details from the stream
|
// Reads his details from the stream
|
||||||
readFromStream(ds, true);
|
readFromStream(ds, true);
|
||||||
|
|
||||||
// Closes the buffer
|
// Closes the buffer
|
||||||
ds.Close();
|
ds.close();
|
||||||
|
|
||||||
// Reads Tony's body
|
// Reads Tony's body
|
||||||
ds.OpenBuffer(body);
|
ds.openBuffer(body);
|
||||||
_body.readFromStream(ds, true);
|
_body.readFromStream(ds, true);
|
||||||
ds.Close();
|
ds.close();
|
||||||
_body.setPattern(0);
|
_body.setPattern(0);
|
||||||
|
|
||||||
_nTimeLastStep = _vm->getTime();
|
_nTimeLastStep = _vm->getTime();
|
||||||
|
@ -180,28 +180,28 @@ void RMTony::draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive *prim) {
|
||||||
// Call the Draw() of the parent class if Tony is visible
|
// Call the Draw() of the parent class if Tony is visible
|
||||||
if (_bShow && bDrawNow) {
|
if (_bShow && bDrawNow) {
|
||||||
if (_bCorpoDavanti) {
|
if (_bCorpoDavanti) {
|
||||||
prim->Dst().SetEmpty();
|
prim->Dst().setEmpty();
|
||||||
prim->Dst().Offset(-44, -134);
|
prim->Dst().offset(-44, -134);
|
||||||
if (_bPastorella)
|
if (_bPastorella)
|
||||||
prim->Dst().Offset(1, 4);
|
prim->Dst().offset(1, 4);
|
||||||
CORO_INVOKE_2(RMCharacter::draw, bigBuf, prim);
|
CORO_INVOKE_2(RMCharacter::draw, bigBuf, prim);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_bIsTalking || _bIsStaticTalk) {
|
if (_bIsTalking || _bIsStaticTalk) {
|
||||||
// Offest direction from scrolling
|
// Offest direction from scrolling
|
||||||
prim->Dst().SetEmpty();
|
prim->Dst().setEmpty();
|
||||||
prim->Dst().Offset(-_curScroll);
|
prim->Dst().offset(-_curScroll);
|
||||||
prim->Dst().Offset(_pos);
|
prim->Dst().offset(_pos);
|
||||||
prim->Dst().Offset(-44, -134);
|
prim->Dst().offset(-44, -134);
|
||||||
prim->Dst() += _nBodyOffset;
|
prim->Dst() += _nBodyOffset;
|
||||||
CORO_INVOKE_2(_body.draw, bigBuf, prim);
|
CORO_INVOKE_2(_body.draw, bigBuf, prim);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!_bCorpoDavanti) {
|
if (!_bCorpoDavanti) {
|
||||||
prim->Dst().SetEmpty();
|
prim->Dst().setEmpty();
|
||||||
prim->Dst().Offset(-44, -134);
|
prim->Dst().offset(-44, -134);
|
||||||
if (_bPastorella)
|
if (_bPastorella)
|
||||||
prim->Dst().Offset(0, 3);
|
prim->Dst().offset(0, 3);
|
||||||
CORO_INVOKE_2(RMCharacter::draw, bigBuf, prim);
|
CORO_INVOKE_2(RMCharacter::draw, bigBuf, prim);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -630,25 +630,25 @@ bool RMTony::startTalkCalculate(TALKTYPE nTalkType, int &headStartPat, int &body
|
||||||
case DOWN:
|
case DOWN:
|
||||||
headLoopPat = PAT_TALK_DOWN;
|
headLoopPat = PAT_TALK_DOWN;
|
||||||
bodyLoopPat = BPAT_STANDDOWN;
|
bodyLoopPat = BPAT_STANDDOWN;
|
||||||
_nBodyOffset.Set(4, 53);
|
_nBodyOffset.set(4, 53);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case LEFT:
|
case LEFT:
|
||||||
headLoopPat = PAT_TALK_LEFT;
|
headLoopPat = PAT_TALK_LEFT;
|
||||||
bodyLoopPat = BPAT_STANDLEFT;
|
bodyLoopPat = BPAT_STANDLEFT;
|
||||||
_nBodyOffset.Set(6, 56);
|
_nBodyOffset.set(6, 56);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case RIGHT:
|
case RIGHT:
|
||||||
headLoopPat = PAT_TALK_RIGHT;
|
headLoopPat = PAT_TALK_RIGHT;
|
||||||
bodyLoopPat = BPAT_STANDRIGHT;
|
bodyLoopPat = BPAT_STANDRIGHT;
|
||||||
_nBodyOffset.Set(6, 56);
|
_nBodyOffset.set(6, 56);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case UP:
|
case UP:
|
||||||
headLoopPat = PAT_TALK_UP;
|
headLoopPat = PAT_TALK_UP;
|
||||||
bodyLoopPat = BPAT_STANDUP;
|
bodyLoopPat = BPAT_STANDUP;
|
||||||
_nBodyOffset.Set(6, 53);
|
_nBodyOffset.set(6, 53);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -657,7 +657,7 @@ bool RMTony::startTalkCalculate(TALKTYPE nTalkType, int &headStartPat, int &body
|
||||||
_bCorpoDavanti = false;
|
_bCorpoDavanti = false;
|
||||||
switch (_TalkDirection) {
|
switch (_TalkDirection) {
|
||||||
case UP:
|
case UP:
|
||||||
_nBodyOffset.Set(2, 42);
|
_nBodyOffset.set(2, 42);
|
||||||
headStartPat = PAT_TESTA_UP;
|
headStartPat = PAT_TESTA_UP;
|
||||||
bodyStartPat = BPAT_FIANCHIUP_START;
|
bodyStartPat = BPAT_FIANCHIUP_START;
|
||||||
headLoopPat = PAT_TALK_UP;
|
headLoopPat = PAT_TALK_UP;
|
||||||
|
@ -665,7 +665,7 @@ bool RMTony::startTalkCalculate(TALKTYPE nTalkType, int &headStartPat, int &body
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case DOWN:
|
case DOWN:
|
||||||
_nBodyOffset.Set(2, 48);
|
_nBodyOffset.set(2, 48);
|
||||||
headStartPat = PAT_TESTA_DOWN;
|
headStartPat = PAT_TESTA_DOWN;
|
||||||
bodyStartPat = BPAT_FIANCHIDOWN_START;
|
bodyStartPat = BPAT_FIANCHIDOWN_START;
|
||||||
headLoopPat = PAT_TALK_DOWN;
|
headLoopPat = PAT_TALK_DOWN;
|
||||||
|
@ -673,7 +673,7 @@ bool RMTony::startTalkCalculate(TALKTYPE nTalkType, int &headStartPat, int &body
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case LEFT:
|
case LEFT:
|
||||||
_nBodyOffset.Set(-3, 53);
|
_nBodyOffset.set(-3, 53);
|
||||||
headStartPat = PAT_TESTA_LEFT;
|
headStartPat = PAT_TESTA_LEFT;
|
||||||
bodyStartPat = BPAT_FIANCHILEFT_START;
|
bodyStartPat = BPAT_FIANCHILEFT_START;
|
||||||
headLoopPat = PAT_TALK_LEFT;
|
headLoopPat = PAT_TALK_LEFT;
|
||||||
|
@ -681,7 +681,7 @@ bool RMTony::startTalkCalculate(TALKTYPE nTalkType, int &headStartPat, int &body
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case RIGHT:
|
case RIGHT:
|
||||||
_nBodyOffset.Set(2, 53);
|
_nBodyOffset.set(2, 53);
|
||||||
headStartPat = PAT_TESTA_RIGHT;
|
headStartPat = PAT_TESTA_RIGHT;
|
||||||
bodyStartPat = BPAT_FIANCHIRIGHT_START;
|
bodyStartPat = BPAT_FIANCHIRIGHT_START;
|
||||||
headLoopPat = PAT_TALK_RIGHT;
|
headLoopPat = PAT_TALK_RIGHT;
|
||||||
|
@ -692,7 +692,7 @@ bool RMTony::startTalkCalculate(TALKTYPE nTalkType, int &headStartPat, int &body
|
||||||
|
|
||||||
|
|
||||||
case TALK_CANTA:
|
case TALK_CANTA:
|
||||||
_nBodyOffset.Set(-10, 25);
|
_nBodyOffset.set(-10, 25);
|
||||||
headStartPat = PAT_TESTA_LEFT;
|
headStartPat = PAT_TESTA_LEFT;
|
||||||
bodyStartPat = BPAT_CANTALEFT_START;
|
bodyStartPat = BPAT_CANTALEFT_START;
|
||||||
headLoopPat = PAT_TALK_LEFT;
|
headLoopPat = PAT_TALK_LEFT;
|
||||||
|
@ -705,7 +705,7 @@ bool RMTony::startTalkCalculate(TALKTYPE nTalkType, int &headStartPat, int &body
|
||||||
case UP:
|
case UP:
|
||||||
case DOWN:
|
case DOWN:
|
||||||
case LEFT:
|
case LEFT:
|
||||||
_nBodyOffset.Set(6, 56);
|
_nBodyOffset.set(6, 56);
|
||||||
headStartPat = PAT_RIDELEFT_START;
|
headStartPat = PAT_RIDELEFT_START;
|
||||||
bodyStartPat = BPAT_STANDLEFT;
|
bodyStartPat = BPAT_STANDLEFT;
|
||||||
headLoopPat = PAT_RIDELEFT_LOOP;
|
headLoopPat = PAT_RIDELEFT_LOOP;
|
||||||
|
@ -713,7 +713,7 @@ bool RMTony::startTalkCalculate(TALKTYPE nTalkType, int &headStartPat, int &body
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case RIGHT:
|
case RIGHT:
|
||||||
_nBodyOffset.Set(6, 56);
|
_nBodyOffset.set(6, 56);
|
||||||
headStartPat = PAT_RIDERIGHT_START;
|
headStartPat = PAT_RIDERIGHT_START;
|
||||||
bodyStartPat = BPAT_STANDRIGHT;
|
bodyStartPat = BPAT_STANDRIGHT;
|
||||||
headLoopPat = PAT_RIDERIGHT_LOOP;
|
headLoopPat = PAT_RIDERIGHT_LOOP;
|
||||||
|
@ -728,14 +728,14 @@ bool RMTony::startTalkCalculate(TALKTYPE nTalkType, int &headStartPat, int &body
|
||||||
case UP:
|
case UP:
|
||||||
case DOWN:
|
case DOWN:
|
||||||
case LEFT:
|
case LEFT:
|
||||||
_nBodyOffset.Set(6, 56);
|
_nBodyOffset.set(6, 56);
|
||||||
headStartPat = PAT_RIDELEFT_START;
|
headStartPat = PAT_RIDELEFT_START;
|
||||||
bodyStartPat = BPAT_STANDLEFT;
|
bodyStartPat = BPAT_STANDLEFT;
|
||||||
headLoopPat = PAT_RIDELEFT_LOOP;
|
headLoopPat = PAT_RIDELEFT_LOOP;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case RIGHT:
|
case RIGHT:
|
||||||
_nBodyOffset.Set(6, 56);
|
_nBodyOffset.set(6, 56);
|
||||||
headStartPat = PAT_RIDERIGHT_START;
|
headStartPat = PAT_RIDERIGHT_START;
|
||||||
bodyStartPat = BPAT_STANDRIGHT;
|
bodyStartPat = BPAT_STANDRIGHT;
|
||||||
headLoopPat = PAT_RIDERIGHT_LOOP;
|
headLoopPat = PAT_RIDERIGHT_LOOP;
|
||||||
|
@ -750,13 +750,13 @@ bool RMTony::startTalkCalculate(TALKTYPE nTalkType, int &headStartPat, int &body
|
||||||
case UP:
|
case UP:
|
||||||
case DOWN:
|
case DOWN:
|
||||||
case LEFT:
|
case LEFT:
|
||||||
_nBodyOffset.Set(-4, 40);
|
_nBodyOffset.set(-4, 40);
|
||||||
headLoopPat = PAT_TALK_LEFT;
|
headLoopPat = PAT_TALK_LEFT;
|
||||||
bodyLoopPat = BPAT_SIINDICALEFT;
|
bodyLoopPat = BPAT_SIINDICALEFT;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case RIGHT:
|
case RIGHT:
|
||||||
_nBodyOffset.Set(5, 40);
|
_nBodyOffset.set(5, 40);
|
||||||
headLoopPat = PAT_TALK_RIGHT;
|
headLoopPat = PAT_TALK_RIGHT;
|
||||||
bodyLoopPat = BPAT_SIINDICARIGHT;
|
bodyLoopPat = BPAT_SIINDICARIGHT;
|
||||||
break;
|
break;
|
||||||
|
@ -766,7 +766,7 @@ bool RMTony::startTalkCalculate(TALKTYPE nTalkType, int &headStartPat, int &body
|
||||||
case TALK_SPAVENTATO:
|
case TALK_SPAVENTATO:
|
||||||
switch (_TalkDirection) {
|
switch (_TalkDirection) {
|
||||||
case UP:
|
case UP:
|
||||||
_nBodyOffset.Set(-4, -11);
|
_nBodyOffset.set(-4, -11);
|
||||||
headStartPat = PAT_TESTA_UP;
|
headStartPat = PAT_TESTA_UP;
|
||||||
bodyStartPat = BPAT_SPAVENTOUP_START;
|
bodyStartPat = BPAT_SPAVENTOUP_START;
|
||||||
headLoopPat = PAT_TALK_UP;
|
headLoopPat = PAT_TALK_UP;
|
||||||
|
@ -774,7 +774,7 @@ bool RMTony::startTalkCalculate(TALKTYPE nTalkType, int &headStartPat, int &body
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case DOWN:
|
case DOWN:
|
||||||
_nBodyOffset.Set(-5, 45);
|
_nBodyOffset.set(-5, 45);
|
||||||
headStartPat = PAT_SPAVENTODOWN_START;
|
headStartPat = PAT_SPAVENTODOWN_START;
|
||||||
bodyStartPat = BPAT_SPAVENTODOWN_START;
|
bodyStartPat = BPAT_SPAVENTODOWN_START;
|
||||||
headLoopPat = PAT_SPAVENTODOWN_LOOP;
|
headLoopPat = PAT_SPAVENTODOWN_LOOP;
|
||||||
|
@ -782,7 +782,7 @@ bool RMTony::startTalkCalculate(TALKTYPE nTalkType, int &headStartPat, int &body
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case RIGHT:
|
case RIGHT:
|
||||||
_nBodyOffset.Set(-4, 41);
|
_nBodyOffset.set(-4, 41);
|
||||||
headStartPat = PAT_SPAVENTORIGHT_START;
|
headStartPat = PAT_SPAVENTORIGHT_START;
|
||||||
bodyStartPat = BPAT_SPAVENTORIGHT_START;
|
bodyStartPat = BPAT_SPAVENTORIGHT_START;
|
||||||
headLoopPat = PAT_SPAVENTORIGHT_LOOP;
|
headLoopPat = PAT_SPAVENTORIGHT_LOOP;
|
||||||
|
@ -790,7 +790,7 @@ bool RMTony::startTalkCalculate(TALKTYPE nTalkType, int &headStartPat, int &body
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case LEFT:
|
case LEFT:
|
||||||
_nBodyOffset.Set(-10, 41);
|
_nBodyOffset.set(-10, 41);
|
||||||
headStartPat = PAT_SPAVENTOLEFT_START;
|
headStartPat = PAT_SPAVENTOLEFT_START;
|
||||||
bodyStartPat = BPAT_SPAVENTOLEFT_START;
|
bodyStartPat = BPAT_SPAVENTOLEFT_START;
|
||||||
headLoopPat = PAT_SPAVENTOLEFT_LOOP;
|
headLoopPat = PAT_SPAVENTOLEFT_LOOP;
|
||||||
|
@ -805,7 +805,7 @@ bool RMTony::startTalkCalculate(TALKTYPE nTalkType, int &headStartPat, int &body
|
||||||
case UP:
|
case UP:
|
||||||
bodyStartPat = BPAT_STANDUP;
|
bodyStartPat = BPAT_STANDUP;
|
||||||
bodyLoopPat = BPAT_STANDUP;
|
bodyLoopPat = BPAT_STANDUP;
|
||||||
_nBodyOffset.Set(6, 53);
|
_nBodyOffset.set(6, 53);
|
||||||
|
|
||||||
headStartPat = PAT_TESTA_UP;
|
headStartPat = PAT_TESTA_UP;
|
||||||
headLoopPat = PAT_TALK_UP;
|
headLoopPat = PAT_TALK_UP;
|
||||||
|
@ -814,7 +814,7 @@ bool RMTony::startTalkCalculate(TALKTYPE nTalkType, int &headStartPat, int &body
|
||||||
case DOWN:
|
case DOWN:
|
||||||
bodyStartPat = BPAT_STANDDOWN;
|
bodyStartPat = BPAT_STANDDOWN;
|
||||||
bodyLoopPat = BPAT_STANDDOWN;
|
bodyLoopPat = BPAT_STANDDOWN;
|
||||||
_nBodyOffset.Set(4, 53);
|
_nBodyOffset.set(4, 53);
|
||||||
|
|
||||||
headStartPat = PAT_SPAVENTODOWN_START;
|
headStartPat = PAT_SPAVENTODOWN_START;
|
||||||
headLoopPat = PAT_SPAVENTODOWN_LOOP;
|
headLoopPat = PAT_SPAVENTODOWN_LOOP;
|
||||||
|
@ -823,7 +823,7 @@ bool RMTony::startTalkCalculate(TALKTYPE nTalkType, int &headStartPat, int &body
|
||||||
case RIGHT:
|
case RIGHT:
|
||||||
bodyStartPat = BPAT_STANDRIGHT;
|
bodyStartPat = BPAT_STANDRIGHT;
|
||||||
bodyLoopPat = BPAT_STANDRIGHT;
|
bodyLoopPat = BPAT_STANDRIGHT;
|
||||||
_nBodyOffset.Set(6, 56);
|
_nBodyOffset.set(6, 56);
|
||||||
|
|
||||||
headStartPat = PAT_SPAVENTORIGHT_START;
|
headStartPat = PAT_SPAVENTORIGHT_START;
|
||||||
headLoopPat = PAT_SPAVENTORIGHT_LOOP;
|
headLoopPat = PAT_SPAVENTORIGHT_LOOP;
|
||||||
|
@ -832,7 +832,7 @@ bool RMTony::startTalkCalculate(TALKTYPE nTalkType, int &headStartPat, int &body
|
||||||
case LEFT:
|
case LEFT:
|
||||||
bodyStartPat = BPAT_STANDLEFT;
|
bodyStartPat = BPAT_STANDLEFT;
|
||||||
bodyLoopPat = BPAT_STANDLEFT;
|
bodyLoopPat = BPAT_STANDLEFT;
|
||||||
_nBodyOffset.Set(6, 56);
|
_nBodyOffset.set(6, 56);
|
||||||
|
|
||||||
headStartPat = PAT_SPAVENTOLEFT_START;
|
headStartPat = PAT_SPAVENTOLEFT_START;
|
||||||
headLoopPat = PAT_SPAVENTOLEFT_LOOP;
|
headLoopPat = PAT_SPAVENTOLEFT_LOOP;
|
||||||
|
@ -841,27 +841,27 @@ bool RMTony::startTalkCalculate(TALKTYPE nTalkType, int &headStartPat, int &body
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case TALK_CONBICCHIERE:
|
case TALK_CONBICCHIERE:
|
||||||
_nBodyOffset.Set(4, 53);
|
_nBodyOffset.set(4, 53);
|
||||||
headLoopPat = PAT_TALK_DOWN;
|
headLoopPat = PAT_TALK_DOWN;
|
||||||
bodyLoopPat = BPAT_BICCHIERE;
|
bodyLoopPat = BPAT_BICCHIERE;
|
||||||
break;
|
break;
|
||||||
case TALK_CONVERME:
|
case TALK_CONVERME:
|
||||||
_nBodyOffset.Set(9, 56);
|
_nBodyOffset.set(9, 56);
|
||||||
headLoopPat = PAT_TALK_RIGHT;
|
headLoopPat = PAT_TALK_RIGHT;
|
||||||
bodyLoopPat = BPAT_VERME;
|
bodyLoopPat = BPAT_VERME;
|
||||||
break;
|
break;
|
||||||
case TALK_CONMARTELLO:
|
case TALK_CONMARTELLO:
|
||||||
_nBodyOffset.Set(6, 56);
|
_nBodyOffset.set(6, 56);
|
||||||
headLoopPat = PAT_TALK_LEFT;
|
headLoopPat = PAT_TALK_LEFT;
|
||||||
bodyLoopPat = BPAT_MARTELLO;
|
bodyLoopPat = BPAT_MARTELLO;
|
||||||
break;
|
break;
|
||||||
case TALK_CONCORDA:
|
case TALK_CONCORDA:
|
||||||
_nBodyOffset.Set(-3, 38);
|
_nBodyOffset.set(-3, 38);
|
||||||
headLoopPat = PAT_TALK_RIGHT;
|
headLoopPat = PAT_TALK_RIGHT;
|
||||||
bodyLoopPat = BPAT_CORDA;
|
bodyLoopPat = BPAT_CORDA;
|
||||||
break;
|
break;
|
||||||
case TALK_CONSEGRETARIA:
|
case TALK_CONSEGRETARIA:
|
||||||
_nBodyOffset.Set(-17, 12);
|
_nBodyOffset.set(-17, 12);
|
||||||
headLoopPat = PAT_TALK_RIGHT;
|
headLoopPat = PAT_TALK_RIGHT;
|
||||||
bodyLoopPat = BPAT_CONSEGRETARIA;
|
bodyLoopPat = BPAT_CONSEGRETARIA;
|
||||||
break;
|
break;
|
||||||
|
@ -870,7 +870,7 @@ bool RMTony::startTalkCalculate(TALKTYPE nTalkType, int &headStartPat, int &body
|
||||||
switch (_TalkDirection) {
|
switch (_TalkDirection) {
|
||||||
case LEFT:
|
case LEFT:
|
||||||
case UP:
|
case UP:
|
||||||
_nBodyOffset.Set(-21, -5);
|
_nBodyOffset.set(-21, -5);
|
||||||
bodyStartPat = BPAT_CONCONIGLIOLEFT_START;
|
bodyStartPat = BPAT_CONCONIGLIOLEFT_START;
|
||||||
headLoopPat = PAT_TALK_LEFT;
|
headLoopPat = PAT_TALK_LEFT;
|
||||||
bodyLoopPat = BPAT_CONCONIGLIOLEFT_LOOP;
|
bodyLoopPat = BPAT_CONCONIGLIOLEFT_LOOP;
|
||||||
|
@ -878,7 +878,7 @@ bool RMTony::startTalkCalculate(TALKTYPE nTalkType, int &headStartPat, int &body
|
||||||
|
|
||||||
case DOWN:
|
case DOWN:
|
||||||
case RIGHT:
|
case RIGHT:
|
||||||
_nBodyOffset.Set(-4, -5);
|
_nBodyOffset.set(-4, -5);
|
||||||
bodyStartPat = BPAT_CONCONIGLIORIGHT_START;
|
bodyStartPat = BPAT_CONCONIGLIORIGHT_START;
|
||||||
headLoopPat = PAT_TALK_RIGHT;
|
headLoopPat = PAT_TALK_RIGHT;
|
||||||
bodyLoopPat = BPAT_CONCONIGLIORIGHT_LOOP;
|
bodyLoopPat = BPAT_CONCONIGLIORIGHT_LOOP;
|
||||||
|
@ -890,7 +890,7 @@ bool RMTony::startTalkCalculate(TALKTYPE nTalkType, int &headStartPat, int &body
|
||||||
switch (_TalkDirection) {
|
switch (_TalkDirection) {
|
||||||
case LEFT:
|
case LEFT:
|
||||||
case UP:
|
case UP:
|
||||||
_nBodyOffset.Set(-61, -7);
|
_nBodyOffset.set(-61, -7);
|
||||||
bodyStartPat = BPAT_CONRICETTALEFT_START;
|
bodyStartPat = BPAT_CONRICETTALEFT_START;
|
||||||
headLoopPat = PAT_TALK_LEFT;
|
headLoopPat = PAT_TALK_LEFT;
|
||||||
bodyLoopPat = BPAT_CONRICETTALEFT_LOOP;
|
bodyLoopPat = BPAT_CONRICETTALEFT_LOOP;
|
||||||
|
@ -898,7 +898,7 @@ bool RMTony::startTalkCalculate(TALKTYPE nTalkType, int &headStartPat, int &body
|
||||||
|
|
||||||
case DOWN:
|
case DOWN:
|
||||||
case RIGHT:
|
case RIGHT:
|
||||||
_nBodyOffset.Set(-5, -7);
|
_nBodyOffset.set(-5, -7);
|
||||||
bodyStartPat = BPAT_CONRICETTARIGHT_START;
|
bodyStartPat = BPAT_CONRICETTARIGHT_START;
|
||||||
headLoopPat = PAT_TALK_RIGHT;
|
headLoopPat = PAT_TALK_RIGHT;
|
||||||
bodyLoopPat = BPAT_CONRICETTARIGHT_LOOP;
|
bodyLoopPat = BPAT_CONRICETTARIGHT_LOOP;
|
||||||
|
@ -910,7 +910,7 @@ bool RMTony::startTalkCalculate(TALKTYPE nTalkType, int &headStartPat, int &body
|
||||||
switch (_TalkDirection) {
|
switch (_TalkDirection) {
|
||||||
case LEFT:
|
case LEFT:
|
||||||
case UP:
|
case UP:
|
||||||
_nBodyOffset.Set(-34, -2);
|
_nBodyOffset.set(-34, -2);
|
||||||
bodyStartPat = BPAT_CONCARTELEFT_START;
|
bodyStartPat = BPAT_CONCARTELEFT_START;
|
||||||
headLoopPat = PAT_TALK_LEFT;
|
headLoopPat = PAT_TALK_LEFT;
|
||||||
bodyLoopPat = BPAT_CONCARTELEFT_LOOP;
|
bodyLoopPat = BPAT_CONCARTELEFT_LOOP;
|
||||||
|
@ -918,7 +918,7 @@ bool RMTony::startTalkCalculate(TALKTYPE nTalkType, int &headStartPat, int &body
|
||||||
|
|
||||||
case DOWN:
|
case DOWN:
|
||||||
case RIGHT:
|
case RIGHT:
|
||||||
_nBodyOffset.Set(-4, -2);
|
_nBodyOffset.set(-4, -2);
|
||||||
bodyStartPat = BPAT_CONCARTERIGHT_START;
|
bodyStartPat = BPAT_CONCARTERIGHT_START;
|
||||||
headLoopPat = PAT_TALK_RIGHT;
|
headLoopPat = PAT_TALK_RIGHT;
|
||||||
bodyLoopPat = BPAT_CONCARTERIGHT_LOOP;
|
bodyLoopPat = BPAT_CONCARTERIGHT_LOOP;
|
||||||
|
@ -930,7 +930,7 @@ bool RMTony::startTalkCalculate(TALKTYPE nTalkType, int &headStartPat, int &body
|
||||||
switch (_TalkDirection) {
|
switch (_TalkDirection) {
|
||||||
case LEFT:
|
case LEFT:
|
||||||
case UP:
|
case UP:
|
||||||
_nBodyOffset.Set(-35, 2);
|
_nBodyOffset.set(-35, 2);
|
||||||
bodyStartPat = BPAT_CONPUPAZZOLEFT_START;
|
bodyStartPat = BPAT_CONPUPAZZOLEFT_START;
|
||||||
headLoopPat = PAT_TALK_LEFT;
|
headLoopPat = PAT_TALK_LEFT;
|
||||||
bodyLoopPat = BPAT_CONPUPAZZOLEFT_LOOP;
|
bodyLoopPat = BPAT_CONPUPAZZOLEFT_LOOP;
|
||||||
|
@ -938,7 +938,7 @@ bool RMTony::startTalkCalculate(TALKTYPE nTalkType, int &headStartPat, int &body
|
||||||
|
|
||||||
case DOWN:
|
case DOWN:
|
||||||
case RIGHT:
|
case RIGHT:
|
||||||
_nBodyOffset.Set(-14, 2);
|
_nBodyOffset.set(-14, 2);
|
||||||
bodyStartPat = BPAT_CONPUPAZZORIGHT_START;
|
bodyStartPat = BPAT_CONPUPAZZORIGHT_START;
|
||||||
headLoopPat = PAT_TALK_RIGHT;
|
headLoopPat = PAT_TALK_RIGHT;
|
||||||
bodyLoopPat = BPAT_CONPUPAZZORIGHT_LOOP;
|
bodyLoopPat = BPAT_CONPUPAZZORIGHT_LOOP;
|
||||||
|
@ -972,14 +972,14 @@ bool RMTony::startTalkCalculate(TALKTYPE nTalkType, int &headStartPat, int &body
|
||||||
case UP:
|
case UP:
|
||||||
headLoopPat = PAT_TALKBARBA_LEFT;
|
headLoopPat = PAT_TALKBARBA_LEFT;
|
||||||
bodyLoopPat = BPAT_STANDLEFT;
|
bodyLoopPat = BPAT_STANDLEFT;
|
||||||
_nBodyOffset.Set(6, 56);
|
_nBodyOffset.set(6, 56);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case DOWN:
|
case DOWN:
|
||||||
case RIGHT:
|
case RIGHT:
|
||||||
headLoopPat = PAT_TALKBARBA_RIGHT;
|
headLoopPat = PAT_TALKBARBA_RIGHT;
|
||||||
bodyLoopPat = BPAT_STANDRIGHT;
|
bodyLoopPat = BPAT_STANDRIGHT;
|
||||||
_nBodyOffset.Set(6, 56);
|
_nBodyOffset.set(6, 56);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -988,7 +988,7 @@ bool RMTony::startTalkCalculate(TALKTYPE nTalkType, int &headStartPat, int &body
|
||||||
switch (_TalkDirection) {
|
switch (_TalkDirection) {
|
||||||
case LEFT:
|
case LEFT:
|
||||||
case UP:
|
case UP:
|
||||||
_nBodyOffset.Set(6, 56);
|
_nBodyOffset.set(6, 56);
|
||||||
headStartPat = PAT_SCHIFATOLEFT_START;
|
headStartPat = PAT_SCHIFATOLEFT_START;
|
||||||
bodyStartPat = BPAT_STANDLEFT;
|
bodyStartPat = BPAT_STANDLEFT;
|
||||||
headLoopPat = PAT_SCHIFATOLEFT_LOOP;
|
headLoopPat = PAT_SCHIFATOLEFT_LOOP;
|
||||||
|
@ -996,7 +996,7 @@ bool RMTony::startTalkCalculate(TALKTYPE nTalkType, int &headStartPat, int &body
|
||||||
|
|
||||||
case DOWN:
|
case DOWN:
|
||||||
case RIGHT:
|
case RIGHT:
|
||||||
_nBodyOffset.Set(6, 56);
|
_nBodyOffset.set(6, 56);
|
||||||
headStartPat = PAT_SCHIFATORIGHT_START;
|
headStartPat = PAT_SCHIFATORIGHT_START;
|
||||||
bodyStartPat = BPAT_STANDRIGHT;
|
bodyStartPat = BPAT_STANDRIGHT;
|
||||||
headLoopPat = PAT_SCHIFATORIGHT_LOOP;
|
headLoopPat = PAT_SCHIFATORIGHT_LOOP;
|
||||||
|
@ -1008,7 +1008,7 @@ bool RMTony::startTalkCalculate(TALKTYPE nTalkType, int &headStartPat, int &body
|
||||||
switch (_TalkDirection) {
|
switch (_TalkDirection) {
|
||||||
case LEFT:
|
case LEFT:
|
||||||
case UP:
|
case UP:
|
||||||
_nBodyOffset.Set(6, 56);
|
_nBodyOffset.set(6, 56);
|
||||||
headStartPat = PAT_NAAHLEFT_START;
|
headStartPat = PAT_NAAHLEFT_START;
|
||||||
bodyStartPat = BPAT_STANDLEFT;
|
bodyStartPat = BPAT_STANDLEFT;
|
||||||
headLoopPat = PAT_NAAHLEFT_LOOP;
|
headLoopPat = PAT_NAAHLEFT_LOOP;
|
||||||
|
@ -1016,7 +1016,7 @@ bool RMTony::startTalkCalculate(TALKTYPE nTalkType, int &headStartPat, int &body
|
||||||
|
|
||||||
case DOWN:
|
case DOWN:
|
||||||
case RIGHT:
|
case RIGHT:
|
||||||
_nBodyOffset.Set(6, 56);
|
_nBodyOffset.set(6, 56);
|
||||||
headStartPat = PAT_NAAHRIGHT_START;
|
headStartPat = PAT_NAAHRIGHT_START;
|
||||||
bodyStartPat = BPAT_STANDRIGHT;
|
bodyStartPat = BPAT_STANDRIGHT;
|
||||||
headLoopPat = PAT_NAAHRIGHT_LOOP;
|
headLoopPat = PAT_NAAHRIGHT_LOOP;
|
||||||
|
@ -1025,47 +1025,47 @@ bool RMTony::startTalkCalculate(TALKTYPE nTalkType, int &headStartPat, int &body
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case TALK_MACBETH1:
|
case TALK_MACBETH1:
|
||||||
_nBodyOffset.Set(-33, -1);
|
_nBodyOffset.set(-33, -1);
|
||||||
headLoopPat = PAT_TALK_LEFT;
|
headLoopPat = PAT_TALK_LEFT;
|
||||||
bodyLoopPat = BPAT_MACBETH1;
|
bodyLoopPat = BPAT_MACBETH1;
|
||||||
break;
|
break;
|
||||||
case TALK_MACBETH2:
|
case TALK_MACBETH2:
|
||||||
_nBodyOffset.Set(-33, -1);
|
_nBodyOffset.set(-33, -1);
|
||||||
headLoopPat = PAT_TALK_LEFT;
|
headLoopPat = PAT_TALK_LEFT;
|
||||||
bodyLoopPat = BPAT_MACBETH2;
|
bodyLoopPat = BPAT_MACBETH2;
|
||||||
break;
|
break;
|
||||||
case TALK_MACBETH3:
|
case TALK_MACBETH3:
|
||||||
_nBodyOffset.Set(-33, -1);
|
_nBodyOffset.set(-33, -1);
|
||||||
headLoopPat = PAT_TALK_LEFT;
|
headLoopPat = PAT_TALK_LEFT;
|
||||||
bodyLoopPat = BPAT_MACBETH3;
|
bodyLoopPat = BPAT_MACBETH3;
|
||||||
break;
|
break;
|
||||||
case TALK_MACBETH4:
|
case TALK_MACBETH4:
|
||||||
_nBodyOffset.Set(-33, -1);
|
_nBodyOffset.set(-33, -1);
|
||||||
headLoopPat = PAT_TALK_LEFT;
|
headLoopPat = PAT_TALK_LEFT;
|
||||||
bodyLoopPat = BPAT_MACBETH4;
|
bodyLoopPat = BPAT_MACBETH4;
|
||||||
break;
|
break;
|
||||||
case TALK_MACBETH5:
|
case TALK_MACBETH5:
|
||||||
_nBodyOffset.Set(-33, -1);
|
_nBodyOffset.set(-33, -1);
|
||||||
headLoopPat = PAT_TALK_LEFT;
|
headLoopPat = PAT_TALK_LEFT;
|
||||||
bodyLoopPat = BPAT_MACBETH5;
|
bodyLoopPat = BPAT_MACBETH5;
|
||||||
break;
|
break;
|
||||||
case TALK_MACBETH6:
|
case TALK_MACBETH6:
|
||||||
_nBodyOffset.Set(-33, -1);
|
_nBodyOffset.set(-33, -1);
|
||||||
headLoopPat = PAT_TALK_LEFT;
|
headLoopPat = PAT_TALK_LEFT;
|
||||||
bodyLoopPat = BPAT_MACBETH6;
|
bodyLoopPat = BPAT_MACBETH6;
|
||||||
break;
|
break;
|
||||||
case TALK_MACBETH7:
|
case TALK_MACBETH7:
|
||||||
_nBodyOffset.Set(-33, -1);
|
_nBodyOffset.set(-33, -1);
|
||||||
headLoopPat = PAT_TALK_LEFT;
|
headLoopPat = PAT_TALK_LEFT;
|
||||||
bodyLoopPat = BPAT_MACBETH7;
|
bodyLoopPat = BPAT_MACBETH7;
|
||||||
break;
|
break;
|
||||||
case TALK_MACBETH8:
|
case TALK_MACBETH8:
|
||||||
_nBodyOffset.Set(-33, -1);
|
_nBodyOffset.set(-33, -1);
|
||||||
headLoopPat = PAT_TALK_LEFT;
|
headLoopPat = PAT_TALK_LEFT;
|
||||||
bodyLoopPat = BPAT_MACBETH8;
|
bodyLoopPat = BPAT_MACBETH8;
|
||||||
break;
|
break;
|
||||||
case TALK_MACBETH9:
|
case TALK_MACBETH9:
|
||||||
_nBodyOffset.Set(-33, -1);
|
_nBodyOffset.set(-33, -1);
|
||||||
headLoopPat = PAT_TALK_LEFT;
|
headLoopPat = PAT_TALK_LEFT;
|
||||||
bodyLoopPat = BPAT_MACBETH9;
|
bodyLoopPat = BPAT_MACBETH9;
|
||||||
break;
|
break;
|
||||||
|
@ -1076,7 +1076,7 @@ bool RMTony::startTalkCalculate(TALKTYPE nTalkType, int &headStartPat, int &body
|
||||||
case DOWN:
|
case DOWN:
|
||||||
bodyStartPat = BPAT_STANDDOWN;
|
bodyStartPat = BPAT_STANDDOWN;
|
||||||
bodyLoopPat = BPAT_STANDDOWN;
|
bodyLoopPat = BPAT_STANDDOWN;
|
||||||
_nBodyOffset.Set(4, 53);
|
_nBodyOffset.set(4, 53);
|
||||||
|
|
||||||
headStartPat = PAT_SPAVENTODOWN_STAND;
|
headStartPat = PAT_SPAVENTODOWN_STAND;
|
||||||
headLoopPat = PAT_SPAVENTODOWN_LOOP;
|
headLoopPat = PAT_SPAVENTODOWN_LOOP;
|
||||||
|
@ -1085,7 +1085,7 @@ bool RMTony::startTalkCalculate(TALKTYPE nTalkType, int &headStartPat, int &body
|
||||||
case RIGHT:
|
case RIGHT:
|
||||||
bodyStartPat = BPAT_STANDRIGHT;
|
bodyStartPat = BPAT_STANDRIGHT;
|
||||||
bodyLoopPat = BPAT_STANDRIGHT;
|
bodyLoopPat = BPAT_STANDRIGHT;
|
||||||
_nBodyOffset.Set(6, 56);
|
_nBodyOffset.set(6, 56);
|
||||||
|
|
||||||
headStartPat = PAT_SPAVENTORIGHT_STAND;
|
headStartPat = PAT_SPAVENTORIGHT_STAND;
|
||||||
headLoopPat = PAT_SPAVENTORIGHT_LOOP;
|
headLoopPat = PAT_SPAVENTORIGHT_LOOP;
|
||||||
|
@ -1094,7 +1094,7 @@ bool RMTony::startTalkCalculate(TALKTYPE nTalkType, int &headStartPat, int &body
|
||||||
case LEFT:
|
case LEFT:
|
||||||
bodyStartPat = BPAT_STANDLEFT;
|
bodyStartPat = BPAT_STANDLEFT;
|
||||||
bodyLoopPat = BPAT_STANDLEFT;
|
bodyLoopPat = BPAT_STANDLEFT;
|
||||||
_nBodyOffset.Set(6, 56);
|
_nBodyOffset.set(6, 56);
|
||||||
|
|
||||||
headStartPat = PAT_SPAVENTOLEFT_STAND;
|
headStartPat = PAT_SPAVENTOLEFT_STAND;
|
||||||
headLoopPat = PAT_SPAVENTOLEFT_LOOP;
|
headLoopPat = PAT_SPAVENTOLEFT_LOOP;
|
||||||
|
@ -1450,10 +1450,10 @@ void RMTony::endTalk(CORO_PARAM) {
|
||||||
setPattern(0);
|
setPattern(0);
|
||||||
if (_TalkDirection == UP || _TalkDirection == LEFT) {
|
if (_TalkDirection == UP || _TalkDirection == LEFT) {
|
||||||
_body.setPattern(BPAT_CONBARBALEFT_STATIC);
|
_body.setPattern(BPAT_CONBARBALEFT_STATIC);
|
||||||
_nBodyOffset.Set(-41, -14);
|
_nBodyOffset.set(-41, -14);
|
||||||
} else if (_TalkDirection == DOWN || _TalkDirection == RIGHT) {
|
} else if (_TalkDirection == DOWN || _TalkDirection == RIGHT) {
|
||||||
_body.setPattern(BPAT_CONBARBARIGHT_STATIC);
|
_body.setPattern(BPAT_CONBARBARIGHT_STATIC);
|
||||||
_nBodyOffset.Set(-26, -14);
|
_nBodyOffset.set(-26, -14);
|
||||||
}
|
}
|
||||||
mainUnfreeze();
|
mainUnfreeze();
|
||||||
} else {
|
} else {
|
||||||
|
@ -1564,14 +1564,14 @@ void RMTony::startStaticCalculate(TALKTYPE nTalk, int &headPat, int &headLoopPat
|
||||||
switch (_TalkDirection) {
|
switch (_TalkDirection) {
|
||||||
case UP:
|
case UP:
|
||||||
case LEFT:
|
case LEFT:
|
||||||
_nBodyOffset.Set(-21, -5);
|
_nBodyOffset.set(-21, -5);
|
||||||
bodyStartPat = BPAT_CONCONIGLIOLEFT_START;
|
bodyStartPat = BPAT_CONCONIGLIOLEFT_START;
|
||||||
bodyLoopPat = BPAT_CONCONIGLIOLEFT_LOOP;
|
bodyLoopPat = BPAT_CONCONIGLIOLEFT_LOOP;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case DOWN:
|
case DOWN:
|
||||||
case RIGHT:
|
case RIGHT:
|
||||||
_nBodyOffset.Set(-4, -5);
|
_nBodyOffset.set(-4, -5);
|
||||||
bodyStartPat = BPAT_CONCONIGLIORIGHT_START;
|
bodyStartPat = BPAT_CONCONIGLIORIGHT_START;
|
||||||
bodyLoopPat = BPAT_CONCONIGLIORIGHT_LOOP;
|
bodyLoopPat = BPAT_CONCONIGLIORIGHT_LOOP;
|
||||||
break;
|
break;
|
||||||
|
@ -1582,14 +1582,14 @@ void RMTony::startStaticCalculate(TALKTYPE nTalk, int &headPat, int &headLoopPat
|
||||||
switch (_TalkDirection) {
|
switch (_TalkDirection) {
|
||||||
case UP:
|
case UP:
|
||||||
case LEFT:
|
case LEFT:
|
||||||
_nBodyOffset.Set(-34, -2);
|
_nBodyOffset.set(-34, -2);
|
||||||
bodyStartPat = BPAT_CONCARTELEFT_START;
|
bodyStartPat = BPAT_CONCARTELEFT_START;
|
||||||
bodyLoopPat = BPAT_CONCARTELEFT_LOOP;
|
bodyLoopPat = BPAT_CONCARTELEFT_LOOP;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case DOWN:
|
case DOWN:
|
||||||
case RIGHT:
|
case RIGHT:
|
||||||
_nBodyOffset.Set(-4, -2);
|
_nBodyOffset.set(-4, -2);
|
||||||
bodyStartPat = BPAT_CONCARTERIGHT_START;
|
bodyStartPat = BPAT_CONCARTERIGHT_START;
|
||||||
bodyLoopPat = BPAT_CONCARTERIGHT_LOOP;
|
bodyLoopPat = BPAT_CONCARTERIGHT_LOOP;
|
||||||
break;
|
break;
|
||||||
|
@ -1600,14 +1600,14 @@ void RMTony::startStaticCalculate(TALKTYPE nTalk, int &headPat, int &headLoopPat
|
||||||
switch (_TalkDirection) {
|
switch (_TalkDirection) {
|
||||||
case UP:
|
case UP:
|
||||||
case LEFT:
|
case LEFT:
|
||||||
_nBodyOffset.Set(-61, -7);
|
_nBodyOffset.set(-61, -7);
|
||||||
bodyStartPat = BPAT_CONRICETTALEFT_START;
|
bodyStartPat = BPAT_CONRICETTALEFT_START;
|
||||||
bodyLoopPat = BPAT_CONRICETTALEFT_LOOP;
|
bodyLoopPat = BPAT_CONRICETTALEFT_LOOP;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case DOWN:
|
case DOWN:
|
||||||
case RIGHT:
|
case RIGHT:
|
||||||
_nBodyOffset.Set(-5, -7);
|
_nBodyOffset.set(-5, -7);
|
||||||
bodyStartPat = BPAT_CONRICETTARIGHT_START;
|
bodyStartPat = BPAT_CONRICETTARIGHT_START;
|
||||||
bodyLoopPat = BPAT_CONRICETTARIGHT_LOOP;
|
bodyLoopPat = BPAT_CONRICETTARIGHT_LOOP;
|
||||||
break;
|
break;
|
||||||
|
@ -1618,14 +1618,14 @@ void RMTony::startStaticCalculate(TALKTYPE nTalk, int &headPat, int &headLoopPat
|
||||||
switch (_TalkDirection) {
|
switch (_TalkDirection) {
|
||||||
case UP:
|
case UP:
|
||||||
case LEFT:
|
case LEFT:
|
||||||
_nBodyOffset.Set(-35, 2);
|
_nBodyOffset.set(-35, 2);
|
||||||
bodyStartPat = BPAT_CONPUPAZZOLEFT_START;
|
bodyStartPat = BPAT_CONPUPAZZOLEFT_START;
|
||||||
bodyLoopPat = BPAT_CONPUPAZZOLEFT_LOOP;
|
bodyLoopPat = BPAT_CONPUPAZZOLEFT_LOOP;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case DOWN:
|
case DOWN:
|
||||||
case RIGHT:
|
case RIGHT:
|
||||||
_nBodyOffset.Set(-14, 2);
|
_nBodyOffset.set(-14, 2);
|
||||||
bodyStartPat = BPAT_CONPUPAZZORIGHT_START;
|
bodyStartPat = BPAT_CONPUPAZZORIGHT_START;
|
||||||
bodyLoopPat = BPAT_CONPUPAZZORIGHT_LOOP;
|
bodyLoopPat = BPAT_CONPUPAZZORIGHT_LOOP;
|
||||||
break;
|
break;
|
||||||
|
@ -1636,14 +1636,14 @@ void RMTony::startStaticCalculate(TALKTYPE nTalk, int &headPat, int &headLoopPat
|
||||||
switch (_TalkDirection) {
|
switch (_TalkDirection) {
|
||||||
case UP:
|
case UP:
|
||||||
case LEFT:
|
case LEFT:
|
||||||
_nBodyOffset.Set(-16, -9);
|
_nBodyOffset.set(-16, -9);
|
||||||
bodyStartPat = BPAT_CONTACCUINOLEFT_START;
|
bodyStartPat = BPAT_CONTACCUINOLEFT_START;
|
||||||
bodyLoopPat = BPAT_CONTACCUINOLEFT_LOOP;
|
bodyLoopPat = BPAT_CONTACCUINOLEFT_LOOP;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case DOWN:
|
case DOWN:
|
||||||
case RIGHT:
|
case RIGHT:
|
||||||
_nBodyOffset.Set(-6, -9);
|
_nBodyOffset.set(-6, -9);
|
||||||
bodyStartPat = BPAT_CONTACCUINORIGHT_START;
|
bodyStartPat = BPAT_CONTACCUINORIGHT_START;
|
||||||
bodyLoopPat = BPAT_CONTACCUINORIGHT_LOOP;
|
bodyLoopPat = BPAT_CONTACCUINORIGHT_LOOP;
|
||||||
break;
|
break;
|
||||||
|
@ -1654,14 +1654,14 @@ void RMTony::startStaticCalculate(TALKTYPE nTalk, int &headPat, int &headLoopPat
|
||||||
switch (_TalkDirection) {
|
switch (_TalkDirection) {
|
||||||
case UP:
|
case UP:
|
||||||
case LEFT:
|
case LEFT:
|
||||||
_nBodyOffset.Set(-41, -8);
|
_nBodyOffset.set(-41, -8);
|
||||||
bodyStartPat = BPAT_CONMEGAFONOLEFT_START;
|
bodyStartPat = BPAT_CONMEGAFONOLEFT_START;
|
||||||
bodyLoopPat = BPAT_CONMEGAFONOLEFT_LOOP;
|
bodyLoopPat = BPAT_CONMEGAFONOLEFT_LOOP;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case DOWN:
|
case DOWN:
|
||||||
case RIGHT:
|
case RIGHT:
|
||||||
_nBodyOffset.Set(-14, -8);
|
_nBodyOffset.set(-14, -8);
|
||||||
bodyStartPat = BPAT_CONMEGAFONORIGHT_START;
|
bodyStartPat = BPAT_CONMEGAFONORIGHT_START;
|
||||||
bodyLoopPat = BPAT_CONMEGAFONORIGHT_LOOP;
|
bodyLoopPat = BPAT_CONMEGAFONORIGHT_LOOP;
|
||||||
break;
|
break;
|
||||||
|
@ -1672,7 +1672,7 @@ void RMTony::startStaticCalculate(TALKTYPE nTalk, int &headPat, int &headLoopPat
|
||||||
switch (_TalkDirection) {
|
switch (_TalkDirection) {
|
||||||
case UP:
|
case UP:
|
||||||
case LEFT:
|
case LEFT:
|
||||||
_nBodyOffset.Set(-41, -14);
|
_nBodyOffset.set(-41, -14);
|
||||||
bodyStartPat = BPAT_CONBARBALEFT_START;
|
bodyStartPat = BPAT_CONBARBALEFT_START;
|
||||||
bodyLoopPat = BPAT_STANDLEFT;
|
bodyLoopPat = BPAT_STANDLEFT;
|
||||||
headLoopPat = PAT_TALKBARBA_LEFT;
|
headLoopPat = PAT_TALKBARBA_LEFT;
|
||||||
|
@ -1681,7 +1681,7 @@ void RMTony::startStaticCalculate(TALKTYPE nTalk, int &headPat, int &headLoopPat
|
||||||
|
|
||||||
case DOWN:
|
case DOWN:
|
||||||
case RIGHT:
|
case RIGHT:
|
||||||
_nBodyOffset.Set(-26, -14);
|
_nBodyOffset.set(-26, -14);
|
||||||
bodyStartPat = BPAT_CONBARBARIGHT_START;
|
bodyStartPat = BPAT_CONBARBARIGHT_START;
|
||||||
bodyLoopPat = BPAT_STANDRIGHT;
|
bodyLoopPat = BPAT_STANDRIGHT;
|
||||||
headLoopPat = PAT_TALKBARBA_RIGHT;
|
headLoopPat = PAT_TALKBARBA_RIGHT;
|
||||||
|
@ -1697,7 +1697,7 @@ void RMTony::startStaticCalculate(TALKTYPE nTalk, int &headPat, int &headLoopPat
|
||||||
bodyLoopPat = BPAT_STANDDOWN;
|
bodyLoopPat = BPAT_STANDDOWN;
|
||||||
bodyStartPat = BPAT_STANDDOWN;
|
bodyStartPat = BPAT_STANDDOWN;
|
||||||
headLoopPat = PAT_SPAVENTODOWN_STAND;
|
headLoopPat = PAT_SPAVENTODOWN_STAND;
|
||||||
_nBodyOffset.Set(4, 53);
|
_nBodyOffset.set(4, 53);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case LEFT:
|
case LEFT:
|
||||||
|
@ -1705,7 +1705,7 @@ void RMTony::startStaticCalculate(TALKTYPE nTalk, int &headPat, int &headLoopPat
|
||||||
bodyLoopPat = BPAT_STANDLEFT;
|
bodyLoopPat = BPAT_STANDLEFT;
|
||||||
bodyStartPat = BPAT_STANDLEFT;
|
bodyStartPat = BPAT_STANDLEFT;
|
||||||
headLoopPat = PAT_SPAVENTOLEFT_STAND;
|
headLoopPat = PAT_SPAVENTOLEFT_STAND;
|
||||||
_nBodyOffset.Set(6, 56);
|
_nBodyOffset.set(6, 56);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case RIGHT:
|
case RIGHT:
|
||||||
|
@ -1713,7 +1713,7 @@ void RMTony::startStaticCalculate(TALKTYPE nTalk, int &headPat, int &headLoopPat
|
||||||
bodyLoopPat = BPAT_STANDRIGHT;
|
bodyLoopPat = BPAT_STANDRIGHT;
|
||||||
bodyStartPat = BPAT_STANDRIGHT;
|
bodyStartPat = BPAT_STANDRIGHT;
|
||||||
headLoopPat = PAT_SPAVENTORIGHT_STAND;
|
headLoopPat = PAT_SPAVENTORIGHT_STAND;
|
||||||
_nBodyOffset.Set(6, 56);
|
_nBodyOffset.set(6, 56);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
|
|
@ -40,17 +40,17 @@ namespace Tony {
|
||||||
* Constructor
|
* Constructor
|
||||||
*/
|
*/
|
||||||
RMString::RMString() {
|
RMString::RMString() {
|
||||||
m_string = NULL;
|
_string = NULL;
|
||||||
m_length = 0;
|
_length = 0;
|
||||||
m_realLength = 0;
|
_realLength = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Destructor
|
* Destructor
|
||||||
*/
|
*/
|
||||||
RMString::~RMString() {
|
RMString::~RMString() {
|
||||||
if (m_string != NULL)
|
if (_string != NULL)
|
||||||
delete[] m_string;
|
delete[] _string;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -58,9 +58,9 @@ RMString::~RMString() {
|
||||||
*/
|
*/
|
||||||
RMString::RMString(const RMString &str) {
|
RMString::RMString(const RMString &str) {
|
||||||
// Richiama l'overload su '=' per copiare
|
// Richiama l'overload su '=' per copiare
|
||||||
m_string = NULL;
|
_string = NULL;
|
||||||
m_length = 0;
|
_length = 0;
|
||||||
m_realLength = 0;
|
_realLength = 0;
|
||||||
*this = str;
|
*this = str;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -69,9 +69,9 @@ RMString::RMString(const RMString &str) {
|
||||||
*/
|
*/
|
||||||
RMString::RMString(const char *str) {
|
RMString::RMString(const char *str) {
|
||||||
// Use the overloaded '=' when copying
|
// Use the overloaded '=' when copying
|
||||||
m_string = NULL;
|
_string = NULL;
|
||||||
m_length = 0;
|
_length = 0;
|
||||||
m_realLength = 0;
|
_realLength = 0;
|
||||||
*this = str;
|
*this = str;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -80,9 +80,9 @@ RMString::RMString(const char *str) {
|
||||||
*/
|
*/
|
||||||
RMString::RMString(const int ch) {
|
RMString::RMString(const int ch) {
|
||||||
// Use the overloaded '=' when copying
|
// Use the overloaded '=' when copying
|
||||||
m_string = NULL;
|
_string = NULL;
|
||||||
m_length = 0;
|
_length = 0;
|
||||||
m_realLength = 0;
|
_realLength = 0;
|
||||||
*this = ch;
|
*this = ch;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -90,8 +90,8 @@ RMString::RMString(const int ch) {
|
||||||
* Returns the length of the string
|
* Returns the length of the string
|
||||||
* @returns Length
|
* @returns Length
|
||||||
*/
|
*/
|
||||||
int RMString::Length() const {
|
int RMString::length() const {
|
||||||
return m_length;
|
return _length;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -99,9 +99,9 @@ int RMString::Length() const {
|
||||||
* @param nIndex Position of the character to return
|
* @param nIndex Position of the character to return
|
||||||
* @returns Character
|
* @returns Character
|
||||||
*/
|
*/
|
||||||
char RMString::GetAt(int nIndex) {
|
char RMString::getAt(int nIndex) {
|
||||||
assert(nIndex < m_length);
|
assert(nIndex < _length);
|
||||||
return m_string[nIndex];
|
return _string[nIndex];
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -109,9 +109,9 @@ char RMString::GetAt(int nIndex) {
|
||||||
* @param nIndex Position of the character to change
|
* @param nIndex Position of the character to change
|
||||||
* @param c Character
|
* @param c Character
|
||||||
*/
|
*/
|
||||||
void RMString::SetAt(int nIndex, char c) {
|
void RMString::setAt(int nIndex, char c) {
|
||||||
assert(nIndex < m_length);
|
assert(nIndex < _length);
|
||||||
m_string[nIndex] = c;
|
_string[nIndex] = c;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -120,8 +120,8 @@ void RMString::SetAt(int nIndex, char c) {
|
||||||
* @params Reference to the character
|
* @params Reference to the character
|
||||||
*/
|
*/
|
||||||
char &RMString::operator[](int nIndex) {
|
char &RMString::operator[](int nIndex) {
|
||||||
assert(nIndex < m_length);
|
assert(nIndex < _length);
|
||||||
return m_string[nIndex];
|
return _string[nIndex];
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -131,21 +131,21 @@ char &RMString::operator[](int nIndex) {
|
||||||
*/
|
*/
|
||||||
const RMString &RMString::operator=(const RMString &str) {
|
const RMString &RMString::operator=(const RMString &str) {
|
||||||
// Set the new length
|
// Set the new length
|
||||||
m_length = str.m_length;
|
_length = str._length;
|
||||||
|
|
||||||
// If the source is empty, then destroy the current string buffer
|
// If the source is empty, then destroy the current string buffer
|
||||||
if (m_length == 0) {
|
if (_length == 0) {
|
||||||
if (m_realLength > 0) {
|
if (_realLength > 0) {
|
||||||
delete[] m_string;
|
delete[] _string;
|
||||||
m_string = NULL;
|
_string = NULL;
|
||||||
m_realLength = 0;
|
_realLength = 0;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// Resize if necessary
|
// Resize if necessary
|
||||||
Resize(m_length + 1);
|
resize(_length + 1);
|
||||||
|
|
||||||
// Copy the string
|
// Copy the string
|
||||||
Common::copy(str.m_string, str.m_string + m_length + 1, m_string);
|
Common::copy(str._string, str._string + _length + 1, _string);
|
||||||
}
|
}
|
||||||
|
|
||||||
return *this;
|
return *this;
|
||||||
|
@ -159,20 +159,20 @@ const RMString &RMString::operator=(const RMString &str) {
|
||||||
const RMString &RMString::operator=(const char *str) {
|
const RMString &RMString::operator=(const char *str) {
|
||||||
// If the source is empty, then destroy the current string buffer
|
// If the source is empty, then destroy the current string buffer
|
||||||
if (str == NULL) {
|
if (str == NULL) {
|
||||||
if (m_realLength > 0) {
|
if (_realLength > 0) {
|
||||||
delete[] m_string;
|
delete[] _string;
|
||||||
m_string = NULL;
|
_string = NULL;
|
||||||
m_realLength = m_length = 0;
|
_realLength = _length = 0;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// Calculate the new length
|
// Calculate the new length
|
||||||
m_length = strlen(str);
|
_length = strlen(str);
|
||||||
|
|
||||||
// Resize if necessary
|
// Resize if necessary
|
||||||
Resize(m_length + 1);
|
resize(_length + 1);
|
||||||
|
|
||||||
// Copy the string
|
// Copy the string
|
||||||
Common::copy(str, str + m_length + 1, m_string);
|
Common::copy(str, str + _length + 1, _string);
|
||||||
}
|
}
|
||||||
|
|
||||||
return *this;
|
return *this;
|
||||||
|
@ -186,18 +186,18 @@ const RMString &RMString::operator=(const char *str) {
|
||||||
const RMString &RMString::operator=(const int ch) {
|
const RMString &RMString::operator=(const int ch) {
|
||||||
if (ch == '\0') {
|
if (ch == '\0') {
|
||||||
// Destroy the current string
|
// Destroy the current string
|
||||||
if (m_realLength > 0) {
|
if (_realLength > 0) {
|
||||||
delete [] m_string;
|
delete [] _string;
|
||||||
m_string = NULL;
|
_string = NULL;
|
||||||
m_length = m_realLength = 0;
|
_length = _realLength = 0;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// Resize if necessary
|
// Resize if necessary
|
||||||
Resize(2);
|
resize(2);
|
||||||
|
|
||||||
m_string[0] = ch;
|
_string[0] = ch;
|
||||||
m_string[1] = '\0';
|
_string[1] = '\0';
|
||||||
m_length = 1;
|
_length = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
return *this;
|
return *this;
|
||||||
|
@ -208,21 +208,21 @@ const RMString &RMString::operator=(const int ch) {
|
||||||
* @param str String to concatenate
|
* @param str String to concatenate
|
||||||
* @param size Length of the string
|
* @param size Length of the string
|
||||||
*/
|
*/
|
||||||
void RMString::Connect(const char *str, int size) {
|
void RMString::connect(const char *str, int size) {
|
||||||
int nlen;
|
int nlen;
|
||||||
|
|
||||||
if (size > 0) {
|
if (size > 0) {
|
||||||
// Calculate the new lenght
|
// Calculate the new lenght
|
||||||
nlen = m_length + size;
|
nlen = _length + size;
|
||||||
|
|
||||||
// Resize
|
// Resize
|
||||||
Resize(nlen + 1, true);
|
resize(nlen + 1, true);
|
||||||
|
|
||||||
// Linkage with '\0'
|
// Linkage with '\0'
|
||||||
Common::copy(str, str + size + 1, m_string + m_length);
|
Common::copy(str, str + size + 1, _string + _length);
|
||||||
|
|
||||||
// Save the new length
|
// Save the new length
|
||||||
m_length = nlen;
|
_length = nlen;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -232,7 +232,7 @@ void RMString::Connect(const char *str, int size) {
|
||||||
* @returns Refrence to our string
|
* @returns Refrence to our string
|
||||||
*/
|
*/
|
||||||
const RMString &RMString::operator+=(RMString &str) {
|
const RMString &RMString::operator+=(RMString &str) {
|
||||||
Connect(str, str.Length());
|
connect(str, str.length());
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -258,7 +258,7 @@ const RMString &RMString::operator+=(const int ch) {
|
||||||
str[0] = ch;
|
str[0] = ch;
|
||||||
str[1] = '\0';
|
str[1] = '\0';
|
||||||
|
|
||||||
Connect(str, 1);
|
connect(str, 1);
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -267,7 +267,7 @@ const RMString &RMString::operator+=(const int ch) {
|
||||||
* @returns char * reference to string
|
* @returns char * reference to string
|
||||||
*/
|
*/
|
||||||
RMString::operator char *() const {
|
RMString::operator char *() const {
|
||||||
return m_string;
|
return _string;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -276,21 +276,21 @@ RMString::operator char *() const {
|
||||||
* @param bMaintain If true we must keep the original string,
|
* @param bMaintain If true we must keep the original string,
|
||||||
if false we can destroy.
|
if false we can destroy.
|
||||||
*/
|
*/
|
||||||
void RMString::Resize(int size, bool bMantain) {
|
void RMString::resize(int size, bool bMantain) {
|
||||||
if (m_realLength == 0) {
|
if (_realLength == 0) {
|
||||||
m_string = new char[size];
|
_string = new char[size];
|
||||||
m_realLength = size;
|
_realLength = size;
|
||||||
} else if (size > m_realLength) {
|
} else if (size > _realLength) {
|
||||||
if (bMantain) {
|
if (bMantain) {
|
||||||
char *app;
|
char *app;
|
||||||
|
|
||||||
app = new char[size];
|
app = new char[size];
|
||||||
Common::copy(m_string, m_string + m_length + 1, app);
|
Common::copy(_string, _string + _length + 1, app);
|
||||||
delete[] m_string;
|
delete[] _string;
|
||||||
m_string = app;
|
_string = app;
|
||||||
} else {
|
} else {
|
||||||
delete[] m_string;
|
delete[] _string;
|
||||||
m_string = new char[size];
|
_string = new char[size];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -298,15 +298,15 @@ void RMString::Resize(int size, bool bMantain) {
|
||||||
/**
|
/**
|
||||||
* Compacts the string to occupy less memory if possible.
|
* Compacts the string to occupy less memory if possible.
|
||||||
*/
|
*/
|
||||||
void RMString::Compact(void) {
|
void RMString::compact(void) {
|
||||||
if (m_realLength + 1 > m_length) {
|
if (_realLength + 1 > _length) {
|
||||||
char *app;
|
char *app;
|
||||||
|
|
||||||
app = new char[m_length + 1];
|
app = new char[_length + 1];
|
||||||
Common::copy(m_string, m_string + m_length + 1, app);
|
Common::copy(_string, _string + _length + 1, app);
|
||||||
|
|
||||||
delete[] m_string;
|
delete[] _string;
|
||||||
m_string = app;
|
_string = app;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -359,14 +359,14 @@ RMDataStream &operator>>(RMDataStream &df, RMString &var) {
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
df >> len;
|
df >> len;
|
||||||
var.Resize(len + 1);
|
var.resize(len + 1);
|
||||||
var.m_length = len + 1;
|
var._length = len + 1;
|
||||||
|
|
||||||
for (i = 0; i < len; i++)
|
for (i = 0; i < len; i++)
|
||||||
df >> var[i];
|
df >> var[i];
|
||||||
|
|
||||||
var[i] = '\0';
|
var[i] = '\0';
|
||||||
var.m_length = len;
|
var._length = len;
|
||||||
|
|
||||||
return df;
|
return df;
|
||||||
}
|
}
|
||||||
|
@ -374,7 +374,7 @@ RMDataStream &operator>>(RMDataStream &df, RMString &var) {
|
||||||
/**
|
/**
|
||||||
* Formats a string
|
* Formats a string
|
||||||
*/
|
*/
|
||||||
void RMString::Format(const char *str, ...) {
|
void RMString::format(const char *str, ...) {
|
||||||
static char buf[2048];
|
static char buf[2048];
|
||||||
va_list argList;
|
va_list argList;
|
||||||
|
|
||||||
|
@ -393,29 +393,29 @@ RMFileStreamSlow::RMFileStreamSlow() : RMDataStream() {
|
||||||
}
|
}
|
||||||
|
|
||||||
RMFileStreamSlow::~RMFileStreamSlow() {
|
RMFileStreamSlow::~RMFileStreamSlow() {
|
||||||
Close();
|
close();
|
||||||
}
|
}
|
||||||
|
|
||||||
void RMFileStreamSlow::Close() {
|
void RMFileStreamSlow::close() {
|
||||||
delete _stream;
|
delete _stream;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool RMFileStreamSlow::OpenFile(Common::File &file) {
|
bool RMFileStreamSlow::openFile(Common::File &file) {
|
||||||
_stream = file.readStream(file.size());
|
_stream = file.readStream(file.size());
|
||||||
|
|
||||||
m_length = _stream->pos();
|
_length = _stream->pos();
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool RMFileStreamSlow::OpenFile(const char *lpFN) {
|
bool RMFileStreamSlow::openFile(const char *lpFN) {
|
||||||
// Open file for reading
|
// Open file for reading
|
||||||
Common::File f;
|
Common::File f;
|
||||||
if (!f.open(lpFN))
|
if (!f.open(lpFN))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
m_length = f.size();
|
_length = f.size();
|
||||||
_stream = f.readStream(f.size());
|
_stream = f.readStream(f.size());
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
@ -423,20 +423,20 @@ bool RMFileStreamSlow::OpenFile(const char *lpFN) {
|
||||||
|
|
||||||
|
|
||||||
RMDataStream &RMFileStreamSlow::operator+=(int nBytes) {
|
RMDataStream &RMFileStreamSlow::operator+=(int nBytes) {
|
||||||
Seek(nBytes);
|
seek(nBytes);
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
int RMFileStreamSlow::Pos() {
|
int RMFileStreamSlow::pos() {
|
||||||
return _stream->pos();
|
return _stream->pos();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool RMFileStreamSlow::IsEOF() {
|
bool RMFileStreamSlow::isEOF() {
|
||||||
return (Pos() >= m_length);
|
return (pos() >= _length);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int RMFileStreamSlow::Seek(int nBytes, RMDSPos where) {
|
int RMFileStreamSlow::seek(int nBytes, RMDSPos where) {
|
||||||
switch (where) {
|
switch (where) {
|
||||||
case START:
|
case START:
|
||||||
return _stream->seek(nBytes);
|
return _stream->seek(nBytes);
|
||||||
|
@ -453,7 +453,7 @@ int RMFileStreamSlow::Seek(int nBytes, RMDSPos where) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool RMFileStreamSlow::Read(void *buf, int size) {
|
bool RMFileStreamSlow::read(void *buf, int size) {
|
||||||
uint32 dwRead;
|
uint32 dwRead;
|
||||||
|
|
||||||
dwRead = _stream->read(buf, size);
|
dwRead = _stream->read(buf, size);
|
||||||
|
@ -462,39 +462,39 @@ bool RMFileStreamSlow::Read(void *buf, int size) {
|
||||||
|
|
||||||
|
|
||||||
RMFileStreamSlow &operator>>(RMFileStreamSlow &df, char &var) {
|
RMFileStreamSlow &operator>>(RMFileStreamSlow &df, char &var) {
|
||||||
df.Read(&var, 1);
|
df.read(&var, 1);
|
||||||
return df;
|
return df;
|
||||||
}
|
}
|
||||||
|
|
||||||
RMFileStreamSlow &operator>>(RMFileStreamSlow &df, byte &var) {
|
RMFileStreamSlow &operator>>(RMFileStreamSlow &df, byte &var) {
|
||||||
df.Read(&var, 1);
|
df.read(&var, 1);
|
||||||
return df;
|
return df;
|
||||||
}
|
}
|
||||||
|
|
||||||
RMFileStreamSlow &operator>>(RMFileStreamSlow &df, uint16 &var) {
|
RMFileStreamSlow &operator>>(RMFileStreamSlow &df, uint16 &var) {
|
||||||
uint16 v;
|
uint16 v;
|
||||||
df.Read(&v, 2);
|
df.read(&v, 2);
|
||||||
v = FROM_LE_16(v);
|
v = FROM_LE_16(v);
|
||||||
return df;
|
return df;
|
||||||
}
|
}
|
||||||
|
|
||||||
RMFileStreamSlow &operator>>(RMFileStreamSlow &df, int16 &var) {
|
RMFileStreamSlow &operator>>(RMFileStreamSlow &df, int16 &var) {
|
||||||
uint16 v;
|
uint16 v;
|
||||||
df.Read(&v, 2);
|
df.read(&v, 2);
|
||||||
var = (int16)FROM_LE_16(v);
|
var = (int16)FROM_LE_16(v);
|
||||||
return df;
|
return df;
|
||||||
}
|
}
|
||||||
|
|
||||||
RMFileStreamSlow &operator>>(RMFileStreamSlow &df, int &var) {
|
RMFileStreamSlow &operator>>(RMFileStreamSlow &df, int &var) {
|
||||||
int v;
|
int v;
|
||||||
df.Read(&v, 4);
|
df.read(&v, 4);
|
||||||
var = FROM_LE_32(v);
|
var = FROM_LE_32(v);
|
||||||
return df;
|
return df;
|
||||||
}
|
}
|
||||||
|
|
||||||
RMFileStreamSlow &operator>>(RMFileStreamSlow &df, uint32 &var) {
|
RMFileStreamSlow &operator>>(RMFileStreamSlow &df, uint32 &var) {
|
||||||
uint32 v;
|
uint32 v;
|
||||||
df.Read(&v, 4);
|
df.read(&v, 4);
|
||||||
var = FROM_LE_32(v);
|
var = FROM_LE_32(v);
|
||||||
return df;
|
return df;
|
||||||
}
|
}
|
||||||
|
@ -508,24 +508,24 @@ RMFileStreamSlow &operator>>(RMFileStreamSlow &df, uint32 &var) {
|
||||||
* Constructor
|
* Constructor
|
||||||
*/
|
*/
|
||||||
RMDataStream::RMDataStream() {
|
RMDataStream::RMDataStream() {
|
||||||
m_length = 0;
|
_length = 0;
|
||||||
m_pos = 0;
|
_pos = 0;
|
||||||
m_bError = false;
|
_bError = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Destructor
|
* Destructor
|
||||||
*/
|
*/
|
||||||
RMDataStream::~RMDataStream() {
|
RMDataStream::~RMDataStream() {
|
||||||
Close();
|
close();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Close a stream
|
* Close a stream
|
||||||
*/
|
*/
|
||||||
void RMDataStream::Close(void) {
|
void RMDataStream::close(void) {
|
||||||
m_length = 0;
|
_length = 0;
|
||||||
m_pos = 0;
|
_pos = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -535,27 +535,27 @@ void RMDataStream::Close(void) {
|
||||||
* @remarks If the length of the buffer is not known, and cannot be
|
* @remarks If the length of the buffer is not known, and cannot be
|
||||||
* specified, then EOF() and Seek() to end won't work.
|
* specified, then EOF() and Seek() to end won't work.
|
||||||
*/
|
*/
|
||||||
void RMDataStream::OpenBuffer(const byte *lpBuf, int size) {
|
void RMDataStream::openBuffer(const byte *lpBuf, int size) {
|
||||||
m_length = size;
|
_length = size;
|
||||||
m_buf = lpBuf;
|
_buf = lpBuf;
|
||||||
m_bError = false;
|
_bError = false;
|
||||||
m_pos = 0;
|
_pos = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the length of the stream
|
* Returns the length of the stream
|
||||||
* @returns Stream length
|
* @returns Stream length
|
||||||
*/
|
*/
|
||||||
int RMDataStream::Length() {
|
int RMDataStream::length() {
|
||||||
return m_length;
|
return _length;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Determines if the end of the stream has been reached
|
* Determines if the end of the stream has been reached
|
||||||
* @returns true if end of stream reached, false if not
|
* @returns true if end of stream reached, false if not
|
||||||
*/
|
*/
|
||||||
bool RMDataStream::IsEOF() {
|
bool RMDataStream::isEOF() {
|
||||||
return (m_pos >= m_length);
|
return (_pos >= _length);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -565,7 +565,7 @@ bool RMDataStream::IsEOF() {
|
||||||
* @returns Value read from the stream
|
* @returns Value read from the stream
|
||||||
*/
|
*/
|
||||||
RMDataStream &operator>>(RMDataStream &df, char &var) {
|
RMDataStream &operator>>(RMDataStream &df, char &var) {
|
||||||
df.Read(&var, 1);
|
df.read(&var, 1);
|
||||||
return df;
|
return df;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -576,7 +576,7 @@ RMDataStream &operator>>(RMDataStream &df, char &var) {
|
||||||
* @returns Value read from the stream
|
* @returns Value read from the stream
|
||||||
*/
|
*/
|
||||||
RMDataStream &operator>>(RMDataStream &df, uint8 &var) {
|
RMDataStream &operator>>(RMDataStream &df, uint8 &var) {
|
||||||
df.Read(&var, 1);
|
df.read(&var, 1);
|
||||||
return df;
|
return df;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -588,7 +588,7 @@ RMDataStream &operator>>(RMDataStream &df, uint8 &var) {
|
||||||
*/
|
*/
|
||||||
RMDataStream &operator>>(RMDataStream &df, uint16 &var) {
|
RMDataStream &operator>>(RMDataStream &df, uint16 &var) {
|
||||||
uint16 v;
|
uint16 v;
|
||||||
df.Read(&v, 2);
|
df.read(&v, 2);
|
||||||
|
|
||||||
var = FROM_LE_16(v);
|
var = FROM_LE_16(v);
|
||||||
return df;
|
return df;
|
||||||
|
@ -602,7 +602,7 @@ RMDataStream &operator>>(RMDataStream &df, uint16 &var) {
|
||||||
*/
|
*/
|
||||||
RMDataStream &operator>>(RMDataStream &df, int16 &var) {
|
RMDataStream &operator>>(RMDataStream &df, int16 &var) {
|
||||||
uint16 v;
|
uint16 v;
|
||||||
df.Read(&v, 2);
|
df.read(&v, 2);
|
||||||
|
|
||||||
var = (int16)FROM_LE_16(v);
|
var = (int16)FROM_LE_16(v);
|
||||||
return df;
|
return df;
|
||||||
|
@ -616,7 +616,7 @@ RMDataStream &operator>>(RMDataStream &df, int16 &var) {
|
||||||
*/
|
*/
|
||||||
RMDataStream &operator>>(RMDataStream &df, int &var) {
|
RMDataStream &operator>>(RMDataStream &df, int &var) {
|
||||||
uint32 v;
|
uint32 v;
|
||||||
df.Read(&v, 4);
|
df.read(&v, 4);
|
||||||
|
|
||||||
var = (int)FROM_LE_32(v);
|
var = (int)FROM_LE_32(v);
|
||||||
return df;
|
return df;
|
||||||
|
@ -630,7 +630,7 @@ RMDataStream &operator>>(RMDataStream &df, int &var) {
|
||||||
*/
|
*/
|
||||||
RMDataStream &operator>>(RMDataStream &df, uint32 &var) {
|
RMDataStream &operator>>(RMDataStream &df, uint32 &var) {
|
||||||
uint32 v;
|
uint32 v;
|
||||||
df.Read(&v, 4);
|
df.read(&v, 4);
|
||||||
|
|
||||||
var = FROM_LE_32(v);
|
var = FROM_LE_32(v);
|
||||||
return df;
|
return df;
|
||||||
|
@ -642,17 +642,17 @@ RMDataStream &operator>>(RMDataStream &df, uint32 &var) {
|
||||||
* @param size Size of the buffer
|
* @param size Size of the buffer
|
||||||
* @returns true if we have reached the end, false if not
|
* @returns true if we have reached the end, false if not
|
||||||
*/
|
*/
|
||||||
bool RMDataStream::Read(void *lpBuf, int size) {
|
bool RMDataStream::read(void *lpBuf, int size) {
|
||||||
byte *dest = (byte *)lpBuf;
|
byte *dest = (byte *)lpBuf;
|
||||||
|
|
||||||
if ((m_pos + size) > m_length) {
|
if ((_pos + size) > _length) {
|
||||||
Common::copy(m_buf + m_pos, m_buf + m_pos + (m_length - m_pos), dest);
|
Common::copy(_buf + _pos, _buf + _pos + (_length - _pos), dest);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
Common::copy(m_buf + m_pos, m_buf + m_pos + size, dest);
|
Common::copy(_buf + _pos, _buf + _pos + size, dest);
|
||||||
|
|
||||||
m_pos += size;
|
_pos += size;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -663,7 +663,7 @@ bool RMDataStream::Read(void *lpBuf, int size) {
|
||||||
* @returns The stream
|
* @returns The stream
|
||||||
*/
|
*/
|
||||||
RMDataStream &RMDataStream::operator+=(int nBytes) {
|
RMDataStream &RMDataStream::operator+=(int nBytes) {
|
||||||
m_pos += nBytes;
|
_pos += nBytes;
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -673,57 +673,57 @@ RMDataStream &RMDataStream::operator+=(int nBytes) {
|
||||||
* @param origin Origin to do offset from
|
* @param origin Origin to do offset from
|
||||||
* @returns The absolute current position in bytes
|
* @returns The absolute current position in bytes
|
||||||
*/
|
*/
|
||||||
int RMDataStream::Seek(int nBytes, RMDSPos origin) {
|
int RMDataStream::seek(int nBytes, RMDSPos origin) {
|
||||||
switch (origin) {
|
switch (origin) {
|
||||||
case CUR:
|
case CUR:
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case START:
|
case START:
|
||||||
m_pos = 0;
|
_pos = 0;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case END:
|
case END:
|
||||||
if (m_length == SIZENOTKNOWN)
|
if (_length == SIZENOTKNOWN)
|
||||||
return m_pos;
|
return _pos;
|
||||||
m_pos = m_length;
|
_pos = _length;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
m_pos += nBytes;
|
_pos += nBytes;
|
||||||
return m_pos;
|
return _pos;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the current position of the stream
|
* Returns the current position of the stream
|
||||||
* @returns The current position
|
* @returns The current position
|
||||||
*/
|
*/
|
||||||
int RMDataStream::Pos() {
|
int RMDataStream::pos() {
|
||||||
return m_pos;
|
return _pos;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check if an error occurred during reading the stream
|
* Check if an error occurred during reading the stream
|
||||||
* @returns true if there was an error, false otherwise
|
* @returns true if there was an error, false otherwise
|
||||||
*/
|
*/
|
||||||
bool RMDataStream::IsError() {
|
bool RMDataStream::isError() {
|
||||||
return m_bError;
|
return _bError;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets an error code for the stream
|
* Sets an error code for the stream
|
||||||
* @param code Error code
|
* @param code Error code
|
||||||
*/
|
*/
|
||||||
void RMDataStream::SetError(int code) {
|
void RMDataStream::setError(int code) {
|
||||||
m_bError = true;
|
_bError = true;
|
||||||
m_ecode = code;
|
_ecode = code;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the error code for the stream
|
* Returns the error code for the stream
|
||||||
* @returns Error code
|
* @returns Error code
|
||||||
*/
|
*/
|
||||||
int RMDataStream::GetError() {
|
int RMDataStream::getError() {
|
||||||
return m_ecode;
|
return _ecode;
|
||||||
}
|
}
|
||||||
|
|
||||||
/****************************************************************************\
|
/****************************************************************************\
|
||||||
|
@ -766,7 +766,7 @@ RMPoint &RMPoint::operator=(RMPoint p) {
|
||||||
/**
|
/**
|
||||||
* Offsets the point by another point
|
* Offsets the point by another point
|
||||||
*/
|
*/
|
||||||
void RMPoint::Offset(const RMPoint &p) {
|
void RMPoint::offset(const RMPoint &p) {
|
||||||
x += p.x;
|
x += p.x;
|
||||||
y += p.y;
|
y += p.y;
|
||||||
}
|
}
|
||||||
|
@ -774,7 +774,7 @@ void RMPoint::Offset(const RMPoint &p) {
|
||||||
/**
|
/**
|
||||||
* Offsets the point by a specified offset
|
* Offsets the point by a specified offset
|
||||||
*/
|
*/
|
||||||
void RMPoint::Offset(int xOff, int yOff) {
|
void RMPoint::offset(int xOff, int yOff) {
|
||||||
x += xOff;
|
x += xOff;
|
||||||
y += yOff;
|
y += yOff;
|
||||||
}
|
}
|
||||||
|
@ -801,7 +801,7 @@ RMPoint operator-(RMPoint p1, RMPoint p2) {
|
||||||
* Sum (offset) of a point
|
* Sum (offset) of a point
|
||||||
*/
|
*/
|
||||||
RMPoint &RMPoint::operator+=(RMPoint p) {
|
RMPoint &RMPoint::operator+=(RMPoint p) {
|
||||||
Offset(p);
|
offset(p);
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -809,7 +809,7 @@ RMPoint &RMPoint::operator+=(RMPoint p) {
|
||||||
* Subtract (offset) of a point
|
* Subtract (offset) of a point
|
||||||
*/
|
*/
|
||||||
RMPoint &RMPoint::operator-=(RMPoint p) {
|
RMPoint &RMPoint::operator-=(RMPoint p) {
|
||||||
Offset(-p);
|
offset(-p);
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -852,93 +852,93 @@ RMDataStream &operator>>(RMDataStream &ds, RMPoint &p) {
|
||||||
\****************************************************************************/
|
\****************************************************************************/
|
||||||
|
|
||||||
RMRect::RMRect() {
|
RMRect::RMRect() {
|
||||||
SetEmpty();
|
setEmpty();
|
||||||
}
|
}
|
||||||
|
|
||||||
void RMRect::SetEmpty(void) {
|
void RMRect::setEmpty(void) {
|
||||||
x1 = y1 = x2 = y2 = 0;
|
x1 = y1 = x2 = y2 = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
RMRect::RMRect(const RMPoint &p1, const RMPoint &p2) {
|
RMRect::RMRect(const RMPoint &p1, const RMPoint &p2) {
|
||||||
SetRect(p1, p2);
|
setRect(p1, p2);
|
||||||
}
|
}
|
||||||
|
|
||||||
RMRect::RMRect(int X1, int Y1, int X2, int Y2) {
|
RMRect::RMRect(int X1, int Y1, int X2, int Y2) {
|
||||||
SetRect(X1, Y1, X2, Y2);
|
setRect(X1, Y1, X2, Y2);
|
||||||
}
|
}
|
||||||
|
|
||||||
RMRect::RMRect(const RMRect &rc) {
|
RMRect::RMRect(const RMRect &rc) {
|
||||||
CopyRect(rc);
|
copyRect(rc);
|
||||||
}
|
}
|
||||||
|
|
||||||
void RMRect::SetRect(const RMPoint &p1, const RMPoint &p2) {
|
void RMRect::setRect(const RMPoint &p1, const RMPoint &p2) {
|
||||||
x1 = p1.x;
|
x1 = p1.x;
|
||||||
y1 = p1.y;
|
y1 = p1.y;
|
||||||
x2 = p2.x;
|
x2 = p2.x;
|
||||||
y2 = p2.y;
|
y2 = p2.y;
|
||||||
}
|
}
|
||||||
|
|
||||||
void RMRect::SetRect(int X1, int Y1, int X2, int Y2) {
|
void RMRect::setRect(int X1, int Y1, int X2, int Y2) {
|
||||||
x1 = X1;
|
x1 = X1;
|
||||||
y1 = Y1;
|
y1 = Y1;
|
||||||
x2 = X2;
|
x2 = X2;
|
||||||
y2 = Y2;
|
y2 = Y2;
|
||||||
}
|
}
|
||||||
|
|
||||||
void RMRect::SetRect(const RMRect &rc) {
|
void RMRect::setRect(const RMRect &rc) {
|
||||||
CopyRect(rc);
|
copyRect(rc);
|
||||||
}
|
}
|
||||||
|
|
||||||
void RMRect::CopyRect(const RMRect &rc) {
|
void RMRect::copyRect(const RMRect &rc) {
|
||||||
x1 = rc.x1;
|
x1 = rc.x1;
|
||||||
y1 = rc.y1;
|
y1 = rc.y1;
|
||||||
x2 = rc.x2;
|
x2 = rc.x2;
|
||||||
y2 = rc.y2;
|
y2 = rc.y2;
|
||||||
}
|
}
|
||||||
|
|
||||||
RMPoint &RMRect::TopLeft() {
|
RMPoint &RMRect::topLeft() {
|
||||||
// FIXME: This seems very bad
|
// FIXME: This seems very bad
|
||||||
return *((RMPoint *)this);
|
return *((RMPoint *)this);
|
||||||
}
|
}
|
||||||
|
|
||||||
RMPoint &RMRect::BottomRight() {
|
RMPoint &RMRect::bottomRight() {
|
||||||
// FIXME: This seems very bad
|
// FIXME: This seems very bad
|
||||||
return *((RMPoint *)this + 1);
|
return *((RMPoint *)this + 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
RMPoint RMRect::Center() {
|
RMPoint RMRect::center() {
|
||||||
return RMPoint((x2 - x1) / 2, (y2 - y1) / 2);
|
return RMPoint((x2 - x1) / 2, (y2 - y1) / 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
int RMRect::Width() const {
|
int RMRect::width() const {
|
||||||
return x2 - x1;
|
return x2 - x1;
|
||||||
}
|
}
|
||||||
|
|
||||||
int RMRect::Height() const {
|
int RMRect::height() const {
|
||||||
return y2 - y1;
|
return y2 - y1;
|
||||||
}
|
}
|
||||||
|
|
||||||
int RMRect::Size() const {
|
int RMRect::size() const {
|
||||||
return Width() * Height();
|
return width() * height();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool RMRect::IsEmpty() const {
|
bool RMRect::isEmpty() const {
|
||||||
return (x1 == 0 && y1 == 0 && x2 == 0 && y2 == 0);
|
return (x1 == 0 && y1 == 0 && x2 == 0 && y2 == 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
const RMRect &RMRect::operator=(const RMRect &rc) {
|
const RMRect &RMRect::operator=(const RMRect &rc) {
|
||||||
CopyRect(rc);
|
copyRect(rc);
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
void RMRect::Offset(int xOff, int yOff) {
|
void RMRect::offset(int xOff, int yOff) {
|
||||||
x1 += xOff;
|
x1 += xOff;
|
||||||
y1 += yOff;
|
y1 += yOff;
|
||||||
x2 += xOff;
|
x2 += xOff;
|
||||||
y2 += yOff;
|
y2 += yOff;
|
||||||
}
|
}
|
||||||
|
|
||||||
void RMRect::Offset(const RMPoint &p) {
|
void RMRect::offset(const RMPoint &p) {
|
||||||
x1 += p.x;
|
x1 += p.x;
|
||||||
y1 += p.y;
|
y1 += p.y;
|
||||||
x2 += p.x;
|
x2 += p.x;
|
||||||
|
@ -946,12 +946,12 @@ void RMRect::Offset(const RMPoint &p) {
|
||||||
}
|
}
|
||||||
|
|
||||||
const RMRect &RMRect::operator+=(RMPoint p) {
|
const RMRect &RMRect::operator+=(RMPoint p) {
|
||||||
Offset(p);
|
offset(p);
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
const RMRect &RMRect::operator-=(RMPoint p) {
|
const RMRect &RMRect::operator-=(RMPoint p) {
|
||||||
Offset(-p);
|
offset(-p);
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -986,8 +986,8 @@ bool RMRect::operator!=(const RMRect &rc) {
|
||||||
return ((x1 != rc.x1) || (y1 != rc.y1) || (x2 != rc.x2) || (y2 != rc.y2));
|
return ((x1 != rc.x1) || (y1 != rc.y1) || (x2 != rc.x2) || (y2 != rc.y2));
|
||||||
}
|
}
|
||||||
|
|
||||||
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) {
|
||||||
|
@ -1014,7 +1014,7 @@ RMResUpdate::~RMResUpdate() {
|
||||||
_hFile.close();
|
_hFile.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
void RMResUpdate::Init(const Common::String &fileName) {
|
void RMResUpdate::init(const Common::String &fileName) {
|
||||||
// Open the resource update file
|
// Open the resource update file
|
||||||
if (!_hFile.open(fileName))
|
if (!_hFile.open(fileName))
|
||||||
// It doesn't exist, so exit immediately
|
// It doesn't exist, so exit immediately
|
||||||
|
@ -1039,7 +1039,7 @@ void RMResUpdate::Init(const Common::String &fileName) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
HGLOBAL RMResUpdate::QueryResource(uint32 dwRes) {
|
HGLOBAL RMResUpdate::queryResource(uint32 dwRes) {
|
||||||
// If there isn't an update file, return NULL
|
// If there isn't an update file, return NULL
|
||||||
if (!_hFile.isOpen())
|
if (!_hFile.isOpen())
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
|
@ -44,11 +44,11 @@ using namespace ::Tony::MPAL;
|
||||||
*/
|
*/
|
||||||
class RMDataStream {
|
class RMDataStream {
|
||||||
protected:
|
protected:
|
||||||
const byte *m_buf;
|
const byte *_buf;
|
||||||
int m_length;
|
int _length;
|
||||||
int m_pos;
|
int _pos;
|
||||||
bool m_bError;
|
bool _bError;
|
||||||
int m_ecode;
|
int _ecode;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
enum RMDSPos {
|
enum RMDSPos {
|
||||||
|
@ -68,15 +68,15 @@ public:
|
||||||
virtual ~RMDataStream();
|
virtual ~RMDataStream();
|
||||||
|
|
||||||
// Loading buffer
|
// Loading buffer
|
||||||
void OpenBuffer(const byte *buf, int size = SIZENOTKNOWN);
|
void openBuffer(const byte *buf, int size = SIZENOTKNOWN);
|
||||||
void Close(void);
|
void close(void);
|
||||||
|
|
||||||
// Attributei
|
// Attributei
|
||||||
int Length();
|
int length();
|
||||||
virtual int Pos();
|
virtual int pos();
|
||||||
|
|
||||||
// EOF
|
// EOF
|
||||||
virtual bool IsEOF();
|
virtual bool isEOF();
|
||||||
|
|
||||||
// Read methods
|
// Read methods
|
||||||
friend RMDataStream &operator>>(RMDataStream &df, char &var);
|
friend RMDataStream &operator>>(RMDataStream &df, char &var);
|
||||||
|
@ -87,16 +87,16 @@ public:
|
||||||
friend RMDataStream &operator>>(RMDataStream &df, uint32 &var);
|
friend RMDataStream &operator>>(RMDataStream &df, uint32 &var);
|
||||||
|
|
||||||
// General read
|
// 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);
|
||||||
|
|
||||||
// Error handling
|
// Error handling
|
||||||
void SetError(int ecode);
|
void setError(int ecode);
|
||||||
int GetError();
|
int getError();
|
||||||
bool IsError();
|
bool isError();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -105,17 +105,17 @@ public:
|
||||||
*/
|
*/
|
||||||
class RMFileStream : public RMDataStream {
|
class RMFileStream : public RMDataStream {
|
||||||
private:
|
private:
|
||||||
byte *m_buf;
|
byte *_buf;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
RMFileStream();
|
RMFileStream();
|
||||||
virtual ~RMFileStream();
|
virtual ~RMFileStream();
|
||||||
|
|
||||||
// Methods for opening 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);
|
||||||
|
|
||||||
void Close(void);
|
void close(void);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -126,18 +126,18 @@ public:
|
||||||
RMFileStreamSlow();
|
RMFileStreamSlow();
|
||||||
virtual ~RMFileStreamSlow();
|
virtual ~RMFileStreamSlow();
|
||||||
|
|
||||||
bool OpenFile(const char *lpFN);
|
bool openFile(const char *lpFN);
|
||||||
bool OpenFile(Common::File &file);
|
bool openFile(Common::File &file);
|
||||||
|
|
||||||
void Close(void);
|
void close(void);
|
||||||
|
|
||||||
RMDataStream &operator+=(int nBytes);
|
RMDataStream &operator+=(int nBytes);
|
||||||
int Seek(int nBytes, RMDSPos where = CUR);
|
int seek(int nBytes, RMDSPos where = CUR);
|
||||||
|
|
||||||
int Pos();
|
int pos();
|
||||||
virtual bool IsEOF();
|
virtual bool isEOF();
|
||||||
|
|
||||||
bool Read(void *buf, int size);
|
bool read(void *buf, int size);
|
||||||
|
|
||||||
friend RMFileStreamSlow &operator>>(RMFileStreamSlow &df, char &var);
|
friend RMFileStreamSlow &operator>>(RMFileStreamSlow &df, char &var);
|
||||||
friend RMFileStreamSlow &operator>>(RMFileStreamSlow &df, byte &var);
|
friend RMFileStreamSlow &operator>>(RMFileStreamSlow &df, byte &var);
|
||||||
|
@ -152,9 +152,9 @@ public:
|
||||||
*/
|
*/
|
||||||
class RMString {
|
class RMString {
|
||||||
private:
|
private:
|
||||||
char *m_string;
|
char *_string;
|
||||||
int m_length;
|
int _length;
|
||||||
int m_realLength;
|
int _realLength;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
RMString();
|
RMString();
|
||||||
|
@ -166,12 +166,12 @@ public:
|
||||||
RMString(const int ch);
|
RMString(const int ch);
|
||||||
|
|
||||||
// General methods
|
// General methods
|
||||||
int Length() const;
|
int length() const;
|
||||||
void Compact();
|
void compact();
|
||||||
|
|
||||||
// Access characters within string
|
// Access characters within string
|
||||||
char GetAt(int nIndex);
|
char getAt(int nIndex);
|
||||||
void SetAt(int nIndex, char c);
|
void setAt(int nIndex, char c);
|
||||||
char &operator[](int nIndex);
|
char &operator[](int nIndex);
|
||||||
|
|
||||||
// String cast
|
// String cast
|
||||||
|
@ -200,11 +200,11 @@ public:
|
||||||
friend RMDataStream &operator>>(RMDataStream &df, RMString &var);
|
friend RMDataStream &operator>>(RMDataStream &df, RMString &var);
|
||||||
|
|
||||||
// String formatting
|
// String formatting
|
||||||
void Format(const char *str, ...);
|
void format(const char *str, ...);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void Resize(int size, bool bMantain = false);
|
void resize(int size, bool bMantain = false);
|
||||||
void Connect(const char *str, int size);
|
void connect(const char *str, int size);
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -224,14 +224,14 @@ public:
|
||||||
RMPoint &operator=(RMPoint p);
|
RMPoint &operator=(RMPoint p);
|
||||||
|
|
||||||
// Set
|
// Set
|
||||||
void Set(int x1, int y1) {
|
void set(int x1, int y1) {
|
||||||
x = x1;
|
x = x1;
|
||||||
y = y1;
|
y = y1;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Offset
|
// Offset
|
||||||
void Offset(int xOff, int yOff);
|
void offset(int xOff, int yOff);
|
||||||
void Offset(const RMPoint &p);
|
void offset(const RMPoint &p);
|
||||||
friend RMPoint operator+(RMPoint p1, RMPoint p2);
|
friend RMPoint operator+(RMPoint p1, RMPoint p2);
|
||||||
friend RMPoint operator-(RMPoint p1, RMPoint p2);
|
friend RMPoint operator-(RMPoint p1, RMPoint p2);
|
||||||
RMPoint &operator+=(RMPoint p);
|
RMPoint &operator+=(RMPoint p);
|
||||||
|
@ -261,27 +261,27 @@ public:
|
||||||
RMRect(const RMRect &rc);
|
RMRect(const RMRect &rc);
|
||||||
|
|
||||||
// Attributes
|
// Attributes
|
||||||
RMPoint &TopLeft();
|
RMPoint &topLeft();
|
||||||
RMPoint &BottomRight();
|
RMPoint &bottomRight();
|
||||||
RMPoint Center();
|
RMPoint center();
|
||||||
int Width() const;
|
int width() const;
|
||||||
int Height() const;
|
int height() const;
|
||||||
bool IsEmpty() const;
|
bool isEmpty() const;
|
||||||
int Size() const;
|
int size() const;
|
||||||
|
|
||||||
// Set
|
// Set
|
||||||
void SetRect(int x1, int y1, int x2, int y2);
|
void setRect(int x1, int y1, int x2, int y2);
|
||||||
void SetRect(const RMPoint &p1, const RMPoint &p2);
|
void setRect(const RMPoint &p1, const RMPoint &p2);
|
||||||
void SetEmpty(void);
|
void setEmpty(void);
|
||||||
|
|
||||||
// Copiers
|
// Copiers
|
||||||
void SetRect(const RMRect &rc);
|
void setRect(const RMRect &rc);
|
||||||
void CopyRect(const RMRect &rc);
|
void copyRect(const RMRect &rc);
|
||||||
const RMRect &operator=(const RMRect &rc);
|
const RMRect &operator=(const RMRect &rc);
|
||||||
|
|
||||||
// Offset
|
// Offset
|
||||||
void Offset(int xOff, int yOff);
|
void offset(int xOff, int yOff);
|
||||||
void Offset(const RMPoint &p);
|
void offset(const RMPoint &p);
|
||||||
friend RMRect operator+(const RMRect &rc, RMPoint p);
|
friend RMRect operator+(const RMRect &rc, RMPoint p);
|
||||||
friend RMRect operator-(const RMRect &rc, RMPoint p);
|
friend RMRect operator-(const RMRect &rc, RMPoint p);
|
||||||
friend RMRect operator+(RMPoint p, const RMRect &rc);
|
friend RMRect operator+(RMPoint p, const RMRect &rc);
|
||||||
|
@ -294,10 +294,10 @@ public:
|
||||||
bool operator!=(const RMRect &rc);
|
bool operator!=(const RMRect &rc);
|
||||||
|
|
||||||
// Normalise
|
// Normalise
|
||||||
void NormalizeRect();
|
void normalizeRect();
|
||||||
|
|
||||||
// Point in rect
|
// Point in rect
|
||||||
bool PtInRect(const RMPoint &pt) {
|
bool ptInRect(const RMPoint &pt) {
|
||||||
return (pt.x >= x1 && pt.x <= x2 && pt.y >= y1 && pt.y <= y2);
|
return (pt.x >= x1 && pt.x <= x2 && pt.y >= y1 && pt.y <= y2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -324,8 +324,8 @@ public:
|
||||||
RMResUpdate();
|
RMResUpdate();
|
||||||
~RMResUpdate();
|
~RMResUpdate();
|
||||||
|
|
||||||
void Init(const Common::String &fileName);
|
void init(const Common::String &fileName);
|
||||||
HGLOBAL QueryResource(uint32 dwRes);
|
HGLOBAL queryResource(uint32 dwRes);
|
||||||
};
|
};
|
||||||
|
|
||||||
} // End of namespace Tony
|
} // End of namespace Tony
|
||||||
|
|
|
@ -57,8 +57,8 @@ private:
|
||||||
void plotLines(const byte *lpBuf, const Common::Point ¢er, int x, int y);
|
void plotLines(const byte *lpBuf, const Common::Point ¢er, int x, int y);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void * /*LPDIRECTDRAWCLIPPER*/ m_MainClipper;
|
// void * /*LPDIRECTDRAWCLIPPER*/ _MainClipper;
|
||||||
void * /*LPDIRECTDRAWCLIPPER*/ m_BackClipper;
|
// void * /*LPDIRECTDRAWCLIPPER*/ _BackClipper;
|
||||||
|
|
||||||
int fps, fcount;
|
int fps, fcount;
|
||||||
int lastsecond, lastfcount;
|
int lastsecond, lastfcount;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue