moved more stuff out of the Scumm class (usage of g_scumm is only temporary, Endy, no worries <g>); some other cleanup
svn-id: r4376
This commit is contained in:
parent
1ba002766e
commit
8fd03ae929
8 changed files with 354 additions and 387 deletions
165
actor.cpp
165
actor.cpp
|
@ -411,7 +411,7 @@ void Actor::startAnimActor(int frame)
|
||||||
needRedraw = true;
|
needRedraw = true;
|
||||||
needBgReset = true;
|
needBgReset = true;
|
||||||
if (frame == initFrame)
|
if (frame == initFrame)
|
||||||
_scumm->initActorCostumeData(this);
|
cost.reset();
|
||||||
_scumm->akos_decodeData(this, frame, (uint) - 1);
|
_scumm->akos_decodeData(this, frame, (uint) - 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -440,7 +440,7 @@ void Actor::startAnimActor(int frame)
|
||||||
needRedraw = true;
|
needRedraw = true;
|
||||||
|
|
||||||
if (initFrame == frame)
|
if (initFrame == frame)
|
||||||
_scumm->initActorCostumeData(this);
|
cost.reset();
|
||||||
|
|
||||||
if (frame != 0x3E) {
|
if (frame != 0x3E) {
|
||||||
_scumm->cost_decodeData(this, frame, (uint) - 1);
|
_scumm->cost_decodeData(this, frame, (uint) - 1);
|
||||||
|
@ -652,6 +652,8 @@ void Actor::hideActor()
|
||||||
if (!visible)
|
if (!visible)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
debug(1, "hideActor %d", (int)number);
|
||||||
|
|
||||||
if (moving) {
|
if (moving) {
|
||||||
startAnimActor(standFrame);
|
startAnimActor(standFrame);
|
||||||
moving = 0;
|
moving = 0;
|
||||||
|
@ -667,6 +669,8 @@ void Actor::showActor()
|
||||||
if (_scumm->_currentRoom == 0 || visible)
|
if (_scumm->_currentRoom == 0 || visible)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
debug(1, "showActor %d", (int)number);
|
||||||
|
|
||||||
adjustActorPos();
|
adjustActorPos();
|
||||||
|
|
||||||
_scumm->ensureResourceLoaded(rtCostume, costume);
|
_scumm->ensureResourceLoaded(rtCostume, costume);
|
||||||
|
@ -937,136 +941,135 @@ void Scumm::processActors()
|
||||||
a = *ac;
|
a = *ac;
|
||||||
if (a->costume) {
|
if (a->costume) {
|
||||||
CHECK_HEAP getMaskFromBox(a->walkbox);
|
CHECK_HEAP getMaskFromBox(a->walkbox);
|
||||||
drawActorCostume(a);
|
a->drawActorCostume();
|
||||||
CHECK_HEAP actorAnimate(a);
|
CHECK_HEAP a->actorAnimate();
|
||||||
}
|
}
|
||||||
} while (ac++, --cnt);
|
} while (ac++, --cnt);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Scumm::drawActorCostume(Actor * a)
|
void Actor::drawActorCostume()
|
||||||
{
|
{
|
||||||
if (!(_features & GF_AFTER_V7)) {
|
if (!(_scumm->_features & GF_AFTER_V7)) {
|
||||||
CostumeRenderer cr;
|
CostumeRenderer cr;
|
||||||
|
|
||||||
if (a == NULL || !a->needRedraw)
|
if (!needRedraw)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (getClass(a->number, 20))
|
if (_scumm->getClass(number, 20))
|
||||||
a->mask = 0;
|
mask = 0;
|
||||||
else if (getClass(a->number, 21))
|
else if (_scumm->getClass(number, 21))
|
||||||
a->forceClip = 1;
|
forceClip = 1;
|
||||||
|
|
||||||
if (_gameId==GID_SAMNMAX && getState(995)) // FIXME: ugly fix for samnmax inventory
|
// FIXME: ugly fix for samnmax inventory
|
||||||
|
if (_scumm->_gameId==GID_SAMNMAX && _scumm->getState(995))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
a->needRedraw = false;
|
needRedraw = false;
|
||||||
|
|
||||||
a->setupActorScale();
|
setupActorScale();
|
||||||
|
|
||||||
/* First, zero initialize all fields */
|
/* First, zero initialize all fields */
|
||||||
memset(&cr, 0, sizeof(cr));
|
memset(&cr, 0, sizeof(cr));
|
||||||
|
|
||||||
cr._actorX = a->x - virtscr->xstart;
|
cr._actorX = x - _scumm->virtscr->xstart;
|
||||||
cr._actorY = a->y - a->elevation;
|
cr._actorY = y - elevation;
|
||||||
cr._scaleX = a->scalex;
|
cr._scaleX = scalex;
|
||||||
cr._scaleY = a->scaley;
|
cr._scaleY = scaley;
|
||||||
|
|
||||||
cr._outheight = virtscr->height;
|
cr._outheight = _scumm->virtscr->height;
|
||||||
cr._vm = this;
|
cr._vm = _scumm;
|
||||||
|
|
||||||
cr._zbuf = a->mask;
|
cr._zbuf = mask;
|
||||||
if (cr._zbuf > gdi._numZBuffer)
|
if (cr._zbuf > _scumm->gdi._numZBuffer)
|
||||||
cr._zbuf = (byte)gdi._numZBuffer;
|
cr._zbuf = (byte)_scumm->gdi._numZBuffer;
|
||||||
if (a->forceClip)
|
if (forceClip)
|
||||||
cr._zbuf = a->forceClip;
|
cr._zbuf = forceClip;
|
||||||
|
|
||||||
cr._shadow_table = _shadowPalette;
|
cr._shadow_table = _scumm->_shadowPalette;
|
||||||
|
|
||||||
cost_setCostume(&cr, a->costume);
|
cr.setCostume(costume);
|
||||||
cost_setPalette(&cr, a->palette);
|
cr.setPalette(palette);
|
||||||
cost_setFacing(&cr, a);
|
cr.setFacing(facing);
|
||||||
|
|
||||||
a->top = 0xFF;
|
top = 0xFF;
|
||||||
|
|
||||||
a->bottom = 0;
|
bottom = 0;
|
||||||
|
|
||||||
/* if the actor is partially hidden, redraw it next frame */
|
/* if the actor is partially hidden, redraw it next frame */
|
||||||
if (cr.drawCostume(a) & 1) {
|
if (cr.drawCostume(this) & 1) {
|
||||||
a->needBgReset = true;
|
needBgReset = true;
|
||||||
a->needRedraw = true;
|
needRedraw = true;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
AkosRenderer ar;
|
AkosRenderer ar;
|
||||||
|
|
||||||
if (a == NULL || !a->needRedraw)
|
if (!needRedraw)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
a->needRedraw = false;
|
needRedraw = false;
|
||||||
|
|
||||||
a->setupActorScale();
|
setupActorScale();
|
||||||
|
|
||||||
/* First, zero initialize all fields */
|
/* First, zero initialize all fields */
|
||||||
memset(&ar, 0, sizeof(ar));
|
memset(&ar, 0, sizeof(ar));
|
||||||
|
|
||||||
ar.x = a->x - virtscr->xstart;
|
ar.x = x - _scumm->virtscr->xstart;
|
||||||
ar.y = a->y - a->elevation;
|
ar.y = y - elevation;
|
||||||
ar.scale_x = a->scalex;
|
ar.scale_x = scalex;
|
||||||
ar.scale_y = a->scaley;
|
ar.scale_y = scaley;
|
||||||
ar.clipping = a->forceClip;
|
ar.clipping = forceClip;
|
||||||
if (ar.clipping == 100) {
|
if (ar.clipping == 100) {
|
||||||
ar.clipping = a->mask;
|
ar.clipping = mask;
|
||||||
if (ar.clipping > (byte)gdi._numZBuffer)
|
if (ar.clipping > (byte)_scumm->gdi._numZBuffer)
|
||||||
ar.clipping = gdi._numZBuffer;
|
ar.clipping = _scumm->gdi._numZBuffer;
|
||||||
}
|
}
|
||||||
ar.charsetmask = _vars[VAR_CHARSET_MASK] != 0;
|
ar.charsetmask = _scumm->_vars[_scumm->VAR_CHARSET_MASK] != 0;
|
||||||
|
|
||||||
ar.outptr = virtscr->screenPtr + virtscr->xstart;
|
ar.outptr = _scumm->virtscr->screenPtr + _scumm->virtscr->xstart;
|
||||||
ar.outwidth = virtscr->width;
|
ar.outwidth = _scumm->virtscr->width;
|
||||||
ar.outheight = virtscr->height;
|
ar.outheight = _scumm->virtscr->height;
|
||||||
|
|
||||||
ar.shadow_mode = a->shadow_mode;
|
ar.shadow_mode = shadow_mode;
|
||||||
ar.shadow_table = _shadowPalette;
|
ar.shadow_table = _scumm->_shadowPalette;
|
||||||
|
|
||||||
akos_setCostume(&ar, a->costume);
|
ar.setCostume(costume);
|
||||||
akos_setPalette(&ar, a->palette);
|
ar.setPalette(palette);
|
||||||
akos_setFacing(&ar, a);
|
ar.setFacing(this);
|
||||||
|
|
||||||
ar.dirty_id = a->number;
|
ar.dirty_id = number;
|
||||||
|
|
||||||
ar.cd = &a->cost;
|
ar.cd = &cost;
|
||||||
|
|
||||||
ar.draw_top = a->top = 0x7fffffff;
|
ar.draw_top = top = 0x7fffffff;
|
||||||
ar.draw_bottom = a->bottom = 0;
|
ar.draw_bottom = bottom = 0;
|
||||||
akos_drawCostume(&ar);
|
ar.drawCostume();
|
||||||
a->top = ar.draw_top;
|
top = ar.draw_top;
|
||||||
a->bottom = ar.draw_bottom;
|
bottom = ar.draw_bottom;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Scumm::actorAnimate(Actor * a)
|
void Actor::actorAnimate()
|
||||||
{
|
{
|
||||||
byte *akos;
|
if (costume == 0)
|
||||||
LoadedCostume lc;
|
|
||||||
|
|
||||||
if (a == NULL || a->costume == 0)
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
a->animProgress++;
|
animProgress++;
|
||||||
if (a->animProgress >= a->animSpeed) {
|
if (animProgress >= animSpeed) {
|
||||||
a->animProgress = 0;
|
animProgress = 0;
|
||||||
|
|
||||||
if (_features & GF_AFTER_V7) {
|
if (_scumm->_features & GF_AFTER_V7) {
|
||||||
akos = getResourceAddress(rtCostume, a->costume);
|
byte *akos = _scumm->getResourceAddress(rtCostume, costume);
|
||||||
assert(akos);
|
assert(akos);
|
||||||
if (akos_increaseAnims(akos, a)) {
|
if (_scumm->akos_increaseAnims(akos, this)) {
|
||||||
a->needRedraw = true;
|
needRedraw = true;
|
||||||
a->needBgReset = true;
|
needBgReset = true;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
loadCostume(&lc, a->costume);
|
LoadedCostume lc;
|
||||||
if (cost_increaseAnims(&lc, a)) {
|
_scumm->loadCostume(&lc, costume);
|
||||||
a->needRedraw = true;
|
if (_scumm->cost_increaseAnims(&lc, this)) {
|
||||||
a->needBgReset = true;
|
needRedraw = true;
|
||||||
|
needBgReset = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1161,14 +1164,16 @@ void Actor::setActorCostume(int c)
|
||||||
|
|
||||||
costumeNeedsInit = true;
|
costumeNeedsInit = true;
|
||||||
|
|
||||||
|
debug(1, "setActorCostume (actor=%d, costume=%d)", (int)number, (int)c);
|
||||||
|
|
||||||
if (visible) {
|
if (visible) {
|
||||||
hideActor();
|
hideActor();
|
||||||
_scumm->initActorCostumeData(this);
|
cost.reset();
|
||||||
costume = c;
|
costume = c;
|
||||||
showActor();
|
showActor();
|
||||||
} else {
|
} else {
|
||||||
costume = c;
|
costume = c;
|
||||||
_scumm->initActorCostumeData(this);
|
cost.reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i = 0; i < 32; i++)
|
for (i = 0; i < 32; i++)
|
||||||
|
|
15
actor.h
15
actor.h
|
@ -50,6 +50,15 @@ struct CostumeData {
|
||||||
uint16 start[16];
|
uint16 start[16];
|
||||||
uint16 end[16];
|
uint16 end[16];
|
||||||
uint16 frame[16];
|
uint16 frame[16];
|
||||||
|
|
||||||
|
void reset()
|
||||||
|
{
|
||||||
|
stopped = 0;
|
||||||
|
for (int i = 0; i < 16; i++) {
|
||||||
|
active[i] = 0;
|
||||||
|
curpos[i] = start[i] = end[i] = frame[i] = 0xFFFF;
|
||||||
|
}
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
class Actor {
|
class Actor {
|
||||||
|
@ -118,6 +127,8 @@ public:
|
||||||
void adjustActorPos();
|
void adjustActorPos();
|
||||||
void turnToDirection(int newdir);
|
void turnToDirection(int newdir);
|
||||||
void walkActor();
|
void walkActor();
|
||||||
|
void drawActorCostume();
|
||||||
|
void actorAnimate();
|
||||||
void setActorCostume(int c);
|
void setActorCostume(int c);
|
||||||
byte *getActorName();
|
byte *getActorName();
|
||||||
void startWalkActor(int x, int y, int dir);
|
void startWalkActor(int x, int y, int dir);
|
||||||
|
@ -126,6 +137,10 @@ public:
|
||||||
void walkActorOld();
|
void walkActorOld();
|
||||||
|
|
||||||
bool isInCurrentRoom() { return room == _scumm->_currentRoom; }
|
bool isInCurrentRoom() { return room == _scumm->_currentRoom; }
|
||||||
|
|
||||||
|
int getAnimVar(byte var) { return animVariable[var]; }
|
||||||
|
void setAnimVar(byte var, int value) { animVariable[var] = value; }
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
452
akos.cpp
452
akos.cpp
|
@ -150,66 +150,66 @@ void Scumm::akos_decodeData(Actor * a, int frame, uint usemask)
|
||||||
} while ((uint16)mask);
|
} while ((uint16)mask);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Scumm::akos_setPalette(AkosRenderer * ar, byte *palette)
|
void AkosRenderer::setPalette(byte *new_palette)
|
||||||
{
|
{
|
||||||
byte *akpl;
|
byte *the_akpl;
|
||||||
uint size, i;
|
uint size, i;
|
||||||
|
|
||||||
akpl = findResourceData(MKID('AKPL'), ar->akos);
|
the_akpl = g_scumm->findResourceData(MKID('AKPL'), akos);
|
||||||
size = getResourceDataSize(akpl);
|
size = g_scumm->getResourceDataSize(akpl);
|
||||||
|
|
||||||
if (size > 256)
|
if (size > 256)
|
||||||
error("akos_setPalette: %d is too many colors", size);
|
error("akos_setPalette: %d is too many colors", size);
|
||||||
|
|
||||||
for (i = 0; i < size; i++) {
|
for (i = 0; i < size; i++) {
|
||||||
ar->palette[i] = palette[i] != 0xFF ? palette[i] : akpl[i];
|
palette[i] = new_palette[i] != 0xFF ? new_palette[i] : the_akpl[i];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Scumm::akos_setCostume(AkosRenderer * ar, int costume)
|
void AkosRenderer::setCostume(int costume)
|
||||||
{
|
{
|
||||||
ar->akos = getResourceAddress(rtCostume, costume);
|
akos = g_scumm->getResourceAddress(rtCostume, costume);
|
||||||
assert(ar->akos);
|
assert(akos);
|
||||||
|
|
||||||
ar->akhd = (AkosHeader *) findResourceData(MKID('AKHD'), ar->akos);
|
akhd = (AkosHeader *) g_scumm->findResourceData(MKID('AKHD'), akos);
|
||||||
ar->akof = (AkosOffset *) findResourceData(MKID('AKOF'), ar->akos);
|
akof = (AkosOffset *) g_scumm->findResourceData(MKID('AKOF'), akos);
|
||||||
ar->akci = findResourceData(MKID('AKCI'), ar->akos);
|
akci = g_scumm->findResourceData(MKID('AKCI'), akos);
|
||||||
ar->aksq = findResourceData(MKID('AKSQ'), ar->akos);
|
aksq = g_scumm->findResourceData(MKID('AKSQ'), akos);
|
||||||
ar->akcd = findResourceData(MKID('AKCD'), ar->akos);
|
akcd = g_scumm->findResourceData(MKID('AKCD'), akos);
|
||||||
ar->akpl = findResourceData(MKID('AKPL'), ar->akos);
|
akpl = g_scumm->findResourceData(MKID('AKPL'), akos);
|
||||||
ar->codec = READ_LE_UINT16(&ar->akhd->codec);
|
codec = READ_LE_UINT16(&akhd->codec);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Scumm::akos_setFacing(AkosRenderer * ar, Actor * a)
|
void AkosRenderer::setFacing(Actor * a)
|
||||||
{
|
{
|
||||||
ar->mirror = (newDirToOldDir(a->facing) != 0 || ar->akhd->flags & 1);
|
mirror = (g_scumm->newDirToOldDir(a->facing) != 0 || akhd->flags & 1);
|
||||||
if (a->flip)
|
if (a->flip)
|
||||||
ar->mirror ^= 1;
|
mirror ^= 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Scumm::akos_drawCostume(AkosRenderer * ar)
|
bool AkosRenderer::drawCostume()
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
bool result = false;
|
bool result = false;
|
||||||
|
|
||||||
ar->move_x = ar->move_y = 0;
|
move_x = move_y = 0;
|
||||||
for (i = 0; i < 16; i++)
|
for (i = 0; i < 16; i++)
|
||||||
result |= akos_drawCostumeChannel(ar, i);
|
result |= drawCostumeChannel(i);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Scumm::akos_drawCostumeChannel(AkosRenderer * ar, int chan)
|
bool AkosRenderer::drawCostumeChannel(int chan)
|
||||||
{
|
{
|
||||||
uint code;
|
uint code;
|
||||||
byte *p;
|
byte *p;
|
||||||
AkosOffset *off;
|
AkosOffset *off;
|
||||||
AkosCI *akci;
|
AkosCI *the_akci;
|
||||||
uint i, extra;
|
uint i, extra;
|
||||||
|
|
||||||
if (!ar->cd->active[chan] || ar->cd->stopped & (1 << chan))
|
if (!cd->active[chan] || cd->stopped & (1 << chan))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
p = ar->aksq + ar->cd->curpos[chan];
|
p = aksq + cd->curpos[chan];
|
||||||
|
|
||||||
code = p[0];
|
code = p[0];
|
||||||
if (code & 0x80)
|
if (code & 0x80)
|
||||||
|
@ -219,33 +219,33 @@ bool Scumm::akos_drawCostumeChannel(AkosRenderer * ar, int chan)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (code != AKC_ComplexChan) {
|
if (code != AKC_ComplexChan) {
|
||||||
off = ar->akof + (code & 0xFFF);
|
off = 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 *)akof - 4) - 8);
|
||||||
assert((code & 0x7000) == 0);
|
assert((code & 0x7000) == 0);
|
||||||
|
|
||||||
ar->srcptr = ar->akcd + READ_LE_UINT32(&off->akcd);
|
srcptr = akcd + READ_LE_UINT32(&off->akcd);
|
||||||
akci = (AkosCI *) (ar->akci + READ_LE_UINT16(&off->akci));
|
the_akci = (AkosCI *) (akci + READ_LE_UINT16(&off->akci));
|
||||||
|
|
||||||
ar->move_x_cur = ar->move_x + (int16) READ_LE_UINT16(&akci->rel_x);
|
move_x_cur = move_x + (int16) READ_LE_UINT16(&the_akci->rel_x);
|
||||||
ar->move_y_cur = ar->move_y + (int16) READ_LE_UINT16(&akci->rel_y);
|
move_y_cur = move_y + (int16) READ_LE_UINT16(&the_akci->rel_y);
|
||||||
ar->width = READ_LE_UINT16(&akci->width);
|
width = READ_LE_UINT16(&the_akci->width);
|
||||||
ar->height = READ_LE_UINT16(&akci->height);
|
height = READ_LE_UINT16(&the_akci->height);
|
||||||
ar->move_x += (int16) READ_LE_UINT16(&akci->move_x);
|
move_x += (int16) READ_LE_UINT16(&the_akci->move_x);
|
||||||
ar->move_y -= (int16) READ_LE_UINT16(&akci->move_y);
|
move_y -= (int16) READ_LE_UINT16(&the_akci->move_y);
|
||||||
|
|
||||||
switch (ar->codec) {
|
switch (codec) {
|
||||||
case 1:
|
case 1:
|
||||||
akos_codec1(ar);
|
codec1();
|
||||||
break;
|
break;
|
||||||
case 5:
|
case 5:
|
||||||
akos_codec5(ar);
|
codec5();
|
||||||
break;
|
break;
|
||||||
case 16:
|
case 16:
|
||||||
akos_codec16(ar);
|
codec16();
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
error("akos_drawCostumeChannel: invalid codec %d", ar->codec);
|
error("akos_drawCostumeChannel: invalid codec %d", codec);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
extra = p[2];
|
extra = p[2];
|
||||||
|
@ -255,31 +255,31 @@ bool Scumm::akos_drawCostumeChannel(AkosRenderer * ar, int chan)
|
||||||
code = p[4];
|
code = p[4];
|
||||||
if (code & 0x80)
|
if (code & 0x80)
|
||||||
code = ((code & 0xF) << 8) | p[5];
|
code = ((code & 0xF) << 8) | p[5];
|
||||||
off = ar->akof + code;
|
off = akof + code;
|
||||||
|
|
||||||
ar->srcptr = ar->akcd + READ_LE_UINT32(&off->akcd);
|
srcptr = akcd + READ_LE_UINT32(&off->akcd);
|
||||||
akci = (AkosCI *) (ar->akci + READ_LE_UINT16(&off->akci));
|
the_akci = (AkosCI *) (akci + READ_LE_UINT16(&off->akci));
|
||||||
|
|
||||||
ar->move_x_cur = ar->move_x + (int16) READ_LE_UINT16(p + 0);
|
move_x_cur = move_x + (int16) READ_LE_UINT16(p + 0);
|
||||||
ar->move_y_cur = ar->move_y + (int16) READ_LE_UINT16(p + 2);
|
move_y_cur = move_y + (int16) READ_LE_UINT16(p + 2);
|
||||||
|
|
||||||
p += (p[4] & 0x80) ? 6 : 5;
|
p += (p[4] & 0x80) ? 6 : 5;
|
||||||
|
|
||||||
ar->width = READ_LE_UINT16(&akci->width);
|
width = READ_LE_UINT16(&the_akci->width);
|
||||||
ar->height = READ_LE_UINT16(&akci->height);
|
height = READ_LE_UINT16(&the_akci->height);
|
||||||
|
|
||||||
switch (ar->codec) {
|
switch (codec) {
|
||||||
case 1:
|
case 1:
|
||||||
akos_codec1(ar);
|
codec1();
|
||||||
break;
|
break;
|
||||||
case 5:
|
case 5:
|
||||||
akos_codec5(ar);
|
codec5();
|
||||||
break;
|
break;
|
||||||
case 16:
|
case 16:
|
||||||
akos_codec16(ar);
|
codec16();
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
error("akos_drawCostumeChannel: invalid codec %d", ar->codec);
|
error("akos_drawCostumeChannel: invalid codec %d", codec);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -568,15 +568,14 @@ const byte default_scale_table[768] = {
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
void Scumm::akos_codec1(AkosRenderer * ar)
|
void AkosRenderer::codec1()
|
||||||
{
|
{
|
||||||
int num_colors;
|
int num_colors;
|
||||||
bool use_scaling;
|
bool use_scaling;
|
||||||
int i, j;
|
int i, j;
|
||||||
int x, x_right, x_left, skip = 0, tmp_x, tmp_y;
|
int cur_x, x_right, x_left, skip = 0, tmp_x, tmp_y;
|
||||||
int y, y_top, y_bottom;
|
int cur_y, y_top, y_bottom;
|
||||||
bool y_clipping;
|
bool y_clipping;
|
||||||
bool charsetmask;
|
|
||||||
bool masking;
|
bool masking;
|
||||||
int step;
|
int step;
|
||||||
|
|
||||||
|
@ -585,78 +584,78 @@ void Scumm::akos_codec1(AkosRenderer * ar)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if(isGlobInMemory(rtString,_vars[VAR_CUSTOMSCALETABLE])) {
|
if(g_scumm->isGlobInMemory(rtString,g_scumm->_vars[g_scumm->VAR_CUSTOMSCALETABLE])) {
|
||||||
ar->v1.scaletable = getStringAddressVar(VAR_CUSTOMSCALETABLE);
|
v1.scaletable = g_scumm->getStringAddressVar(g_scumm->VAR_CUSTOMSCALETABLE);
|
||||||
} else {
|
} else {
|
||||||
ar->v1.scaletable = default_scale_table;
|
v1.scaletable = default_scale_table;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Setup color decoding variables */
|
/* Setup color decoding variables */
|
||||||
num_colors = getResourceDataSize(ar->akpl);
|
num_colors = g_scumm->getResourceDataSize(akpl);
|
||||||
if (num_colors == 32) {
|
if (num_colors == 32) {
|
||||||
ar->v1.mask = (1 << 3) - 1;
|
v1.mask = (1 << 3) - 1;
|
||||||
ar->v1.shl = 3;
|
v1.shl = 3;
|
||||||
} else if (num_colors == 64) {
|
} else if (num_colors == 64) {
|
||||||
ar->v1.mask = (1 << 2) - 1;
|
v1.mask = (1 << 2) - 1;
|
||||||
ar->v1.shl = 2;
|
v1.shl = 2;
|
||||||
} else {
|
} else {
|
||||||
ar->v1.mask = (1 << 4) - 1;
|
v1.mask = (1 << 4) - 1;
|
||||||
ar->v1.shl = 4;
|
v1.shl = 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
use_scaling = (ar->scale_x != 0xFF) || (ar->scale_y != 0xFF);
|
use_scaling = (scale_x != 0xFF) || (scale_y != 0xFF);
|
||||||
|
|
||||||
x = ar->x;
|
cur_x = x;
|
||||||
y = ar->y;
|
cur_y = y;
|
||||||
|
|
||||||
if (use_scaling) {
|
if (use_scaling) {
|
||||||
|
|
||||||
/* Scale direction */
|
/* Scale direction */
|
||||||
ar->v1.scaleXstep = -1;
|
v1.scaleXstep = -1;
|
||||||
if (ar->move_x_cur < 0) {
|
if (move_x_cur < 0) {
|
||||||
ar->move_x_cur = -ar->move_x_cur;
|
move_x_cur = -move_x_cur;
|
||||||
ar->v1.scaleXstep = 1;
|
v1.scaleXstep = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ar->mirror) {
|
if (mirror) {
|
||||||
/* Adjust X position */
|
/* Adjust X position */
|
||||||
tmp_x = 0x180 - ar->move_x_cur;
|
tmp_x = 0x180 - move_x_cur;
|
||||||
j = tmp_x;
|
j = tmp_x;
|
||||||
for (i = 0; i < ar->move_x_cur; i++) {
|
for (i = 0; i < move_x_cur; i++) {
|
||||||
if (ar->v1.scaletable[j++] < ar->scale_x)
|
if (v1.scaletable[j++] < scale_x)
|
||||||
x -= ar->v1.scaleXstep;
|
cur_x -= v1.scaleXstep;
|
||||||
}
|
}
|
||||||
|
|
||||||
x_left = x_right = x;
|
x_left = x_right = cur_x;
|
||||||
|
|
||||||
j = tmp_x;
|
j = tmp_x;
|
||||||
for (i = 0, skip = 0; i < ar->width; i++) {
|
for (i = 0, skip = 0; i < width; i++) {
|
||||||
if (x_right < 0) {
|
if (x_right < 0) {
|
||||||
skip++;
|
skip++;
|
||||||
tmp_x = j;
|
tmp_x = j;
|
||||||
}
|
}
|
||||||
if (ar->v1.scaletable[j++] < ar->scale_x)
|
if (v1.scaletable[j++] < scale_x)
|
||||||
x_right++;
|
x_right++;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
/* No mirror */
|
/* No mirror */
|
||||||
/* Adjust X position */
|
/* Adjust X position */
|
||||||
tmp_x = 0x180 + ar->move_x_cur;
|
tmp_x = 0x180 + move_x_cur;
|
||||||
j = tmp_x;
|
j = tmp_x;
|
||||||
for (i = 0; i < ar->move_x_cur; i++) {
|
for (i = 0; i < move_x_cur; i++) {
|
||||||
if (ar->v1.scaletable[j++] < ar->scale_x)
|
if (v1.scaletable[j++] < scale_x)
|
||||||
x += ar->v1.scaleXstep;
|
cur_x += v1.scaleXstep;
|
||||||
}
|
}
|
||||||
|
|
||||||
x_left = x_right = x;
|
x_left = x_right = cur_x;
|
||||||
|
|
||||||
j = tmp_x;
|
j = tmp_x;
|
||||||
for (i = 0, skip = 0; i < ar->width; i++) {
|
for (i = 0, skip = 0; i < width; i++) {
|
||||||
if (x_left >= (int)ar->outwidth) {
|
if (x_left >= (int)outwidth) {
|
||||||
tmp_x = j;
|
tmp_x = j;
|
||||||
skip++;
|
skip++;
|
||||||
}
|
}
|
||||||
if (ar->v1.scaletable[j--] < ar->scale_x)
|
if (v1.scaletable[j--] < scale_x)
|
||||||
x_left--;
|
x_left--;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -665,226 +664,224 @@ void Scumm::akos_codec1(AkosRenderer * ar)
|
||||||
skip--;
|
skip--;
|
||||||
|
|
||||||
step = -1;
|
step = -1;
|
||||||
if (ar->move_y_cur < 0) {
|
if (move_y_cur < 0) {
|
||||||
ar->move_y_cur = -ar->move_y_cur;
|
move_y_cur = -move_y_cur;
|
||||||
step = -step;
|
step = -step;
|
||||||
}
|
}
|
||||||
|
|
||||||
tmp_y = 0x180 - ar->move_y_cur;
|
tmp_y = 0x180 - move_y_cur;
|
||||||
for (i = 0; i < ar->move_y_cur; i++) {
|
for (i = 0; i < move_y_cur; i++) {
|
||||||
if (ar->v1.scaletable[tmp_y++] < ar->scale_y)
|
if (v1.scaletable[tmp_y++] < scale_y)
|
||||||
y -= step;
|
cur_y -= step;
|
||||||
}
|
}
|
||||||
|
|
||||||
y_top = y_bottom = y;
|
y_top = y_bottom = cur_y;
|
||||||
tmp_y = 0x180 - ar->move_y_cur;
|
tmp_y = 0x180 - move_y_cur;
|
||||||
for (i = 0; i < ar->height; i++) {
|
for (i = 0; i < height; i++) {
|
||||||
if (ar->v1.scaletable[tmp_y++] < ar->scale_y)
|
if (v1.scaletable[tmp_y++] < scale_y)
|
||||||
y_bottom++;
|
y_bottom++;
|
||||||
}
|
}
|
||||||
|
|
||||||
tmp_y = 0x180 - ar->move_y_cur;
|
tmp_y = 0x180 - move_y_cur;
|
||||||
} else {
|
} else {
|
||||||
if (!ar->mirror)
|
if (!mirror)
|
||||||
ar->move_x_cur = -ar->move_x_cur;
|
move_x_cur = -move_x_cur;
|
||||||
|
|
||||||
x += ar->move_x_cur;
|
cur_x += move_x_cur;
|
||||||
y += ar->move_y_cur;
|
cur_y += move_y_cur;
|
||||||
|
|
||||||
if (ar->mirror) {
|
if (mirror) {
|
||||||
x_left = x;
|
x_left = cur_x;
|
||||||
x_right = x + ar->width;
|
x_right = cur_x + width;
|
||||||
} else {
|
} else {
|
||||||
x_right = x;
|
x_right = cur_x;
|
||||||
x_left = x - ar->width;
|
x_left = cur_x - width;
|
||||||
}
|
}
|
||||||
|
|
||||||
y_top = y;
|
y_top = cur_y;
|
||||||
y_bottom = y + ar->height;
|
y_bottom = cur_y + height;
|
||||||
|
|
||||||
tmp_x = 0x180;
|
tmp_x = 0x180;
|
||||||
tmp_y = 0x180;
|
tmp_y = 0x180;
|
||||||
}
|
}
|
||||||
|
|
||||||
ar->v1.tmp_x = tmp_x;
|
v1.tmp_x = tmp_x;
|
||||||
ar->v1.tmp_y = tmp_y;
|
v1.tmp_y = tmp_y;
|
||||||
ar->v1.skip_width = ar->width;
|
v1.skip_width = width;
|
||||||
|
|
||||||
ar->v1.scaleXstep = -1;
|
v1.scaleXstep = -1;
|
||||||
if (ar->mirror)
|
if (mirror)
|
||||||
ar->v1.scaleXstep = -ar->v1.scaleXstep;
|
v1.scaleXstep = -v1.scaleXstep;
|
||||||
|
|
||||||
if ((uint) y_top >= (uint) ar->outheight || y_bottom <= 0)
|
if ((uint) y_top >= (uint) outheight || y_bottom <= 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if ((int)x_left >= (int)ar->outwidth || x_right <= 0)
|
if ((int)x_left >= (int)outwidth || x_right <= 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
ar->v1.replen = 0;
|
v1.replen = 0;
|
||||||
ar->v1.y_pitch = ar->height * ar->outwidth;
|
v1.y_pitch = height * outwidth;
|
||||||
|
|
||||||
if (ar->mirror) {
|
if (mirror) {
|
||||||
ar->v1.y_pitch--;
|
v1.y_pitch--;
|
||||||
if (!use_scaling)
|
if (!use_scaling)
|
||||||
skip = -x;
|
skip = -cur_x;
|
||||||
if (skip > 0) {
|
if (skip > 0) {
|
||||||
ar->v1.skip_width -= skip;
|
v1.skip_width -= skip;
|
||||||
akos_codec1_ignorePakCols(ar, skip);
|
codec1_ignorePakCols(skip);
|
||||||
x = 0;
|
cur_x = 0;
|
||||||
} else {
|
} else {
|
||||||
skip = x_right - ar->outwidth;
|
skip = x_right - outwidth;
|
||||||
if (skip > 0)
|
if (skip > 0)
|
||||||
ar->v1.skip_width -= skip;
|
v1.skip_width -= skip;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
ar->v1.y_pitch++;
|
v1.y_pitch++;
|
||||||
if (!use_scaling) {
|
if (!use_scaling) {
|
||||||
skip = x_right - ar->outwidth + 1;
|
skip = x_right - outwidth + 1;
|
||||||
}
|
}
|
||||||
if (skip > 0) {
|
if (skip > 0) {
|
||||||
ar->v1.skip_width -= skip;
|
v1.skip_width -= skip;
|
||||||
akos_codec1_ignorePakCols(ar, skip);
|
codec1_ignorePakCols(skip);
|
||||||
x = ar->outwidth - 1;
|
cur_x = outwidth - 1;
|
||||||
} else {
|
} else {
|
||||||
skip = -1 - x_left;
|
skip = -1 - x_left;
|
||||||
if (skip > 0)
|
if (skip > 0)
|
||||||
ar->v1.skip_width -= skip;
|
v1.skip_width -= skip;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ar->v1.x = x;
|
v1.x = cur_x;
|
||||||
ar->v1.y = y;
|
v1.y = cur_y;
|
||||||
|
|
||||||
if (ar->v1.skip_width <= 0 || ar->height <= 0)
|
if (v1.skip_width <= 0 || height <= 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
updateDirtyRect(0, x_left, x_right, y_top, y_bottom, 1 << ar->dirty_id);
|
g_scumm->updateDirtyRect(0, x_left, x_right, y_top, y_bottom, 1 << dirty_id);
|
||||||
|
|
||||||
y_clipping = ((uint) y_bottom > ar->outheight || y_top < 0);
|
y_clipping = ((uint) y_bottom > outheight || y_top < 0);
|
||||||
|
|
||||||
if ((uint) y_top > (uint) ar->outheight)
|
if ((uint) y_top > (uint) outheight)
|
||||||
y_top = 0;
|
y_top = 0;
|
||||||
|
|
||||||
if ((uint) y_bottom > (uint) ar->outheight)
|
if ((uint) y_bottom > (uint) outheight)
|
||||||
y_bottom = ar->outheight;
|
y_bottom = outheight;
|
||||||
|
|
||||||
if (y_top < ar->draw_top)
|
if (y_top < draw_top)
|
||||||
ar->draw_top = y_top;
|
draw_top = y_top;
|
||||||
if (y_bottom > ar->draw_bottom)
|
if (y_bottom > draw_bottom)
|
||||||
ar->draw_bottom = y_bottom;
|
draw_bottom = y_bottom;
|
||||||
|
|
||||||
if (x == -1)
|
if (cur_x == -1)
|
||||||
x = 0; /* ?? */
|
cur_x = 0; /* ?? */
|
||||||
|
|
||||||
ar->v1.destptr = ar->outptr + x + y * ar->outwidth;
|
v1.destptr = outptr + cur_x + cur_y * outwidth;
|
||||||
|
|
||||||
charsetmask = ar->charsetmask;
|
|
||||||
masking = false;
|
masking = false;
|
||||||
if (ar->clipping) {
|
if (clipping) {
|
||||||
masking = isMaskActiveAt(x_left, y_top, x_right, y_bottom,
|
masking = g_scumm->isMaskActiveAt(x_left, y_top, x_right, y_bottom,
|
||||||
getResourceAddress(rtBuffer,
|
g_scumm->getResourceAddress(rtBuffer, 9) +
|
||||||
9) +
|
g_scumm->gdi._imgBufOffs[clipping] +
|
||||||
gdi._imgBufOffs[ar->clipping] +
|
g_scumm->_screenStartStrip) != 0;
|
||||||
_screenStartStrip) != 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ar->v1.mask_ptr = NULL;
|
v1.mask_ptr = NULL;
|
||||||
|
|
||||||
if (masking || charsetmask || ar->shadow_mode) {
|
if (masking || charsetmask || shadow_mode) {
|
||||||
ar->v1.mask_ptr =
|
v1.mask_ptr =
|
||||||
getResourceAddress(rtBuffer, 9) + y * 40 + _screenStartStrip;
|
g_scumm->getResourceAddress(rtBuffer, 9) + cur_y * 40 + g_scumm->_screenStartStrip;
|
||||||
ar->v1.imgbufoffs = gdi._imgBufOffs[ar->clipping];
|
v1.imgbufoffs = g_scumm->gdi._imgBufOffs[clipping];
|
||||||
if (!charsetmask && masking) {
|
if (!charsetmask && masking) {
|
||||||
ar->v1.mask_ptr += ar->v1.imgbufoffs;
|
v1.mask_ptr += v1.imgbufoffs;
|
||||||
ar->v1.imgbufoffs = 0;
|
v1.imgbufoffs = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (ar->shadow_mode) {
|
switch (shadow_mode) {
|
||||||
case 1:
|
case 1:
|
||||||
akos_c1_spec1(ar);
|
akos_c1_spec1(this);
|
||||||
return;
|
return;
|
||||||
case 2:
|
case 2:
|
||||||
// akos_c1_spec2(ar);
|
// akos_c1_spec2(this);
|
||||||
warning("akos_c1_spec2");
|
warning("akos_c1_spec2");
|
||||||
return;
|
return;
|
||||||
case 3:
|
case 3:
|
||||||
// akos_c1_spec3(ar);
|
// akos_c1_spec3(this);
|
||||||
warning("akos_c1_spec3");
|
warning("akos_c1_spec3");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
akos_generic_decode(ar);
|
akos_generic_decode(this);
|
||||||
|
|
||||||
// akos_c1_0y_decode(ar);
|
// akos_c1_0y_decode(this);
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
|
|
||||||
switch (((byte)y_clipping << 3) | ((byte)use_scaling << 2) |
|
switch (((byte)y_clipping << 3) | ((byte)use_scaling << 2) |
|
||||||
((byte)masking << 1) | (byte)charsetmask) {
|
((byte)masking << 1) | (byte)charsetmask) {
|
||||||
case 0:
|
case 0:
|
||||||
akos_c1_0_decode(ar);
|
akos_c1_0_decode(this);
|
||||||
break;
|
break;
|
||||||
case 0 + 8:
|
case 0 + 8:
|
||||||
akos_c1_0y_decode(ar);
|
akos_c1_0y_decode(this);
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
case 1:
|
case 1:
|
||||||
akos_c1_12_decode(ar);
|
akos_c1_12_decode(this);
|
||||||
break;
|
break;
|
||||||
case 2 + 8:
|
case 2 + 8:
|
||||||
case 1 + 8:
|
case 1 + 8:
|
||||||
akos_c1_12y_decode(ar);
|
akos_c1_12y_decode(this);
|
||||||
break;
|
break;
|
||||||
case 3 + 8:
|
case 3 + 8:
|
||||||
case 3:
|
case 3:
|
||||||
akos_c1_3_decode(ar);
|
akos_c1_3_decode(this);
|
||||||
break;
|
break;
|
||||||
case 4:
|
case 4:
|
||||||
akos_c1_4_decode(ar);
|
akos_c1_4_decode(this);
|
||||||
break;
|
break;
|
||||||
case 4 + 8:
|
case 4 + 8:
|
||||||
akos_c1_4y_decode(ar);
|
akos_c1_4y_decode(this);
|
||||||
break;
|
break;
|
||||||
case 6:
|
case 6:
|
||||||
case 5:
|
case 5:
|
||||||
akos_c1_56_decode(ar);
|
akos_c1_56_decode(this);
|
||||||
break;
|
break;
|
||||||
case 6 + 8:
|
case 6 + 8:
|
||||||
case 5 + 8:
|
case 5 + 8:
|
||||||
akos_c1_56y_decode(ar);
|
akos_c1_56y_decode(this);
|
||||||
break;
|
break;
|
||||||
case 7:
|
case 7:
|
||||||
case 7 + 8:
|
case 7 + 8:
|
||||||
akos_c1_7_decode(ar);
|
akos_c1_7_decode(this);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void Scumm::akos_codec1_ignorePakCols(AkosRenderer * ar, int num)
|
void AkosRenderer::codec1_ignorePakCols(int num)
|
||||||
{
|
{
|
||||||
int n;
|
int n;
|
||||||
byte repcolor;
|
byte repcolor;
|
||||||
byte replen;
|
byte replen;
|
||||||
byte *src;
|
byte *src;
|
||||||
|
|
||||||
n = ar->height;
|
n = height;
|
||||||
if (num > 1)
|
if (num > 1)
|
||||||
n *= num;
|
n *= num;
|
||||||
src = ar->srcptr;
|
src = srcptr;
|
||||||
do {
|
do {
|
||||||
repcolor = *src++;
|
repcolor = *src++;
|
||||||
replen = repcolor & ar->v1.mask;
|
replen = repcolor & v1.mask;
|
||||||
if (replen == 0) {
|
if (replen == 0) {
|
||||||
replen = *src++;
|
replen = *src++;
|
||||||
}
|
}
|
||||||
do {
|
do {
|
||||||
if (!--n) {
|
if (!--n) {
|
||||||
ar->v1.repcolor = repcolor >> ar->v1.shl;
|
v1.repcolor = repcolor >> v1.shl;
|
||||||
ar->v1.replen = replen;
|
v1.replen = replen;
|
||||||
ar->srcptr = src;
|
srcptr = src;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
} while (--replen);
|
} while (--replen);
|
||||||
|
@ -892,13 +889,11 @@ void Scumm::akos_codec1_ignorePakCols(AkosRenderer * ar, int num)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void Scumm::akos_codec5(AkosRenderer * ar)
|
void AkosRenderer::codec5()
|
||||||
{
|
{
|
||||||
|
|
||||||
VirtScreen *vs;
|
VirtScreen *vs;
|
||||||
BompDrawData bdd;
|
BompDrawData bdd;
|
||||||
|
|
||||||
int mirror;
|
|
||||||
int moveX;
|
int moveX;
|
||||||
int moveY;
|
int moveY;
|
||||||
int left;
|
int left;
|
||||||
|
@ -909,50 +904,49 @@ void Scumm::akos_codec5(AkosRenderer * ar)
|
||||||
int top;
|
int top;
|
||||||
int bottom;
|
int bottom;
|
||||||
|
|
||||||
vs = &virtscr[0];
|
vs = &g_scumm->virtscr[0];
|
||||||
//setBlastObjectMode(ar->shadow_mode); // not implemented yet
|
//setBlastObjectMode(shadow_mode); // not implemented yet
|
||||||
mirror = ar->mirror;
|
moveX=move_x_cur;
|
||||||
moveX=ar->move_x_cur;
|
moveY=move_y_cur;
|
||||||
moveY=ar->move_y_cur;
|
|
||||||
|
|
||||||
if (!mirror) {
|
if (!mirror) {
|
||||||
left = (ar->x - moveX - ar->width) + 1;
|
left = (x - moveX - width) + 1;
|
||||||
} else {
|
} else {
|
||||||
left = ar->x + moveX -1;
|
left = x + moveX -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
var_20=0;
|
var_20=0;
|
||||||
max_width = ar->outwidth;
|
max_width = outwidth;
|
||||||
|
|
||||||
right = left + ar->width - 1;
|
right = left + width - 1;
|
||||||
top = ar->y + moveY;
|
top = y + moveY;
|
||||||
bottom = top + ar->height;
|
bottom = top + height;
|
||||||
|
|
||||||
if(left < 0)
|
if(left < 0)
|
||||||
left = 0;
|
left = 0;
|
||||||
if(left > max_width)
|
if(left > max_width)
|
||||||
left -= left - max_width;
|
left -= left - max_width;
|
||||||
|
|
||||||
ar->draw_top = 0;
|
draw_top = 0;
|
||||||
ar->draw_bottom = 200;
|
draw_bottom = 200;
|
||||||
|
|
||||||
updateDirtyRect(0, left, right+1, top, bottom+1, 1 << ar->dirty_id);
|
g_scumm->updateDirtyRect(0, left, right+1, top, bottom+1, 1 << dirty_id);
|
||||||
|
|
||||||
bdd.dataptr = ar->srcptr;
|
bdd.dataptr = srcptr;
|
||||||
bdd.out = vs->screenPtr;
|
bdd.out = vs->screenPtr;
|
||||||
bdd.outheight = ar->outheight;
|
bdd.outheight = outheight;
|
||||||
bdd.outwidth = ar->outwidth;
|
bdd.outwidth = outwidth;
|
||||||
bdd.scale_x = 0xFF;
|
bdd.scale_x = 0xFF;
|
||||||
bdd.scale_y = 0xFF;
|
bdd.scale_y = 0xFF;
|
||||||
bdd.srcheight = ar->height;
|
bdd.srcheight = height;
|
||||||
bdd.srcwidth = ar->width;
|
bdd.srcwidth = width;
|
||||||
bdd.x = left+1;
|
bdd.x = left+1;
|
||||||
bdd.y = top;
|
bdd.y = top;
|
||||||
|
|
||||||
drawBomp(&bdd,0,bdd.dataptr,0,0);
|
g_scumm->drawBomp(&bdd,0,bdd.dataptr,0,0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Scumm::akos_codec16(AkosRenderer * ar)
|
void AkosRenderer::codec16()
|
||||||
{
|
{
|
||||||
warning("akos_codec16: not implemented");
|
warning("akos_codec16: not implemented");
|
||||||
}
|
}
|
||||||
|
@ -1087,12 +1081,12 @@ bool Scumm::akos_increaseAnim(Actor * a, int chan, byte *aksq, uint16 *akfo,
|
||||||
|
|
||||||
switch (code) {
|
switch (code) {
|
||||||
case AKC_StartAnimInActor:
|
case AKC_StartAnimInActor:
|
||||||
akos_queCommand(4, derefActorSafe(getAnimVar(a, GB(2)),
|
akos_queCommand(4, derefActorSafe(a->getAnimVar(GB(2)),
|
||||||
"akos_increaseAnim:29"), getAnimVar(a, GB(3)), 0);
|
"akos_increaseAnim:29"), a->getAnimVar(GB(3)), 0);
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
case AKC_Random:
|
case AKC_Random:
|
||||||
setAnimVar(a, GB(6), getRandomNumberRng(GW(2), GW(4)));
|
a->setAnimVar(GB(6), getRandomNumberRng(GW(2), GW(4)));
|
||||||
continue;
|
continue;
|
||||||
case AKC_SkipGE:
|
case AKC_SkipGE:
|
||||||
case AKC_SkipG:
|
case AKC_SkipG:
|
||||||
|
@ -1100,17 +1094,17 @@ bool Scumm::akos_increaseAnim(Actor * a, int chan, byte *aksq, uint16 *akfo,
|
||||||
case AKC_SkipL:
|
case AKC_SkipL:
|
||||||
case AKC_SkipNE:
|
case AKC_SkipNE:
|
||||||
case AKC_SkipE:
|
case AKC_SkipE:
|
||||||
if (!akos_compare(getAnimVar(a, GB(4)), GW(2), code - AKC_SkipStart))
|
if (!akos_compare(a->getAnimVar(GB(4)), GW(2), code - AKC_SkipStart))
|
||||||
flag_value = true;
|
flag_value = true;
|
||||||
continue;
|
continue;
|
||||||
case AKC_IncVar:
|
case AKC_IncVar:
|
||||||
setAnimVar(a, 0, getAnimVar(a, 0) + 1);
|
a->setAnimVar(0, a->getAnimVar(0) + 1);
|
||||||
continue;
|
continue;
|
||||||
case AKC_SetVar:
|
case AKC_SetVar:
|
||||||
setAnimVar(a, GB(4), GW(2));
|
a->setAnimVar(GB(4), GW(2));
|
||||||
continue;
|
continue;
|
||||||
case AKC_AddVar:
|
case AKC_AddVar:
|
||||||
setAnimVar(a, GB(4), getAnimVar(a, GB(4)) + GW(2));
|
a->setAnimVar(GB(4), a->getAnimVar(GB(4)) + GW(2));
|
||||||
continue;
|
continue;
|
||||||
case AKC_Flip:
|
case AKC_Flip:
|
||||||
a->flip = GW(2) != 0;
|
a->flip = GW(2) != 0;
|
||||||
|
@ -1127,10 +1121,10 @@ bool Scumm::akos_increaseAnim(Actor * a, int chan, byte *aksq, uint16 *akfo,
|
||||||
akos_queCommand(4, a, GB(2), 0);
|
akos_queCommand(4, a, GB(2), 0);
|
||||||
continue;
|
continue;
|
||||||
case AKC_StartVarAnim:
|
case AKC_StartVarAnim:
|
||||||
akos_queCommand(4, a, getAnimVar(a, GB(2)), 0);
|
akos_queCommand(4, a, a->getAnimVar(GB(2)), 0);
|
||||||
continue;
|
continue;
|
||||||
case AKC_SetVarInActor:
|
case AKC_SetVarInActor:
|
||||||
setAnimVar(derefActorSafe(getAnimVar(a, GB(2)), "akos_increaseAnim:9"),
|
derefActorSafe(a->getAnimVar(GB(2)), "akos_increaseAnim:9")->setAnimVar(
|
||||||
GB(3), GW(4)
|
GB(3), GW(4)
|
||||||
);
|
);
|
||||||
continue;
|
continue;
|
||||||
|
@ -1155,15 +1149,15 @@ bool Scumm::akos_increaseAnim(Actor * a, int chan, byte *aksq, uint16 *akfo,
|
||||||
case AKC_JumpTable:
|
case AKC_JumpTable:
|
||||||
if (akfo == NULL)
|
if (akfo == NULL)
|
||||||
error("akos_increaseAnim: no AKFO table");
|
error("akos_increaseAnim: no AKFO table");
|
||||||
tmp = getAnimVar(a, GB(2)) - 1;
|
tmp = a->getAnimVar(GB(2)) - 1;
|
||||||
if (tmp < 0 || tmp >= numakfo - 1)
|
if (tmp < 0 || tmp >= numakfo - 1)
|
||||||
error("akos_increaseAnim: invalid jump value %d", tmp);
|
error("akos_increaseAnim: invalid jump value %d", tmp);
|
||||||
curpos = READ_LE_UINT16(&akfo[tmp]);
|
curpos = READ_LE_UINT16(&akfo[tmp]);
|
||||||
break;
|
break;
|
||||||
case AKC_JumpIfSet:
|
case AKC_JumpIfSet:
|
||||||
if (!getAnimVar(a, GB(4)))
|
if (!a->getAnimVar(GB(4)))
|
||||||
continue;
|
continue;
|
||||||
setAnimVar(a, GB(4), 0);
|
a->setAnimVar(GB(4), 0);
|
||||||
curpos = GUW(2);
|
curpos = GUW(2);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -1190,7 +1184,7 @@ bool Scumm::akos_increaseAnim(Actor * a, int chan, byte *aksq, uint16 *akfo,
|
||||||
case AKC_JumpLE:
|
case AKC_JumpLE:
|
||||||
case AKC_JumpG:
|
case AKC_JumpG:
|
||||||
case AKC_JumpGE:
|
case AKC_JumpGE:
|
||||||
if (!akos_compare(getAnimVar(a, GB(4)), GW(2), code - AKC_JumpStart))
|
if (!akos_compare(a->getAnimVar(GB(4)), GW(2), code - AKC_JumpStart))
|
||||||
continue;
|
continue;
|
||||||
curpos = GUW(2);
|
curpos = GUW(2);
|
||||||
break;
|
break;
|
||||||
|
@ -1236,13 +1230,3 @@ bool Scumm::akos_compare(int a, int b, byte cmd)
|
||||||
return a >= b;
|
return a >= b;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int Scumm::getAnimVar(Actor * a, byte var)
|
|
||||||
{
|
|
||||||
return a->animVariable[var];
|
|
||||||
}
|
|
||||||
|
|
||||||
void Scumm::setAnimVar(Actor * a, byte var, int value)
|
|
||||||
{
|
|
||||||
a->animVariable[var] = value;
|
|
||||||
}
|
|
||||||
|
|
13
akos.h
13
akos.h
|
@ -53,6 +53,7 @@ struct AkosCI {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
struct AkosRenderer {
|
struct AkosRenderer {
|
||||||
|
//protected:
|
||||||
CostumeData *cd;
|
CostumeData *cd;
|
||||||
int x,y; /* where to draw costume */
|
int x,y; /* where to draw costume */
|
||||||
byte scale_x, scale_y; /* scaling */
|
byte scale_x, scale_y; /* scaling */
|
||||||
|
@ -104,6 +105,18 @@ struct AkosRenderer {
|
||||||
|
|
||||||
byte palette[256];
|
byte palette[256];
|
||||||
|
|
||||||
|
public:
|
||||||
|
bool drawCostume();
|
||||||
|
void setPalette(byte *palette);
|
||||||
|
void setCostume(int costume);
|
||||||
|
void setFacing(Actor *a);
|
||||||
|
bool drawCostumeChannel(int chan);
|
||||||
|
void codec1();
|
||||||
|
void codec5();
|
||||||
|
void codec16();
|
||||||
|
void codec1_ignorePakCols(int num);
|
||||||
|
void c1_spec2();
|
||||||
|
void c1_spec3();
|
||||||
};
|
};
|
||||||
|
|
||||||
enum AkosOpcodes{
|
enum AkosOpcodes{
|
||||||
|
|
30
costume.cpp
30
costume.cpp
|
@ -825,18 +825,6 @@ void CostumeRenderer::loadCostume(int id)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void Scumm::initActorCostumeData(Actor * a)
|
|
||||||
{
|
|
||||||
CostumeData *cd = &a->cost;
|
|
||||||
int i;
|
|
||||||
|
|
||||||
cd->stopped = 0;
|
|
||||||
for (i = 0; i < 16; i++) {
|
|
||||||
cd->active[i] = 0;
|
|
||||||
cd->curpos[i] = cd->start[i] = cd->end[i] = cd->frame[i] = 0xFFFF;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
byte CostumeRenderer::drawOneSlot(Actor * a, int slot)
|
byte CostumeRenderer::drawOneSlot(Actor * a, int slot)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
@ -988,28 +976,28 @@ void Scumm::cost_decodeData(Actor * a, int frame, uint usemask)
|
||||||
} while ((uint16)mask);
|
} while ((uint16)mask);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Scumm::cost_setPalette(CostumeRenderer * cr, byte *palette)
|
void CostumeRenderer::setPalette(byte *palette)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
byte color;
|
byte color;
|
||||||
|
|
||||||
for (i = 0; i < cr->_loaded._numColors; i++) {
|
for (i = 0; i < _loaded._numColors; i++) {
|
||||||
color = palette[i];
|
color = palette[i];
|
||||||
if (color == 255)
|
if (color == 255)
|
||||||
color = cr->_loaded._ptr[8 + i];
|
color = _loaded._ptr[8 + i];
|
||||||
cr->_palette[i] = color;
|
_palette[i] = color;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Scumm::cost_setFacing(CostumeRenderer * cr, Actor * a)
|
void CostumeRenderer::setFacing(uint16 facing)
|
||||||
{
|
{
|
||||||
cr->_mirror = newDirToOldDir(a->facing) != 0
|
_mirror = _vm->newDirToOldDir(facing) != 0
|
||||||
|| (cr->_loaded._ptr[7] & 0x80);
|
|| (_loaded._ptr[7] & 0x80);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Scumm::cost_setCostume(CostumeRenderer * cr, int costume)
|
void CostumeRenderer::setCostume(int costume)
|
||||||
{
|
{
|
||||||
loadCostume(&cr->_loaded, costume);
|
_vm->loadCostume(&_loaded, costume);
|
||||||
}
|
}
|
||||||
|
|
||||||
byte Scumm::cost_increaseAnims(LoadedCostume * lc, Actor * a)
|
byte Scumm::cost_increaseAnims(LoadedCostume * lc, Actor * a)
|
||||||
|
|
|
@ -2024,7 +2024,7 @@ void Scumm::o6_actorSet()
|
||||||
break;
|
break;
|
||||||
case 198: /* set anim variable */
|
case 198: /* set anim variable */
|
||||||
i = pop(); /* value */
|
i = pop(); /* value */
|
||||||
setAnimVar(a, pop(), i);
|
a->setAnimVar(pop(), i);
|
||||||
break;
|
break;
|
||||||
case 215:
|
case 215:
|
||||||
a->new_3 = 1;
|
a->new_3 = 1;
|
||||||
|
@ -2405,7 +2405,7 @@ void Scumm::o6_getActorAnimCounter1()
|
||||||
void Scumm::o6_getAnimateVariable()
|
void Scumm::o6_getAnimateVariable()
|
||||||
{
|
{
|
||||||
int var = pop();
|
int var = pop();
|
||||||
push(getAnimVar(derefActorSafe(pop(), "o6_getAnimateVariable"), var));
|
push(derefActorSafe(pop(), "o6_getAnimateVariable")->getAnimVar(var));
|
||||||
}
|
}
|
||||||
|
|
||||||
void Scumm::o6_soundKludge()
|
void Scumm::o6_soundKludge()
|
||||||
|
|
48
scumm.h
48
scumm.h
|
@ -412,6 +412,9 @@ struct CostumeRenderer {
|
||||||
byte drawOneSlot(Actor *a, int slot);
|
byte drawOneSlot(Actor *a, int slot);
|
||||||
byte drawCostume(Actor *a);
|
byte drawCostume(Actor *a);
|
||||||
|
|
||||||
|
void setPalette(byte *palette);
|
||||||
|
void setFacing(uint16 facing);
|
||||||
|
void setCostume(int costume);
|
||||||
};
|
};
|
||||||
|
|
||||||
#define ARRAY_HDR_SIZE 6
|
#define ARRAY_HDR_SIZE 6
|
||||||
|
@ -868,9 +871,9 @@ public:
|
||||||
|
|
||||||
/* Should be in Costume class */
|
/* Should be in Costume class */
|
||||||
void loadCostume(LoadedCostume *lc, int costume);
|
void loadCostume(LoadedCostume *lc, int costume);
|
||||||
void cost_setPalette(CostumeRenderer *cr, byte *palette);
|
// void cost_setPalette(CostumeRenderer *cr, byte *palette);
|
||||||
void cost_setFacing(CostumeRenderer *cr, Actor *a);
|
// void cost_setFacing(CostumeRenderer *cr, Actor *a);
|
||||||
void cost_setCostume(CostumeRenderer *cr, int costume);
|
// void cost_setCostume(CostumeRenderer *cr, int costume);
|
||||||
byte cost_increaseAnims(LoadedCostume *lc, Actor *a);
|
byte cost_increaseAnims(LoadedCostume *lc, Actor *a);
|
||||||
byte cost_increaseAnim(LoadedCostume *lc, Actor *a, int slot);
|
byte cost_increaseAnim(LoadedCostume *lc, Actor *a, int slot);
|
||||||
void cost_decodeData(Actor *a, int frame, uint usemask);
|
void cost_decodeData(Actor *a, int frame, uint usemask);
|
||||||
|
@ -985,21 +988,9 @@ public:
|
||||||
Actor *derefActorSafe(int id, const char *errmsg);
|
Actor *derefActorSafe(int id, const char *errmsg);
|
||||||
Actor *getFirstActor() {return actor;}
|
Actor *getFirstActor() {return actor;}
|
||||||
void putActor(Actor *a, int x, int y, byte room);
|
void putActor(Actor *a, int x, int y, byte room);
|
||||||
// void hideActor(Actor *a);
|
|
||||||
// void showActor(Actor *a);
|
|
||||||
void showActors();
|
void showActors();
|
||||||
|
|
||||||
// void initActor(Actor *a, int mode);
|
|
||||||
// void setActorWalkSpeed(Actor *a, uint speed1, uint speed2);
|
|
||||||
// int calcMovementFactor(Actor *a, int newx, int newy);
|
|
||||||
// int actorWalkStep(Actor *a);
|
|
||||||
// int remapDirection(Actor *a, int dir);
|
|
||||||
// void setupActorScale(Actor *a);
|
|
||||||
// void stopActorMoving(Actor *a);
|
|
||||||
uint32 *_classData;
|
uint32 *_classData;
|
||||||
// void startWalkAnim(Actor *a, int cmd, int angle);
|
|
||||||
// void startAnimActor(Actor *a, int frame);
|
|
||||||
// void setActorBox(Actor *a, int box);
|
|
||||||
|
|
||||||
int newDirToOldDir(int dir);
|
int newDirToOldDir(int dir);
|
||||||
int oldDirToNewDir(int dir);
|
int oldDirToNewDir(int dir);
|
||||||
|
@ -1009,34 +1000,21 @@ public:
|
||||||
static int fromSimpleDir(int dirtype, int dir);
|
static int fromSimpleDir(int dirtype, int dir);
|
||||||
static int toSimpleDir(int dirtype, int dir);
|
static int toSimpleDir(int dirtype, int dir);
|
||||||
static int numSimpleDirDirections(int dirType);
|
static int numSimpleDirDirections(int dirType);
|
||||||
// int updateActorDirection(Actor *a);
|
|
||||||
void startAnimActorEx(Actor *a, int frame, int direction);
|
void startAnimActorEx(Actor *a, int frame, int direction);
|
||||||
int getProgrDirChange(Actor *a, int mode);
|
int getProgrDirChange(Actor *a, int mode);
|
||||||
void initActorCostumeData(Actor *a);
|
|
||||||
// void setActorDirection(Actor *a, int direction);
|
|
||||||
|
|
||||||
int getActorXYPos(Actor *a);
|
int getActorXYPos(Actor *a);
|
||||||
// void adjustActorPos(Actor *a);
|
|
||||||
// void turnToDirection(Actor *a, int newdir);
|
|
||||||
AdjustBoxResult adjustXYToBeInBox(Actor *a, int x, int y, int pathfrom);
|
AdjustBoxResult adjustXYToBeInBox(Actor *a, int x, int y, int pathfrom);
|
||||||
void walkActors();
|
void walkActors();
|
||||||
void playActorSounds();
|
void playActorSounds();
|
||||||
// void walkActor(Actor *a);
|
|
||||||
void setActorRedrawFlags();
|
void setActorRedrawFlags();
|
||||||
void resetActorBgs();
|
void resetActorBgs();
|
||||||
void processActors();
|
void processActors();
|
||||||
void drawActorCostume(Actor *a);
|
|
||||||
void actorAnimate(Actor *a);
|
|
||||||
int getActorFromPos(int x, int y);
|
int getActorFromPos(int x, int y);
|
||||||
// void setActorCostume(Actor *a, int c);
|
|
||||||
// byte *getActorName(Actor *a);
|
|
||||||
void faceActorToObj(int act, int obj);
|
void faceActorToObj(int act, int obj);
|
||||||
void animateActor(int act, int anim);
|
void animateActor(int act, int anim);
|
||||||
void actorFollowCamera(int act);
|
void actorFollowCamera(int act);
|
||||||
// void startWalkActor(Actor *a, int x, int y, int dir);
|
|
||||||
|
|
||||||
// void remapActor(Actor *a, int b, int c, int d, int e);
|
|
||||||
// void walkActorOld(Actor *a);
|
|
||||||
bool isCostumeInUse(int i);
|
bool isCostumeInUse(int i);
|
||||||
|
|
||||||
/* Actor talking stuff */
|
/* Actor talking stuff */
|
||||||
|
@ -1048,24 +1026,10 @@ public:
|
||||||
void stopTalk();
|
void stopTalk();
|
||||||
|
|
||||||
/* Akos Class */
|
/* Akos Class */
|
||||||
bool akos_drawCostume(AkosRenderer *ar);
|
|
||||||
void akos_setPalette(AkosRenderer *ar, byte *palette);
|
|
||||||
void akos_setCostume(AkosRenderer *ar, int costume);
|
|
||||||
void akos_setFacing(AkosRenderer *ar, Actor *a);
|
|
||||||
bool akos_drawCostumeChannel(AkosRenderer *ar, int chan);
|
|
||||||
void akos_codec1(AkosRenderer *ar);
|
|
||||||
void akos_codec5(AkosRenderer *ar);
|
|
||||||
void akos_codec16(AkosRenderer *ar);
|
|
||||||
void akos_codec1_ignorePakCols(AkosRenderer *ar, int num);
|
|
||||||
void akos_c1_spec2(AkosRenderer *ar);
|
|
||||||
void akos_c1_spec3(AkosRenderer *ar);
|
|
||||||
|
|
||||||
bool akos_increaseAnims(byte *akos, Actor *a);
|
bool akos_increaseAnims(byte *akos, Actor *a);
|
||||||
bool akos_increaseAnim(Actor *a, int i, byte *aksq, uint16 *akfo, int numakfo);
|
bool akos_increaseAnim(Actor *a, int i, byte *aksq, uint16 *akfo, int numakfo);
|
||||||
|
|
||||||
int getAnimVar(Actor *a, byte var);
|
|
||||||
void setAnimVar(Actor *a, byte var, int value);
|
|
||||||
|
|
||||||
void akos_queCommand(byte cmd, Actor *a, int param_1, int param_2);
|
void akos_queCommand(byte cmd, Actor *a, int param_1, int param_2);
|
||||||
bool akos_compare(int a, int b, byte cmd);
|
bool akos_compare(int a, int b, byte cmd);
|
||||||
void akos_decodeData(Actor *a, int frame, uint usemask);
|
void akos_decodeData(Actor *a, int frame, uint usemask);
|
||||||
|
|
|
@ -411,7 +411,6 @@ void Scumm::startScene(int room, Actor * a, int objectNr)
|
||||||
stopCycle(0);
|
stopCycle(0);
|
||||||
|
|
||||||
for (i = 1, at = getFirstActor(); ++at, i < NUM_ACTORS; i++) {
|
for (i = 1, at = getFirstActor(); ++at, i < NUM_ACTORS; i++) {
|
||||||
if (at->visible)
|
|
||||||
at->hideActor();
|
at->hideActor();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -455,7 +454,6 @@ void Scumm::startScene(int room, Actor * a, int objectNr)
|
||||||
if (!(_features & GF_AFTER_V7)) {
|
if (!(_features & GF_AFTER_V7)) {
|
||||||
camera._mode = CM_NORMAL;
|
camera._mode = CM_NORMAL;
|
||||||
camera._cur.x = camera._dest.x = 160;
|
camera._cur.x = camera._dest.x = 160;
|
||||||
|
|
||||||
camera._cur.y = camera._dest.y = 100;
|
camera._cur.y = camera._dest.y = 100;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1085,8 +1083,8 @@ int Scumm::toSimpleDir(int dirType, int dir)
|
||||||
int Scumm::fromSimpleDir(int dirType, int dir)
|
int Scumm::fromSimpleDir(int dirType, int dir)
|
||||||
{
|
{
|
||||||
if (!dirType)
|
if (!dirType)
|
||||||
dir += dir;
|
return dir * 90;
|
||||||
|
else
|
||||||
return dir * 45;
|
return dir * 45;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue