Fix Indy4/MI2 crash due to VirtScroll code.
Cleanup \N's - For gods sake fix your CVS client :) svn-id: r4067
This commit is contained in:
parent
20e9ad5e23
commit
280136f13a
11 changed files with 98 additions and 113 deletions
|
@ -495,10 +495,8 @@ int Scumm::getActorXYPos(Actor * a)
|
|||
return 0;
|
||||
}
|
||||
|
||||
AdjustBoxResult Scumm::adjustXYToBeInBox(Actor * a, int x, int y,
|
||||
int pathfrom)
|
||||
AdjustBoxResult Scumm::adjustXYToBeInBox(Actor * a, int x, int y, int pathfrom)
|
||||
{
|
||||
// Yazoo: need to recheck with Loom for the class data flags (0x400000)
|
||||
AdjustBoxResult abr, tmp;
|
||||
uint threshold;
|
||||
uint best;
|
||||
|
@ -753,7 +751,6 @@ void Scumm::startWalkAnim(Actor * a, int cmd, int angle)
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
void Scumm::walkActor(Actor * a)
|
||||
{
|
||||
int j;
|
||||
|
@ -919,9 +916,13 @@ void Scumm::drawActorCostume(Actor * a)
|
|||
else if (g_scumm->getClass(a->number, 21))
|
||||
a->forceClip = 1;
|
||||
|
||||
|
||||
|
||||
if (_gameId==GID_SAMNMAX && getState(995)) // FIXME: ugly fix for samnmax inventory
|
||||
|
||||
return;
|
||||
|
||||
|
||||
a->needRedraw = false;
|
||||
|
||||
setupActorScale(a);
|
||||
|
|
37
akos.cpp
37
akos.cpp
|
@ -53,7 +53,6 @@ int Scumm::akos_findManyDirection(int16 ManyDirection, uint16 facing)
|
|||
|
||||
--temp;
|
||||
--direction;
|
||||
|
||||
} while (temp);
|
||||
|
||||
return (temp);
|
||||
|
@ -221,9 +220,7 @@ bool Scumm::akos_drawCostumeChannel(AkosRenderer * ar, int chan)
|
|||
if (code != AKC_ComplexChan) {
|
||||
off = ar->akof + (code & 0xFFF);
|
||||
|
||||
assert((code & 0xFFF) * 6 <
|
||||
READ_BE_UINT32_UNALIGNED((byte *)ar->akof - 4) - 8);
|
||||
|
||||
assert((code & 0xFFF) * 6 < READ_BE_UINT32_UNALIGNED((byte *)ar->akof - 4) - 8);
|
||||
assert((code & 0x7000) == 0);
|
||||
|
||||
ar->srcptr = ar->akcd + READ_LE_UINT32(&off->akcd);
|
||||
|
@ -582,14 +579,14 @@ void Scumm::akos_codec1(AkosRenderer * ar)
|
|||
bool masking;
|
||||
int step;
|
||||
|
||||
|
||||
/* implement custom scale table */
|
||||
|
||||
if(isGlobInMemory(rtString,_vars[VAR_CUSTOMSCALETABLE]))
|
||||
{
|
||||
|
||||
|
||||
if(isGlobInMemory(rtString,_vars[VAR_CUSTOMSCALETABLE])) {
|
||||
ar->v1.scaletable = getStringAddressVar(VAR_CUSTOMSCALETABLE);
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
ar->v1.scaletable = default_scale_table;
|
||||
}
|
||||
|
||||
|
@ -657,7 +654,6 @@ void Scumm::akos_codec1(AkosRenderer * ar)
|
|||
if (x_left >= (int)ar->outwidth) {
|
||||
tmp_x = j;
|
||||
skip++;
|
||||
|
||||
}
|
||||
if (ar->v1.scaletable[j--] < ar->scale_x)
|
||||
x_left--;
|
||||
|
@ -897,6 +893,7 @@ void Scumm::akos_codec1_ignorePakCols(AkosRenderer * ar, int num)
|
|||
|
||||
void Scumm::akos_codec5(AkosRenderer * ar)
|
||||
{
|
||||
|
||||
VirtScreen *vs;
|
||||
BompDrawData bdd;
|
||||
|
||||
|
@ -906,25 +903,20 @@ void Scumm::akos_codec5(AkosRenderer * ar)
|
|||
int left;
|
||||
int var_20;
|
||||
int max_width;
|
||||
|
||||
int right;
|
||||
int top;
|
||||
int bottom;
|
||||
|
||||
vs = &virtscr[0];
|
||||
|
||||
//setBlastObjectMode(ar->shadow_mode); // not implemented yet
|
||||
|
||||
mirror = ar->mirror;
|
||||
|
||||
moveX=ar->move_x_cur;
|
||||
moveY=ar->move_y_cur;
|
||||
|
||||
if (!mirror)
|
||||
{
|
||||
if (!mirror) {
|
||||
left = (ar->x - moveX - ar->width) + 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
left = ar->x + moveX -1;
|
||||
}
|
||||
|
||||
|
@ -937,7 +929,6 @@ void Scumm::akos_codec5(AkosRenderer * ar)
|
|||
|
||||
if(left < 0)
|
||||
left = 0;
|
||||
|
||||
if(left > max_width)
|
||||
left -= left - max_width;
|
||||
|
||||
|
@ -1095,12 +1086,8 @@ bool Scumm::akos_increaseAnim(Actor * a, int chan, byte *aksq, uint16 *akfo,
|
|||
|
||||
switch (code) {
|
||||
case AKC_StartAnimInActor:
|
||||
akos_queCommand(4,
|
||||
derefActorSafe(getAnimVar(a, GB(2)),
|
||||
"akos_increaseAnim:29"), getAnimVar(a,
|
||||
GB
|
||||
(3)),
|
||||
0);
|
||||
akos_queCommand(4, derefActorSafe(getAnimVar(a, GB(2)),
|
||||
"akos_increaseAnim:29"), getAnimVar(a, GB(3)), 0);
|
||||
continue;
|
||||
|
||||
case AKC_Random:
|
||||
|
|
56
gfx.cpp
56
gfx.cpp
|
@ -94,7 +94,6 @@ void Scumm::initVirtScreen(int slot, int number, int top, int width, int height,
|
|||
size += 320 * 4;
|
||||
|
||||
createResource(rtBuffer, slot+1, size);
|
||||
|
||||
vs->screenPtr = getResourceAddress(rtBuffer, slot+1);
|
||||
|
||||
ptr = vs->screenPtr;
|
||||
|
@ -145,7 +144,6 @@ void Scumm::drawDirtyScreenParts()
|
|||
vs = &virtscr[0];
|
||||
|
||||
src = vs->screenPtr + _screenStartStrip * 8 + camera._cur.y - 100;
|
||||
|
||||
_system->copy_rect(src , 320, 0, vs->topline, 320, vs->height);
|
||||
|
||||
for (i = 0; i < 40; i++) {
|
||||
|
@ -183,8 +181,11 @@ void Gdi::updateDirtyScreen(VirtScreen * vs)
|
|||
|
||||
for (i = 0; i < 40; i++) {
|
||||
bottom = vs->bdirty[i];
|
||||
|
||||
if (_vm->camera._cur.y != _vm->camera._last.y)
|
||||
|
||||
drawStripToScreen(vs, start, w, 0, vs->height);
|
||||
|
||||
else
|
||||
if (bottom) {
|
||||
top = vs->tdirty[i];
|
||||
|
@ -196,6 +197,7 @@ void Gdi::updateDirtyScreen(VirtScreen * vs)
|
|||
continue;
|
||||
}
|
||||
// drawStripToScreen(vs, start, w, top, bottom);
|
||||
|
||||
drawStripToScreen(vs, start, w, 0, vs->height);
|
||||
w = 8;
|
||||
}
|
||||
|
@ -229,15 +231,14 @@ void Gdi::drawStripToScreen(VirtScreen * vs, int x, int w, int t, int b)
|
|||
scrollY = 0;
|
||||
|
||||
ptr = vs->screenPtr + (t * 40 + x) * 8 + _readOffs + scrollY * 320;
|
||||
|
||||
_vm->_system->copy_rect(
|
||||
ptr, 320, x * 8, vs->topline + t , w, height);
|
||||
_vm->_system->copy_rect(ptr, 320, x * 8, vs->topline + t , w, height);
|
||||
}
|
||||
|
||||
void blit(byte *dst, byte *src, int w, int h)
|
||||
{
|
||||
assert(h > 0);
|
||||
|
||||
|
||||
do {
|
||||
memcpy(dst, src, w);
|
||||
dst += 320;
|
||||
|
@ -358,24 +359,26 @@ void Scumm::initBGBuffers(int height)
|
|||
int size, itemsize, i;
|
||||
byte *room;
|
||||
|
||||
if (_features & GF_AFTER_V7)
|
||||
{
|
||||
if (_features & GF_AFTER_V7) {
|
||||
initVirtScreen(0, 0, virtscr[0].topline, 200, height, 1, 1);
|
||||
}
|
||||
|
||||
room = getResourceAddress(rtRoom, _roomResource);
|
||||
if (_features & GF_SMALL_HEADER) {
|
||||
gdi._numZBuffer = 2; // ENDER
|
||||
gdi._numZBuffer = 2;
|
||||
} else {
|
||||
ptr = findResource(MKID('RMIH'), findResource(MKID('RMIM'), room));
|
||||
gdi._numZBuffer = READ_LE_UINT16(ptr + 8) + 1;
|
||||
}
|
||||
assert(gdi._numZBuffer >= 1 && gdi._numZBuffer <= 5);
|
||||
|
||||
// itemsize = (_scrHeight + 4) * 40;
|
||||
if (_features & GF_AFTER_V7)
|
||||
itemsize = (virtscr[0].height +4) * 40;
|
||||
size = itemsize * gdi._numZBuffer;
|
||||
else
|
||||
itemsize = (_scrHeight + 4) * 40;
|
||||
|
||||
|
||||
size = itemsize * gdi._numZBuffer;
|
||||
createResource(rtBuffer, 9, size);
|
||||
|
||||
for (i = 0; i < 4; i++)
|
||||
|
@ -663,11 +666,13 @@ void Gdi::drawBitmap(byte *ptr, VirtScreen * vs, int x, int y, int h,
|
|||
byte *smap_ptr, *where_draw_ptr;
|
||||
int i;
|
||||
byte *zplane_list[4];
|
||||
|
||||
int bottom;
|
||||
byte twobufs;
|
||||
int numzbuf;
|
||||
int sx;
|
||||
|
||||
|
||||
CHECK_HEAP;
|
||||
if (_vm->_features & GF_SMALL_HEADER)
|
||||
smap_ptr = _smap_ptr = ptr;
|
||||
|
@ -695,6 +700,8 @@ void Gdi::drawBitmap(byte *ptr, VirtScreen * vs, int x, int y, int h,
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
bottom = y + h;
|
||||
if (bottom > vs->height) {
|
||||
warning("Gdi::drawBitmap, strip drawn to %d below window bottom %d", bottom,
|
||||
|
@ -1928,9 +1935,13 @@ void Scumm::moveCamera()
|
|||
if (cd->_cur.x != old.x || cd->_cur.y != old.y) {
|
||||
_vars[VAR_CAMERA_POS_X] = cd->_cur.x;
|
||||
_vars[VAR_CAMERA_POS_Y] = cd->_cur.y;
|
||||
|
||||
_vars[VAR_CAMERA_DEST_X] = cd->_dest.x;
|
||||
|
||||
_vars[VAR_CAMERA_DEST_Y] = cd->_dest.y;
|
||||
|
||||
_vars[VAR_CAMERA_FOLLOWED_ACTOR] = cd ->_follows;
|
||||
|
||||
if(_vars[VAR_SCROLL_SCRIPT])
|
||||
runScript(_vars[VAR_SCROLL_SCRIPT], 0, 0, 0);
|
||||
}
|
||||
|
@ -2203,6 +2214,7 @@ void Scumm::resetActorBgs()
|
|||
while (onlyActorFlags) {
|
||||
if (onlyActorFlags & 1 && a->top != 0xFF && a->needBgReset) {
|
||||
gfxUsageBits[_screenStartStrip + i] ^= bitpos;
|
||||
|
||||
if((a->bottom - a->top) >=0)
|
||||
gdi.resetBackground(a->top, a->bottom, i);
|
||||
}
|
||||
|
@ -2575,8 +2587,11 @@ int Scumm::remapPaletteColor(int r, int g, int b, uint threshold)
|
|||
return bestitem;
|
||||
}
|
||||
|
||||
|
||||
// param3= clipping
|
||||
|
||||
// param2= mirror
|
||||
|
||||
// param1= never used ?
|
||||
void Scumm::drawBomp(BompDrawData *bd, int param1, byte* dataPtr, int param2, int param3)
|
||||
{
|
||||
|
@ -2683,12 +2698,8 @@ void Scumm::createSpecialPalette(int16 a, int16 b, int16 c, int16 d, int16 e, in
|
|||
byte *curPtr;
|
||||
byte *searchPtr;
|
||||
|
||||
|
||||
|
||||
byte readComp1;
|
||||
|
||||
byte readComp2;
|
||||
|
||||
byte readComp3;
|
||||
|
||||
int colorComp1;
|
||||
|
@ -2714,18 +2725,11 @@ void Scumm::createSpecialPalette(int16 a, int16 b, int16 c, int16 d, int16 e, in
|
|||
|
||||
curPtr = palPtr + colorMin*3;
|
||||
|
||||
for(i=colorMin;i<colorMax;i++)
|
||||
{
|
||||
|
||||
for(i=colorMin;i<colorMax;i++) {
|
||||
readComp1=*(curPtr++);
|
||||
|
||||
readComp2=*(curPtr++);
|
||||
|
||||
readComp3=*(curPtr++);
|
||||
|
||||
|
||||
|
||||
|
||||
colorComp1=((readComp1)*c)>>8;
|
||||
colorComp2=((readComp2)*d)>>8;
|
||||
colorComp3=((readComp3)*e)>>8;
|
||||
|
@ -2734,22 +2738,18 @@ void Scumm::createSpecialPalette(int16 a, int16 b, int16 c, int16 d, int16 e, in
|
|||
bestResult = 32000;
|
||||
currentIndex = 0;
|
||||
|
||||
for(j=a;j<b;j++)
|
||||
{
|
||||
for(j=a;j<b;j++) {
|
||||
searchComp1 = (*searchPtr++);
|
||||
searchComp2 = (*searchPtr++);
|
||||
searchComp3 = (*searchPtr++);
|
||||
|
||||
currentResult = abs(searchComp1-colorComp1) + abs(searchComp2-colorComp2) + abs(searchComp3-colorComp3);
|
||||
|
||||
if(currentResult<bestResult)
|
||||
{
|
||||
if(currentResult<bestResult) {
|
||||
_proc_special_palette[i]=currentIndex;
|
||||
bestResult=currentResult;
|
||||
}
|
||||
|
||||
currentIndex++;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
1
gfx.h
1
gfx.h
|
@ -78,6 +78,7 @@ struct BlastObject { /* BlastObjects to draw */
|
|||
int16 posX,posY;
|
||||
uint16 width,height;
|
||||
uint16 unk3,unk4,image;
|
||||
|
||||
uint16 mode;
|
||||
};
|
||||
|
||||
|
|
23
object.cpp
23
object.cpp
|
@ -336,6 +336,7 @@ void Scumm::drawObject(int obj, int arg)
|
|||
|
||||
xpos = od->x_pos >> 3;
|
||||
ypos = od->y_pos;
|
||||
|
||||
width = od->width >> 3;
|
||||
height = od->height &= 0xF8; // Ender
|
||||
|
||||
|
@ -521,7 +522,8 @@ void Scumm::loadRoomObjectsSmall()
|
|||
setupRoomObject(od, room);
|
||||
}
|
||||
|
||||
CHECK_HEAP}
|
||||
CHECK_HEAP
|
||||
}
|
||||
|
||||
void Scumm::setupRoomObject(ObjectData *od, byte *room)
|
||||
{
|
||||
|
@ -558,8 +560,7 @@ void Scumm::setupRoomObject(ObjectData *od, byte *room)
|
|||
return;
|
||||
}
|
||||
|
||||
cdhd =
|
||||
(CodeHeader *)findResourceData(MKID('CDHD'),
|
||||
cdhd = (CodeHeader *)findResourceData(MKID('CDHD'),
|
||||
room + od->offs_obcd_to_room);
|
||||
if (_features & GF_AFTER_V7)
|
||||
od->obj_nr = READ_LE_UINT16(&(cdhd->v7.obj_id));
|
||||
|
@ -653,6 +654,7 @@ void Scumm::clearOwnerOf(int obj)
|
|||
} while (++i <= _numObjectsInRoom);
|
||||
return;
|
||||
}
|
||||
|
||||
for (i = 1; i < _maxInventoryItems; i++) {
|
||||
if (_inventory[i] == obj) {
|
||||
j = whereIsObject(obj);
|
||||
|
@ -1184,6 +1186,7 @@ void Scumm::enqueueObject(int objectNumber, int objectX, int objectY, int object
|
|||
eo->unk3 = f;
|
||||
eo->unk4 = g;
|
||||
eo->image = image;
|
||||
|
||||
eo->mode = mode;
|
||||
}
|
||||
|
||||
|
@ -1202,11 +1205,8 @@ void Scumm::drawBlastObjects()
|
|||
void Scumm::drawBlastObject(BlastObject * eo)
|
||||
{
|
||||
VirtScreen *vs;
|
||||
byte *roomptr, *bomp;
|
||||
byte *ptr;
|
||||
byte *img;
|
||||
byte *bomp, *ptr, *img;
|
||||
int idx;
|
||||
|
||||
BompDrawData bdd;
|
||||
|
||||
vs = &virtscr[0];
|
||||
|
@ -1217,8 +1217,7 @@ void Scumm::drawBlastObject(BlastObject * eo)
|
|||
|
||||
idx = _objs[getObjectIndex(eo->number)].fl_object_index;
|
||||
|
||||
if(idx)
|
||||
{
|
||||
if(idx) {
|
||||
ptr = getResourceAddress(rtFlObject, idx);
|
||||
ptr = findResource(MKID('OBIM'), ptr);
|
||||
} else {
|
||||
|
@ -1226,19 +1225,16 @@ void Scumm::drawBlastObject(BlastObject * eo)
|
|||
assert(idx != -1);
|
||||
ptr = getResourceAddress(1, _roomResource) + _objs[idx].offs_obim_to_room;
|
||||
}
|
||||
|
||||
if(!ptr)
|
||||
error("BlastObject object %d image not found",eo->number);
|
||||
|
||||
img = findResource(IMxx_tags[eo->image], ptr);
|
||||
if(!img)
|
||||
img = findResource(IMxx_tags[1], ptr); // Backward compatibility with samnmax blast objects
|
||||
|
||||
if(!img)
|
||||
error("blast-object %d invalid image %d (1-x)",eo->number,eo->image);
|
||||
|
||||
bomp = findResourceData(MKID('BOMP'), img);
|
||||
|
||||
if(!bomp)
|
||||
error("object %d is not a blast object",eo->number);
|
||||
|
||||
|
@ -1255,11 +1251,8 @@ void Scumm::drawBlastObject(BlastObject * eo)
|
|||
bdd.scale_y = (unsigned char)eo->unk4;
|
||||
|
||||
drawBomp(&bdd, 0, bdd.dataptr, 1, 0);
|
||||
|
||||
|
||||
updateDirtyRect(vs->number, bdd.x, bdd.x + bdd.srcwidth, bdd.y,
|
||||
bdd.y + bdd.srcheight, 0);
|
||||
|
||||
}
|
||||
|
||||
void Scumm::removeBlastObjects()
|
||||
|
|
19
resource.cpp
19
resource.cpp
|
@ -652,12 +652,12 @@ byte *Scumm::getStringAddress(int i)
|
|||
return b;
|
||||
}
|
||||
|
||||
byte *Scumm::getStringAddressVar(int i)
|
||||
{
|
||||
|
||||
|
||||
byte *Scumm::getStringAddressVar(int i) {
|
||||
byte *addr;
|
||||
|
||||
addr=getResourceAddress(rtString,_vars[i]);
|
||||
|
||||
if(addr==NULL)
|
||||
error("NULL string var %d slot %d",i,_vars[i]);
|
||||
|
||||
|
@ -665,7 +665,6 @@ byte *Scumm::getStringAddressVar(int i)
|
|||
return ((ArrayHeader *)addr)->data;
|
||||
|
||||
return(addr);
|
||||
|
||||
}
|
||||
|
||||
void Scumm::setResourceCounter(int type, int idx, byte flag)
|
||||
|
@ -1163,16 +1162,27 @@ void Scumm::allocateArrays()
|
|||
}
|
||||
|
||||
|
||||
|
||||
|
||||
uint32 Scumm::isGlobInMemory(int type, int index)
|
||||
|
||||
{
|
||||
|
||||
validateResource("isGlobInMemory",type,index);
|
||||
|
||||
|
||||
|
||||
if(res.address[type][index]==NULL)
|
||||
|
||||
return(0);
|
||||
|
||||
|
||||
|
||||
return(1);
|
||||
|
||||
}
|
||||
|
||||
|
||||
uint16 newTag2Old(uint32 oldTag)
|
||||
{
|
||||
switch (oldTag) {
|
||||
|
@ -1214,3 +1224,4 @@ uint16 newTag2Old(uint32 oldTag)
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
12
script.cpp
12
script.cpp
|
@ -32,6 +32,7 @@ void Scumm::runScript(int script, int a, int b, int16 * lvarptr)
|
|||
int slot;
|
||||
ScriptSlot *s;
|
||||
|
||||
|
||||
if (script == 0)
|
||||
return;
|
||||
|
||||
|
@ -267,6 +268,7 @@ void Scumm::getScriptEntryPoint()
|
|||
/* Execute a script - Read opcode, and execute it from the table */
|
||||
void Scumm::executeScript()
|
||||
{
|
||||
|
||||
OpcodeProc op;
|
||||
while (_currentScript != 0xFF) {
|
||||
_opcode = fetchScriptByte();
|
||||
|
@ -966,10 +968,7 @@ void Scumm::beginOverride()
|
|||
|
||||
idx = vm.cutSceneStackPointer;
|
||||
ptr = &vm.cutScenePtr[idx];
|
||||
/* if (!*ptr) { // ENDER - FIXME - We don't need this?
|
||||
vm.slot[_currentScript].cutsceneOverride++;
|
||||
}
|
||||
*/
|
||||
|
||||
*ptr = _scriptPointer - _scriptOrgPointer;
|
||||
vm.cutSceneScript[idx] = _currentScript;
|
||||
|
||||
|
@ -985,10 +984,7 @@ void Scumm::endOverride()
|
|||
|
||||
idx = vm.cutSceneStackPointer;
|
||||
ptr = &vm.cutScenePtr[idx];
|
||||
/* if (!*ptr) { // ENDER - FIXME - We don't need this?
|
||||
// vm.slot[_currentScript].cutsceneOverride--;
|
||||
//printf("ending override: %d on script %d\n", vm.slot[_currentScript].cutsceneOverride, _currentScript);
|
||||
} */
|
||||
|
||||
*ptr = 0;
|
||||
vm.cutSceneScript[idx] = 0;
|
||||
_vars[VAR_OVERRIDE] = 0;
|
||||
|
|
3
scumm.h
3
scumm.h
|
@ -1692,8 +1692,11 @@ public:
|
|||
byte VAR_CAMERA_SPEED_Y;
|
||||
byte VAR_CAMERA_ACCEL_X;
|
||||
byte VAR_CAMERA_ACCEL_Y;
|
||||
|
||||
byte VAR_CAMERA_DEST_X;
|
||||
|
||||
byte VAR_CAMERA_DEST_Y;
|
||||
|
||||
byte VAR_CAMERA_FOLLOWED_ACTOR;
|
||||
|
||||
byte VAR_LEFTBTN_DOWN;
|
||||
|
|
33
scummvm.cpp
33
scummvm.cpp
|
@ -53,10 +53,7 @@ void Scumm::scummInit()
|
|||
int i;
|
||||
Actor *a;
|
||||
|
||||
|
||||
tempMusic=0;
|
||||
|
||||
|
||||
debug(9, "scummInit");
|
||||
|
||||
if (_features & GF_SMALL_HEADER)
|
||||
|
@ -208,13 +205,8 @@ int Scumm::scummLoop(int delta)
|
|||
static int counter = 0;
|
||||
|
||||
#ifndef _WIN32_WCE
|
||||
|
||||
|
||||
if (_debugger)
|
||||
_debugger->on_frame();
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
_vars[VAR_TMR_1] += delta;
|
||||
|
@ -259,23 +251,12 @@ int Scumm::scummLoop(int delta)
|
|||
|
||||
{
|
||||
|
||||
if(tempMusic == 3)
|
||||
|
||||
{
|
||||
|
||||
if(tempMusic == 3) {
|
||||
tempMusic = 0;
|
||||
_vars[VAR_MUSIC_FLAG]++;
|
||||
|
||||
}
|
||||
|
||||
else
|
||||
|
||||
{
|
||||
|
||||
} else {
|
||||
tempMusic ++;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
@ -328,6 +309,7 @@ int Scumm::scummLoop(int delta)
|
|||
if (camera._cur.x != camera._last.x || camera._cur.y != camera._last.y
|
||||
|| _BgNeedsRedraw || _fullRedraw) {
|
||||
redrawBGAreas();
|
||||
|
||||
_videoBuffer = virtscr[0].screenPtr + (camera._cur.y - 100) * 328;
|
||||
}
|
||||
}
|
||||
|
@ -431,7 +413,7 @@ void Scumm::startScene(int room, Actor * a, int objectNr)
|
|||
|
||||
_currentRoom = room;
|
||||
_vars[VAR_ROOM] = room;
|
||||
// printf("startscene with room 0x%x\n", room);
|
||||
|
||||
if (room >= 0x80)
|
||||
_roomResource = _resourceMapper[room & 0x7F];
|
||||
else
|
||||
|
@ -457,6 +439,7 @@ void Scumm::startScene(int room, Actor * a, int objectNr)
|
|||
if (!(_features & GF_AFTER_V7)) {
|
||||
camera._mode = CM_NORMAL;
|
||||
camera._cur.x = camera._dest.x = 160;
|
||||
|
||||
camera._cur.y = camera._dest.y = 100;
|
||||
}
|
||||
|
||||
|
@ -711,8 +694,10 @@ void Scumm::initRoomSubBlocks()
|
|||
|
||||
initBGBuffers(_scrHeight);
|
||||
|
||||
|
||||
_videoBuffer = virtscr[0].screenPtr;
|
||||
|
||||
|
||||
memset(_extraBoxFlags, 0, sizeof(_extraBoxFlags));
|
||||
}
|
||||
|
||||
|
@ -822,9 +807,13 @@ void Scumm::processKbd()
|
|||
|
||||
_virtual_mouse_x = mouse.x + virtscr[0].xstart;
|
||||
|
||||
|
||||
|
||||
if(_features & GF_AFTER_V7)
|
||||
_virtual_mouse_y = mouse.y + camera._cur.y-100;
|
||||
|
||||
else
|
||||
|
||||
_virtual_mouse_y = mouse.y;
|
||||
|
||||
if (!(_features & GF_OLD256))
|
||||
|
|
|
@ -237,7 +237,9 @@ void Scumm::CHARSET_1()
|
|||
string[0].ypos = ((a->new_1 - s) >> 1) + s - a->elevation + a->y;
|
||||
if (string[0].ypos < 1)
|
||||
string[0].ypos = 1;
|
||||
|
||||
if (string[0].ypos < camera._cur.y - 100)
|
||||
|
||||
string[0].ypos = camera._cur.y - 100;
|
||||
|
||||
s = a->scalex * a->new_2 / 0xFF;
|
||||
|
@ -533,6 +535,7 @@ void Scumm::drawString(int a)
|
|||
}
|
||||
} else {
|
||||
if (a == 1 && (_features & GF_AFTER_V6))
|
||||
|
||||
if(string[a].no_talk_anim==0)
|
||||
charset._blitAlso = true;
|
||||
if (_features & GF_OLD256)
|
||||
|
|
7
vars.cpp
7
vars.cpp
|
@ -140,10 +140,14 @@ void Scumm::setupScummVarsNew()
|
|||
VAR_NEW_ROOM = 35;
|
||||
VAR_WALKTO_OBJ = 36;
|
||||
|
||||
|
||||
VAR_CAMERA_DEST_X = 38;
|
||||
|
||||
VAR_CAMERA_DEST_Y = 39;
|
||||
|
||||
VAR_CAMERA_FOLLOWED_ACTOR = 40;
|
||||
|
||||
|
||||
VAR_SCROLL_SCRIPT = 50;
|
||||
VAR_ENTRY_SCRIPT = 51;
|
||||
VAR_ENTRY_SCRIPT2 = 52;
|
||||
|
@ -188,9 +192,7 @@ void Scumm::setupScummVarsNew()
|
|||
VAR_DEBUGMODE = 116;
|
||||
|
||||
VAR_CHARSET_MASK = 119;
|
||||
|
||||
VAR_VIDEONAME = 0xF6/2;
|
||||
|
||||
VAR_CUSTOMSCALETABLE = 131;
|
||||
|
||||
//VAR_V5_DRAWFLAGS = 9;
|
||||
|
@ -201,6 +203,5 @@ void Scumm::setupScummVarsNew()
|
|||
VAR_V5_CHARFLAG = 60;
|
||||
|
||||
VAR_V6_EMSSPACE = 76;
|
||||
|
||||
VAR_STRING2DRAW = 130;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue