More v7 implementation
svn-id: r3656
This commit is contained in:
parent
720c41a25f
commit
6600b48be9
5 changed files with 380 additions and 396 deletions
24
actor.cpp
24
actor.cpp
|
@ -815,8 +815,8 @@ void Scumm::processActors() {
|
|||
} while (ac++,--cnt);
|
||||
}
|
||||
|
||||
#if !defined(FULL_THROTTLE)
|
||||
void Scumm::drawActorCostume(Actor *a) {
|
||||
if(!(_features & GF_AFTER_V7)) {
|
||||
CostumeRenderer cr;
|
||||
|
||||
if (a==NULL || !a->needRedraw)
|
||||
|
@ -855,9 +855,7 @@ void Scumm::drawActorCostume(Actor *a) {
|
|||
a->needBgReset = true;
|
||||
a->needRedraw = true;
|
||||
}
|
||||
}
|
||||
#else
|
||||
void Scumm::drawActorCostume(Actor *a) {
|
||||
} else {
|
||||
AkosRenderer ar;
|
||||
|
||||
if (a==NULL || !a->needRedraw)
|
||||
|
@ -899,15 +897,12 @@ void Scumm::drawActorCostume(Actor *a) {
|
|||
akos_drawCostume(&ar);
|
||||
a->top = ar.draw_top;
|
||||
a->bottom = ar.draw_bottom;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
void Scumm::actorAnimate(Actor *a) {
|
||||
#if defined(FULL_THROTTLE)
|
||||
byte *akos;
|
||||
#else
|
||||
LoadedCostume lc;
|
||||
#endif
|
||||
|
||||
if (a==NULL || a->costume == 0)
|
||||
return;
|
||||
|
@ -916,17 +911,20 @@ void Scumm::actorAnimate(Actor *a) {
|
|||
if (a->animProgress >= a->animSpeed) {
|
||||
a->animProgress = 0;
|
||||
|
||||
#if defined(FULL_THROTTLE)
|
||||
if (_features & GF_AFTER_V7) {
|
||||
akos = getResourceAddress(rtCostume, a->costume);
|
||||
assert(akos);
|
||||
if (akos_increaseAnims(akos, a)) {
|
||||
#else
|
||||
loadCostume(&lc, a->costume);
|
||||
if (cost_increaseAnims(&lc, a)) {
|
||||
#endif
|
||||
a->needRedraw = true;
|
||||
a->needBgReset = true;
|
||||
}
|
||||
} else {
|
||||
loadCostume(&lc, a->costume);
|
||||
if (cost_increaseAnims(&lc, a)) {
|
||||
a->needRedraw = true;
|
||||
a->needBgReset = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -674,7 +674,7 @@ void CostumeRenderer::loadCostume(int id) {
|
|||
|
||||
if (_vm->_features&GF_AFTER_V6) {
|
||||
_ptr += 8;
|
||||
} else if(!(_features&GF_SMALL_HEADER)) {
|
||||
} else if(!(_vm->_features&GF_SMALL_HEADER)) {
|
||||
_ptr += 2;
|
||||
}
|
||||
|
||||
|
@ -711,7 +711,8 @@ void Scumm::initActorCostumeData(Actor *a) {
|
|||
}
|
||||
|
||||
byte CostumeRenderer::drawOneSlot(Actor *a, int slot) {
|
||||
#if !defined(FULL_THROTTLE)
|
||||
|
||||
if(!(_vm->_features & GF_AFTER_V7)) {
|
||||
int i;
|
||||
int code;
|
||||
CostumeData *cd = &a->cost;
|
||||
|
@ -729,7 +730,7 @@ byte CostumeRenderer::drawOneSlot(Actor *a, int slot) {
|
|||
if ( !(_vm->_features & GF_OLD256) || code <0x79)
|
||||
return mainRoutine(a, slot, code);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
|
|
40
gfx.cpp
40
gfx.cpp
|
@ -116,12 +116,8 @@ void Scumm::drawDirtyScreenParts() {
|
|||
if (_features & GF_OLD256)
|
||||
updateDirtyScreen(1);
|
||||
|
||||
#if defined(FULL_THROTTLE)
|
||||
if (camera._last.x==camera._cur.x &&
|
||||
camera._last.y==camera._cur.y) {
|
||||
#else
|
||||
if (camera._last.x == camera._cur.x) {
|
||||
#endif
|
||||
if ((camera._last.x==camera._cur.x &&
|
||||
camera._last.y==camera._cur.y && (_features & GF_AFTER_V7)) || (camera._last.x == camera._cur.x)) {
|
||||
updateDirtyScreen(0);
|
||||
} else {
|
||||
vs = &virtscr[0];
|
||||
|
@ -228,9 +224,9 @@ void Scumm::setCursor(int cursor) {
|
|||
warning("setCursor(%d)", cursor);
|
||||
}
|
||||
|
||||
#if defined(FULL_THROTTLE)
|
||||
|
||||
void Scumm::setCameraAt(int pos_x, int pos_y) {
|
||||
|
||||
if(_features & GF_AFTER_V7) {
|
||||
CameraData *cd = &camera;
|
||||
Point old;
|
||||
|
||||
|
@ -250,9 +246,7 @@ void Scumm::setCameraAt(int pos_x, int pos_y) {
|
|||
_vars[VAR_CAMERA_POS_Y] = cd->_cur.y;
|
||||
runScript(_vars[VAR_SCROLL_SCRIPT], 0, 0, 0);
|
||||
}
|
||||
}
|
||||
#else
|
||||
void Scumm::setCameraAt(int pos_x, int pos_y) {
|
||||
} else {
|
||||
int t;
|
||||
CameraData *cd = &camera;
|
||||
|
||||
|
@ -274,11 +268,11 @@ void Scumm::setCameraAt(int pos_x, int pos_y) {
|
|||
|
||||
if (cd->_cur.x != cd->_last.x && charset._hasMask)
|
||||
stopTalk();
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(FULL_THROTTLE)
|
||||
void Scumm::setCameraFollows(Actor *a) {
|
||||
if(_features & GF_AFTER_V7) {
|
||||
CameraData *cd = &camera;
|
||||
byte oldfollow = cd->_follows;
|
||||
int ax,ay;
|
||||
|
@ -301,10 +295,7 @@ void Scumm::setCameraFollows(Actor *a) {
|
|||
|
||||
if (a->number != oldfollow)
|
||||
runHook(0);
|
||||
}
|
||||
|
||||
#else
|
||||
void Scumm::setCameraFollows(Actor *a) {
|
||||
} else {
|
||||
int t,i;
|
||||
CameraData *cd = &camera;
|
||||
|
||||
|
@ -329,8 +320,8 @@ void Scumm::setCameraFollows(Actor *a) {
|
|||
a->needRedraw = true;
|
||||
}
|
||||
runHook(0);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
void Scumm::initBGBuffers() {
|
||||
byte *ptr;
|
||||
|
@ -518,9 +509,8 @@ void Scumm::unkVirtScreen4(int a) {
|
|||
VirtScreen *vs;
|
||||
|
||||
setDirtyRange(0, 0, 0);
|
||||
#if !defined(FULL_THROTTLE)
|
||||
if(!(_features & GF_AFTER_V7))
|
||||
camera._last.x = camera._cur.x;
|
||||
#endif
|
||||
if (!_screenEffectFlag)
|
||||
return;
|
||||
_screenEffectFlag = false;
|
||||
|
@ -1650,8 +1640,6 @@ void Gdi::clearUpperMask() {
|
|||
);
|
||||
}
|
||||
|
||||
#if defined(FULL_THROTTLE)
|
||||
|
||||
void Scumm::clampCameraPos(Point *pt) {
|
||||
if (pt->x < _vars[VAR_CAMERA_MIN_X])
|
||||
pt->x = _vars[VAR_CAMERA_MIN_X];
|
||||
|
@ -1668,6 +1656,7 @@ void Scumm::clampCameraPos(Point *pt) {
|
|||
|
||||
|
||||
void Scumm::moveCamera() {
|
||||
if(_features & GF_AFTER_V7) {
|
||||
CameraData *cd = &camera;
|
||||
Point old = cd->_cur;
|
||||
Actor *a;
|
||||
|
@ -1749,10 +1738,7 @@ void Scumm::moveCamera() {
|
|||
_vars[VAR_CAMERA_POS_Y] = cd->_cur.y;
|
||||
runScript(_vars[VAR_SCROLL_SCRIPT], 0, 0, 0);
|
||||
}
|
||||
}
|
||||
|
||||
#else
|
||||
void Scumm::moveCamera() {
|
||||
} else {
|
||||
CameraData *cd = &camera;
|
||||
int pos = cd->_cur.x;
|
||||
int actorx, t;
|
||||
|
@ -1826,8 +1812,8 @@ void Scumm::moveCamera() {
|
|||
_vars[VAR_CAMERA_POS_X] = cd->_cur.x;
|
||||
runScript(_vars[VAR_SCROLL_SCRIPT], 0, 0, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(FULL_THROTTLE)
|
||||
void Scumm::cameraMoved() {
|
||||
|
|
24
object.cpp
24
object.cpp
|
@ -532,7 +532,7 @@ void Scumm::setupRoomObject(ObjectData *od, byte *room) {
|
|||
else
|
||||
od->obj_nr = READ_LE_UINT16(&(cdhd->v5.obj_id));
|
||||
|
||||
#if !defined(FULL_THROTTLE)
|
||||
if(!(_features & GF_AFTER_V7)) {
|
||||
if (_features & GF_AFTER_V6) {
|
||||
od->width = READ_LE_UINT16(&cdhd->v6.w);
|
||||
od->height = READ_LE_UINT16(&cdhd->v6.h);
|
||||
|
@ -560,18 +560,18 @@ void Scumm::setupRoomObject(ObjectData *od, byte *room) {
|
|||
od->walk_y = READ_LE_UINT16(&cdhd->v5.walk_y);
|
||||
od->actordir = cdhd->v5.actordir;
|
||||
}
|
||||
#else
|
||||
od->parent = cdhd->parent;
|
||||
od->parentstate = cdhd->parentstate;
|
||||
} else {
|
||||
od->parent = cdhd->v7.parent;
|
||||
od->parentstate = cdhd->v7.parentstate;
|
||||
|
||||
imhd = (ImageHeader*)findResourceData(MKID('IMHD'), room + od->offs_obim_to_room);
|
||||
od->x_pos = imhd->x_pos;
|
||||
od->y_pos = imhd->y_pos;
|
||||
od->width = imhd->width;
|
||||
od->height = imhd->height;
|
||||
od->actordir = imhd->actordir;
|
||||
od->x_pos = imhd->v7.x_pos;
|
||||
od->y_pos = imhd->v7.y_pos;
|
||||
od->width = imhd->v7.width;
|
||||
od->height = imhd->v7.height;
|
||||
od->actordir = imhd->v7.actordir;
|
||||
|
||||
#endif
|
||||
}
|
||||
od->fl_object_index = 0;
|
||||
}
|
||||
|
||||
|
@ -1049,8 +1049,8 @@ void Scumm::setCursorImg(uint img, uint room, uint imgindex) {
|
|||
w = READ_LE_UINT16(&foir.cdhd->v6.w)>>3;
|
||||
h = READ_LE_UINT16(&foir.cdhd->v6.h)>>3;
|
||||
#else
|
||||
w = READ_LE_UINT16(&foir.imhd->width)>>3;
|
||||
h = READ_LE_UINT16(&foir.imhd->height)>>3;
|
||||
w = READ_LE_UINT16(&foir.imhd->v7.width)>>3;
|
||||
h = READ_LE_UINT16(&foir.imhd->v7.height)>>3;
|
||||
#endif
|
||||
|
||||
dataptr = findResource(IMxx_tags[imgindex],foir.obim);
|
||||
|
|
|
@ -564,10 +564,9 @@ void Scumm::ensureResourceLoaded(int type, int i) {
|
|||
|
||||
loadResource(type, i);
|
||||
|
||||
#if !defined(FULL_THROTTLE)
|
||||
if(!(_features & GF_AFTER_V7))
|
||||
if (type==rtRoom && i==_roomResource)
|
||||
_vars[VAR_ROOM_FLAG] = 1;
|
||||
#endif
|
||||
}
|
||||
|
||||
int Scumm::loadResource(int type, int index) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue