[Scummvm-cvs-logs] CVS: scummvm scummvm.cpp,1.159,1.160 actor.cpp,1.72,1.73 actor.h,1.5,1.6 scumm.h,1.167,1.168 costume.cpp,1.33,1.34 akos.cpp,1.19,1.20 akos.h,1.7,1.8 script_v2.cpp,1.65,1.66

Max Horn fingolfin at users.sourceforge.net
Wed May 22 17:38:01 CEST 2002


Update of /cvsroot/scummvm/scummvm
In directory usw-pr-cvs1:/tmp/cvs-serv4950

Modified Files:
	scummvm.cpp actor.cpp actor.h scumm.h costume.cpp akos.cpp 
	akos.h script_v2.cpp 
Log Message:
moved more stuff out of the Scumm class (usage of g_scumm is only temporary, Endy, no worries <g>); some other cleanup

Index: scummvm.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scummvm.cpp,v
retrieving revision 1.159
retrieving revision 1.160
diff -u -d -r1.159 -r1.160
--- scummvm.cpp	22 May 2002 12:24:48 -0000	1.159
+++ scummvm.cpp	23 May 2002 00:37:00 -0000	1.160
@@ -411,8 +411,7 @@
 	stopCycle(0);
 
 	for (i = 1, at = getFirstActor(); ++at, i < NUM_ACTORS; i++) {
-		if (at->visible)
-			at->hideActor();
+		at->hideActor();
 	}
 
 	if (!(_features & GF_AFTER_V7)) {
@@ -455,7 +454,6 @@
 	if (!(_features & GF_AFTER_V7)) {
 		camera._mode = CM_NORMAL;
 		camera._cur.x = camera._dest.x = 160;
-
 		camera._cur.y = camera._dest.y = 100;
 	}
 
@@ -1085,9 +1083,9 @@
 int Scumm::fromSimpleDir(int dirType, int dir)
 {
 	if (!dirType)
-		dir += dir;
-
-	return dir * 45;
+		return dir * 90;
+	else
+		return dir * 45;
 }
 
 

Index: actor.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/actor.cpp,v
retrieving revision 1.72
retrieving revision 1.73
diff -u -d -r1.72 -r1.73
--- actor.cpp	22 May 2002 12:35:17 -0000	1.72
+++ actor.cpp	23 May 2002 00:37:00 -0000	1.73
@@ -411,7 +411,7 @@
 			needRedraw = true;
 			needBgReset = true;
 			if (frame == initFrame)
-				_scumm->initActorCostumeData(this);
+				cost.reset();
 			_scumm->akos_decodeData(this, frame, (uint) - 1);
 		}
 
@@ -440,7 +440,7 @@
 			needRedraw = true;
 
 			if (initFrame == frame)
-				_scumm->initActorCostumeData(this);
+				cost.reset();
 
 			if (frame != 0x3E) {
 				_scumm->cost_decodeData(this, frame, (uint) - 1);
@@ -652,6 +652,8 @@
 	if (!visible)
 		return;
 
+	debug(1, "hideActor %d", (int)number);
+
 	if (moving) {
 		startAnimActor(standFrame);
 		moving = 0;
@@ -667,6 +669,8 @@
 	if (_scumm->_currentRoom == 0 || visible)
 		return;
 
+	debug(1, "showActor %d", (int)number);
+
 	adjustActorPos();
 
 	_scumm->ensureResourceLoaded(rtCostume, costume);
@@ -937,136 +941,135 @@
 		a = *ac;
 		if (a->costume) {
 			CHECK_HEAP getMaskFromBox(a->walkbox);
-			drawActorCostume(a);
-			CHECK_HEAP actorAnimate(a);
+			a->drawActorCostume();
+			CHECK_HEAP a->actorAnimate();
 		}
 	} while (ac++, --cnt);
 }
 
-void Scumm::drawActorCostume(Actor * a)
+void Actor::drawActorCostume()
 {
-	if (!(_features & GF_AFTER_V7)) {
+	if (!(_scumm->_features & GF_AFTER_V7)) {
 		CostumeRenderer cr;
 
-		if (a == NULL || !a->needRedraw)
+		if (!needRedraw)
 			return;
 		
-		if (getClass(a->number, 20))
-			a->mask = 0;
-		else if (getClass(a->number, 21))
-			a->forceClip = 1;
+		if (_scumm->getClass(number, 20))
+			mask = 0;
+		else if (_scumm->getClass(number, 21))
+			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;
 
-		a->needRedraw = false;
+		needRedraw = false;
 
-		a->setupActorScale();
+		setupActorScale();
 
 		/* First, zero initialize all fields */
 		memset(&cr, 0, sizeof(cr));
 
-		cr._actorX = a->x - virtscr->xstart;
-		cr._actorY = a->y - a->elevation;
-		cr._scaleX = a->scalex;
-		cr._scaleY = a->scaley;
+		cr._actorX = x - _scumm->virtscr->xstart;
+		cr._actorY = y - elevation;
+		cr._scaleX = scalex;
+		cr._scaleY = scaley;
 
-		cr._outheight = virtscr->height;
-		cr._vm = this;
+		cr._outheight = _scumm->virtscr->height;
+		cr._vm = _scumm;
 
-		cr._zbuf = a->mask;
-		if (cr._zbuf > gdi._numZBuffer)
-			cr._zbuf = (byte)gdi._numZBuffer;
-		if (a->forceClip)
-			cr._zbuf = a->forceClip;
+		cr._zbuf = mask;
+		if (cr._zbuf > _scumm->gdi._numZBuffer)
+			cr._zbuf = (byte)_scumm->gdi._numZBuffer;
+		if (forceClip)
+			cr._zbuf = forceClip;
 
-		cr._shadow_table = _shadowPalette;
+		cr._shadow_table = _scumm->_shadowPalette;
 
-		cost_setCostume(&cr, a->costume);
-		cost_setPalette(&cr, a->palette);
-		cost_setFacing(&cr, a);
+		cr.setCostume(costume);
+		cr.setPalette(palette);
+		cr.setFacing(facing);
 
-		a->top = 0xFF;
+		top = 0xFF;
 
-		a->bottom = 0;
+		bottom = 0;
 
 		/* if the actor is partially hidden, redraw it next frame */
-		if (cr.drawCostume(a) & 1) {
-			a->needBgReset = true;
-			a->needRedraw = true;
+		if (cr.drawCostume(this) & 1) {
+			needBgReset = true;
+			needRedraw = true;
 		}
 	} else {
 		AkosRenderer ar;
 
-		if (a == NULL || !a->needRedraw)
+		if (!needRedraw)
 			return;
 
-		a->needRedraw = false;
+		needRedraw = false;
 
-		a->setupActorScale();
+		setupActorScale();
 
 		/* First, zero initialize all fields */
 		memset(&ar, 0, sizeof(ar));
 
-		ar.x = a->x - virtscr->xstart;
-		ar.y = a->y - a->elevation;
-		ar.scale_x = a->scalex;
-		ar.scale_y = a->scaley;
-		ar.clipping = a->forceClip;
+		ar.x = x - _scumm->virtscr->xstart;
+		ar.y = y - elevation;
+		ar.scale_x = scalex;
+		ar.scale_y = scaley;
+		ar.clipping = forceClip;
 		if (ar.clipping == 100) {
-			ar.clipping = a->mask;
-			if (ar.clipping > (byte)gdi._numZBuffer)
-				ar.clipping = gdi._numZBuffer;
+			ar.clipping = mask;
+			if (ar.clipping > (byte)_scumm->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.outwidth = virtscr->width;
-		ar.outheight = virtscr->height;
+		ar.outptr = _scumm->virtscr->screenPtr + _scumm->virtscr->xstart;
+		ar.outwidth = _scumm->virtscr->width;
+		ar.outheight = _scumm->virtscr->height;
 
-		ar.shadow_mode = a->shadow_mode;
-		ar.shadow_table = _shadowPalette;
+		ar.shadow_mode = shadow_mode;
+		ar.shadow_table = _scumm->_shadowPalette;
 
-		akos_setCostume(&ar, a->costume);
-		akos_setPalette(&ar, a->palette);
-		akos_setFacing(&ar, a);
+		ar.setCostume(costume);
+		ar.setPalette(palette);
+		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_bottom = a->bottom = 0;
-		akos_drawCostume(&ar);
-		a->top = ar.draw_top;
-		a->bottom = ar.draw_bottom;
+		ar.draw_top = top = 0x7fffffff;
+		ar.draw_bottom = bottom = 0;
+		ar.drawCostume();
+		top = ar.draw_top;
+		bottom = ar.draw_bottom;
 	}
 }
 
-void Scumm::actorAnimate(Actor * a)
+void Actor::actorAnimate()
 {
-	byte *akos;
-	LoadedCostume lc;
-
-	if (a == NULL || a->costume == 0)
+	if (costume == 0)
 		return;
 
-	a->animProgress++;
-	if (a->animProgress >= a->animSpeed) {
-		a->animProgress = 0;
+	animProgress++;
+	if (animProgress >= animSpeed) {
+		animProgress = 0;
 
-		if (_features & GF_AFTER_V7) {
-			akos = getResourceAddress(rtCostume, a->costume);
+		if (_scumm->_features & GF_AFTER_V7) {
+			byte *akos = _scumm->getResourceAddress(rtCostume, costume);
 			assert(akos);
-			if (akos_increaseAnims(akos, a)) {
-				a->needRedraw = true;
-				a->needBgReset = true;
+			if (_scumm->akos_increaseAnims(akos, this)) {
+				needRedraw = true;
+				needBgReset = true;
 			}
 		} else {
-			loadCostume(&lc, a->costume);
-			if (cost_increaseAnims(&lc, a)) {
-				a->needRedraw = true;
-				a->needBgReset = true;
+			LoadedCostume lc;
+			_scumm->loadCostume(&lc, costume);
+			if (_scumm->cost_increaseAnims(&lc, this)) {
+				needRedraw = true;
+				needBgReset = true;
 			}
 		}
 	}
@@ -1161,14 +1164,16 @@
 
 	costumeNeedsInit = true;
 
+	debug(1, "setActorCostume (actor=%d, costume=%d)", (int)number, (int)c);
+
 	if (visible) {
 		hideActor();
-		_scumm->initActorCostumeData(this);
+		cost.reset();
 		costume = c;
 		showActor();
 	} else {
 		costume = c;
-		_scumm->initActorCostumeData(this);
+		cost.reset();
 	}
 
 	for (i = 0; i < 32; i++)

Index: actor.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/actor.h,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- actor.h	20 May 2002 14:40:36 -0000	1.5
+++ actor.h	23 May 2002 00:37:00 -0000	1.6
@@ -50,6 +50,15 @@
 	uint16 start[16];
 	uint16 end[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 {
@@ -118,6 +127,8 @@
 	void adjustActorPos();	
 	void turnToDirection(int newdir);
 	void walkActor();
+	void drawActorCostume();
+	void actorAnimate();
 	void setActorCostume(int c);
 	byte *getActorName();
 	void startWalkActor(int x, int y, int dir);
@@ -125,7 +136,11 @@
 	void remapActor(int b, int c, int d, int e);
 	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

Index: scumm.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm.h,v
retrieving revision 1.167
retrieving revision 1.168
diff -u -d -r1.167 -r1.168
--- scumm.h	22 May 2002 22:36:58 -0000	1.167
+++ scumm.h	23 May 2002 00:37:00 -0000	1.168
@@ -412,6 +412,9 @@
 	byte drawOneSlot(Actor *a, int slot);
 	byte drawCostume(Actor *a);
 
+	void setPalette(byte *palette);
+	void setFacing(uint16 facing);
+	void setCostume(int costume);
 };
 
 #define ARRAY_HDR_SIZE 6
@@ -868,9 +871,9 @@
 
 	/* Should be in Costume class */
 	void loadCostume(LoadedCostume *lc, int costume);
-	void cost_setPalette(CostumeRenderer *cr, byte *palette);
-	void cost_setFacing(CostumeRenderer *cr, Actor *a);
-	void cost_setCostume(CostumeRenderer *cr, int costume);
+//	void cost_setPalette(CostumeRenderer *cr, byte *palette);
+//	void cost_setFacing(CostumeRenderer *cr, Actor *a);
+//	void cost_setCostume(CostumeRenderer *cr, int costume);
 	byte cost_increaseAnims(LoadedCostume *lc, Actor *a);
 	byte cost_increaseAnim(LoadedCostume *lc, Actor *a, int slot);
 	void cost_decodeData(Actor *a, int frame, uint usemask);
@@ -985,21 +988,9 @@
 	Actor *derefActorSafe(int id, const char *errmsg);
 	Actor *getFirstActor() {return actor;} 
 	void putActor(Actor *a, int x, int y, byte room);
-//	void hideActor(Actor *a);
-//	void showActor(Actor *a);
 	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;
-//	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 oldDirToNewDir(int dir);
@@ -1009,34 +1000,21 @@
 	static int fromSimpleDir(int dirtype, int dir);
 	static int toSimpleDir(int dirtype, int dir);
 	static int numSimpleDirDirections(int dirType);
-//	int updateActorDirection(Actor *a);
 	void startAnimActorEx(Actor *a, int frame, int direction);
 	int getProgrDirChange(Actor *a, int mode);
-	void initActorCostumeData(Actor *a);
-//	void setActorDirection(Actor *a, int direction);
 
 	int getActorXYPos(Actor *a);
-//	void adjustActorPos(Actor *a);	
-//	void turnToDirection(Actor *a, int newdir);
 	AdjustBoxResult adjustXYToBeInBox(Actor *a, int x, int y, int pathfrom);
 	void walkActors();
 	void playActorSounds();
-//	void walkActor(Actor *a);
 	void setActorRedrawFlags();
 	void resetActorBgs();
 	void processActors();
-	void drawActorCostume(Actor *a);
-	void actorAnimate(Actor *a);
 	int getActorFromPos(int x, int y);
-//	void setActorCostume(Actor *a, int c);
-//	byte *getActorName(Actor *a);
 	void faceActorToObj(int act, int obj);
 	void animateActor(int act, int anim);
 	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);
 
 	/* Actor talking stuff */
@@ -1048,23 +1026,9 @@
 	void stopTalk();	
 
 	/* 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_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);
 	bool akos_compare(int a, int b, byte cmd);

Index: costume.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/costume.cpp,v
retrieving revision 1.33
retrieving revision 1.34
diff -u -d -r1.33 -r1.34
--- costume.cpp	20 May 2002 14:41:47 -0000	1.33
+++ costume.cpp	23 May 2002 00:37:00 -0000	1.34
@@ -825,18 +825,6 @@
 }
 #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)
 {
 
@@ -988,28 +976,28 @@
 	} while ((uint16)mask);
 }
 
-void Scumm::cost_setPalette(CostumeRenderer * cr, byte *palette)
+void CostumeRenderer::setPalette(byte *palette)
 {
 	int i;
 	byte color;
 
-	for (i = 0; i < cr->_loaded._numColors; i++) {
+	for (i = 0; i < _loaded._numColors; i++) {
 		color = palette[i];
 		if (color == 255)
-			color = cr->_loaded._ptr[8 + i];
-		cr->_palette[i] = color;
+			color = _loaded._ptr[8 + i];
+		_palette[i] = color;
 	}
 }
 
-void Scumm::cost_setFacing(CostumeRenderer * cr, Actor * a)
+void CostumeRenderer::setFacing(uint16 facing)
 {
-	cr->_mirror = newDirToOldDir(a->facing) != 0
-		|| (cr->_loaded._ptr[7] & 0x80);
+	_mirror = _vm->newDirToOldDir(facing) != 0
+		|| (_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)

Index: akos.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/akos.cpp,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -d -r1.19 -r1.20
--- akos.cpp	14 May 2002 23:32:34 -0000	1.19
+++ akos.cpp	23 May 2002 00:37:00 -0000	1.20
@@ -150,66 +150,66 @@
 	} 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;
 
-	akpl = findResourceData(MKID('AKPL'), ar->akos);
-	size = getResourceDataSize(akpl);
+	the_akpl = g_scumm->findResourceData(MKID('AKPL'), akos);
+	size = g_scumm->getResourceDataSize(akpl);
 
 	if (size > 256)
 		error("akos_setPalette: %d is too many colors", size);
 
 	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);
-	assert(ar->akos);
+	akos = g_scumm->getResourceAddress(rtCostume, costume);
+	assert(akos);
 
-	ar->akhd = (AkosHeader *) findResourceData(MKID('AKHD'), ar->akos);
-	ar->akof = (AkosOffset *) findResourceData(MKID('AKOF'), ar->akos);
-	ar->akci = findResourceData(MKID('AKCI'), ar->akos);
-	ar->aksq = findResourceData(MKID('AKSQ'), ar->akos);
-	ar->akcd = findResourceData(MKID('AKCD'), ar->akos);
-	ar->akpl = findResourceData(MKID('AKPL'), ar->akos);
-	ar->codec = READ_LE_UINT16(&ar->akhd->codec);
+	akhd = (AkosHeader *) g_scumm->findResourceData(MKID('AKHD'), akos);
+	akof = (AkosOffset *) g_scumm->findResourceData(MKID('AKOF'), akos);
+	akci = g_scumm->findResourceData(MKID('AKCI'), akos);
+	aksq = g_scumm->findResourceData(MKID('AKSQ'), akos);
+	akcd = g_scumm->findResourceData(MKID('AKCD'), akos);
+	akpl = g_scumm->findResourceData(MKID('AKPL'), akos);
+	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)
-		ar->mirror ^= 1;
+		mirror ^= 1;
 }
 
-bool Scumm::akos_drawCostume(AkosRenderer * ar)
+bool AkosRenderer::drawCostume()
 {
 	int i;
 	bool result = false;
 
-	ar->move_x = ar->move_y = 0;
+	move_x = move_y = 0;
 	for (i = 0; i < 16; i++)
-		result |= akos_drawCostumeChannel(ar, i);
+		result |= drawCostumeChannel(i);
 	return result;
 }
 
-bool Scumm::akos_drawCostumeChannel(AkosRenderer * ar, int chan)
+bool AkosRenderer::drawCostumeChannel(int chan)
 {
 	uint code;
 	byte *p;
 	AkosOffset *off;
-	AkosCI *akci;
+	AkosCI *the_akci;
 	uint i, extra;
 
-	if (!ar->cd->active[chan] || ar->cd->stopped & (1 << chan))
+	if (!cd->active[chan] || cd->stopped & (1 << chan))
 		return false;
 
-	p = ar->aksq + ar->cd->curpos[chan];
+	p = aksq + cd->curpos[chan];
 
 	code = p[0];
 	if (code & 0x80)
@@ -219,33 +219,33 @@
 		return false;
 
 	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);
 
-		ar->srcptr = ar->akcd + READ_LE_UINT32(&off->akcd);
-		akci = (AkosCI *) (ar->akci + READ_LE_UINT16(&off->akci));
+		srcptr = akcd + READ_LE_UINT32(&off->akcd);
+		the_akci = (AkosCI *) (akci + READ_LE_UINT16(&off->akci));
 
-		ar->move_x_cur = ar->move_x + (int16) READ_LE_UINT16(&akci->rel_x);
-		ar->move_y_cur = ar->move_y + (int16) READ_LE_UINT16(&akci->rel_y);
-		ar->width = READ_LE_UINT16(&akci->width);
-		ar->height = READ_LE_UINT16(&akci->height);
-		ar->move_x += (int16) READ_LE_UINT16(&akci->move_x);
-		ar->move_y -= (int16) READ_LE_UINT16(&akci->move_y);
+		move_x_cur = move_x + (int16) READ_LE_UINT16(&the_akci->rel_x);
+		move_y_cur = move_y + (int16) READ_LE_UINT16(&the_akci->rel_y);
+		width = READ_LE_UINT16(&the_akci->width);
+		height = READ_LE_UINT16(&the_akci->height);
+		move_x += (int16) READ_LE_UINT16(&the_akci->move_x);
+		move_y -= (int16) READ_LE_UINT16(&the_akci->move_y);
 
-		switch (ar->codec) {
+		switch (codec) {
 		case 1:
-			akos_codec1(ar);
+			codec1();
 			break;
 		case 5:
-			akos_codec5(ar);
+			codec5();
 			break;
 		case 16:
-			akos_codec16(ar);
+			codec16();
 			break;
 		default:
-			error("akos_drawCostumeChannel: invalid codec %d", ar->codec);
+			error("akos_drawCostumeChannel: invalid codec %d", codec);
 		}
 	} else {
 		extra = p[2];
@@ -255,31 +255,31 @@
 			code = p[4];
 			if (code & 0x80)
 				code = ((code & 0xF) << 8) | p[5];
-			off = ar->akof + code;
+			off = akof + code;
 
-			ar->srcptr = ar->akcd + READ_LE_UINT32(&off->akcd);
-			akci = (AkosCI *) (ar->akci + READ_LE_UINT16(&off->akci));
+			srcptr = akcd + READ_LE_UINT32(&off->akcd);
+			the_akci = (AkosCI *) (akci + READ_LE_UINT16(&off->akci));
 
-			ar->move_x_cur = ar->move_x + (int16) READ_LE_UINT16(p + 0);
-			ar->move_y_cur = ar->move_y + (int16) READ_LE_UINT16(p + 2);
+			move_x_cur = move_x + (int16) READ_LE_UINT16(p + 0);
+			move_y_cur = move_y + (int16) READ_LE_UINT16(p + 2);
 
 			p += (p[4] & 0x80) ? 6 : 5;
 
-			ar->width = READ_LE_UINT16(&akci->width);
-			ar->height = READ_LE_UINT16(&akci->height);
+			width = READ_LE_UINT16(&the_akci->width);
+			height = READ_LE_UINT16(&the_akci->height);
 
-			switch (ar->codec) {
+			switch (codec) {
 			case 1:
-				akos_codec1(ar);
+				codec1();
 				break;
 			case 5:
-				akos_codec5(ar);
+				codec5();
 				break;
 			case 16:
-				akos_codec16(ar);
+				codec16();
 				break;
 			default:
-				error("akos_drawCostumeChannel: invalid codec %d", ar->codec);
+				error("akos_drawCostumeChannel: invalid codec %d", codec);
 			}
 		}
 	}
@@ -568,15 +568,14 @@
 };
 
 
-void Scumm::akos_codec1(AkosRenderer * ar)
+void AkosRenderer::codec1()
 {
 	int num_colors;
 	bool use_scaling;
 	int i, j;
-	int x, x_right, x_left, skip = 0, tmp_x, tmp_y;
-	int y, y_top, y_bottom;
+	int cur_x, x_right, x_left, skip = 0, tmp_x, tmp_y;
+	int cur_y, y_top, y_bottom;
 	bool y_clipping;
-	bool charsetmask;
 	bool masking;
 	int step;
 
@@ -585,78 +584,78 @@
 
 
 
-	if(isGlobInMemory(rtString,_vars[VAR_CUSTOMSCALETABLE])) {
-		ar->v1.scaletable = getStringAddressVar(VAR_CUSTOMSCALETABLE);
+	if(g_scumm->isGlobInMemory(rtString,g_scumm->_vars[g_scumm->VAR_CUSTOMSCALETABLE])) {
+		v1.scaletable = g_scumm->getStringAddressVar(g_scumm->VAR_CUSTOMSCALETABLE);
 	} else {
-		ar->v1.scaletable = default_scale_table;
+		v1.scaletable = default_scale_table;
 	}
 
 	/* Setup color decoding variables */
-	num_colors = getResourceDataSize(ar->akpl);
+	num_colors = g_scumm->getResourceDataSize(akpl);
 	if (num_colors == 32) {
-		ar->v1.mask = (1 << 3) - 1;
-		ar->v1.shl = 3;
+		v1.mask = (1 << 3) - 1;
+		v1.shl = 3;
 	} else if (num_colors == 64) {
-		ar->v1.mask = (1 << 2) - 1;
-		ar->v1.shl = 2;
+		v1.mask = (1 << 2) - 1;
+		v1.shl = 2;
 	} else {
-		ar->v1.mask = (1 << 4) - 1;
-		ar->v1.shl = 4;
+		v1.mask = (1 << 4) - 1;
+		v1.shl = 4;
 	}
 
-	use_scaling = (ar->scale_x != 0xFF) || (ar->scale_y != 0xFF);
+	use_scaling = (scale_x != 0xFF) || (scale_y != 0xFF);
 
-	x = ar->x;
-	y = ar->y;
+	cur_x = x;
+	cur_y = y;
 
 	if (use_scaling) {
 
 		/* Scale direction */
-		ar->v1.scaleXstep = -1;
-		if (ar->move_x_cur < 0) {
-			ar->move_x_cur = -ar->move_x_cur;
-			ar->v1.scaleXstep = 1;
+		v1.scaleXstep = -1;
+		if (move_x_cur < 0) {
+			move_x_cur = -move_x_cur;
+			v1.scaleXstep = 1;
 		}
 
-		if (ar->mirror) {
+		if (mirror) {
 			/* Adjust X position */
-			tmp_x = 0x180 - ar->move_x_cur;
+			tmp_x = 0x180 - move_x_cur;
 			j = tmp_x;
-			for (i = 0; i < ar->move_x_cur; i++) {
-				if (ar->v1.scaletable[j++] < ar->scale_x)
-					x -= ar->v1.scaleXstep;
+			for (i = 0; i < move_x_cur; i++) {
+				if (v1.scaletable[j++] < scale_x)
+					cur_x -= v1.scaleXstep;
 			}
 
-			x_left = x_right = x;
+			x_left = x_right = cur_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) {
 					skip++;
 					tmp_x = j;
 				}
-				if (ar->v1.scaletable[j++] < ar->scale_x)
+				if (v1.scaletable[j++] < scale_x)
 					x_right++;
 			}
 		} else {
 			/* No mirror */
 			/* Adjust X position */
-			tmp_x = 0x180 + ar->move_x_cur;
+			tmp_x = 0x180 + move_x_cur;
 			j = tmp_x;
-			for (i = 0; i < ar->move_x_cur; i++) {
-				if (ar->v1.scaletable[j++] < ar->scale_x)
-					x += ar->v1.scaleXstep;
+			for (i = 0; i < move_x_cur; i++) {
+				if (v1.scaletable[j++] < scale_x)
+					cur_x += v1.scaleXstep;
 			}
 
-			x_left = x_right = x;
+			x_left = x_right = cur_x;
 
 			j = tmp_x;
-			for (i = 0, skip = 0; i < ar->width; i++) {
-				if (x_left >= (int)ar->outwidth) {
+			for (i = 0, skip = 0; i < width; i++) {
+				if (x_left >= (int)outwidth) {
 					tmp_x = j;
 					skip++;
 				}
-				if (ar->v1.scaletable[j--] < ar->scale_x)
+				if (v1.scaletable[j--] < scale_x)
 					x_left--;
 			}
 		}
@@ -665,226 +664,224 @@
 			skip--;
 
 		step = -1;
-		if (ar->move_y_cur < 0) {
-			ar->move_y_cur = -ar->move_y_cur;
+		if (move_y_cur < 0) {
+			move_y_cur = -move_y_cur;
 			step = -step;
 		}
 
-		tmp_y = 0x180 - ar->move_y_cur;
-		for (i = 0; i < ar->move_y_cur; i++) {
-			if (ar->v1.scaletable[tmp_y++] < ar->scale_y)
-				y -= step;
+		tmp_y = 0x180 - move_y_cur;
+		for (i = 0; i < move_y_cur; i++) {
+			if (v1.scaletable[tmp_y++] < scale_y)
+				cur_y -= step;
 		}
 
-		y_top = y_bottom = y;
-		tmp_y = 0x180 - ar->move_y_cur;
-		for (i = 0; i < ar->height; i++) {
-			if (ar->v1.scaletable[tmp_y++] < ar->scale_y)
+		y_top = y_bottom = cur_y;
+		tmp_y = 0x180 - move_y_cur;
+		for (i = 0; i < height; i++) {
+			if (v1.scaletable[tmp_y++] < scale_y)
 				y_bottom++;
 		}
 
-		tmp_y = 0x180 - ar->move_y_cur;
+		tmp_y = 0x180 - move_y_cur;
 	} else {
-		if (!ar->mirror)
-			ar->move_x_cur = -ar->move_x_cur;
+		if (!mirror)
+			move_x_cur = -move_x_cur;
 
-		x += ar->move_x_cur;
-		y += ar->move_y_cur;
+		cur_x += move_x_cur;
+		cur_y += move_y_cur;
 
-		if (ar->mirror) {
-			x_left = x;
-			x_right = x + ar->width;
+		if (mirror) {
+			x_left = cur_x;
+			x_right = cur_x + width;
 		} else {
-			x_right = x;
-			x_left = x - ar->width;
+			x_right = cur_x;
+			x_left = cur_x - width;
 		}
 
-		y_top = y;
-		y_bottom = y + ar->height;
+		y_top = cur_y;
+		y_bottom = cur_y + height;
 
 		tmp_x = 0x180;
 		tmp_y = 0x180;
 	}
 
-	ar->v1.tmp_x = tmp_x;
-	ar->v1.tmp_y = tmp_y;
-	ar->v1.skip_width = ar->width;
+	v1.tmp_x = tmp_x;
+	v1.tmp_y = tmp_y;
+	v1.skip_width = width;
 
-	ar->v1.scaleXstep = -1;
-	if (ar->mirror)
-		ar->v1.scaleXstep = -ar->v1.scaleXstep;
+	v1.scaleXstep = -1;
+	if (mirror)
+		v1.scaleXstep = -v1.scaleXstep;
 
-	if ((uint) y_top >= (uint) ar->outheight || y_bottom <= 0)
+	if ((uint) y_top >= (uint) outheight || y_bottom <= 0)
 		return;
 
-	if ((int)x_left >= (int)ar->outwidth || x_right <= 0)
+	if ((int)x_left >= (int)outwidth || x_right <= 0)
 		return;
 
-	ar->v1.replen = 0;
-	ar->v1.y_pitch = ar->height * ar->outwidth;
+	v1.replen = 0;
+	v1.y_pitch = height * outwidth;
 
-	if (ar->mirror) {
-		ar->v1.y_pitch--;
+	if (mirror) {
+		v1.y_pitch--;
 		if (!use_scaling)
-			skip = -x;
+			skip = -cur_x;
 		if (skip > 0) {
-			ar->v1.skip_width -= skip;
-			akos_codec1_ignorePakCols(ar, skip);
-			x = 0;
+			v1.skip_width -= skip;
+			codec1_ignorePakCols(skip);
+			cur_x = 0;
 		} else {
-			skip = x_right - ar->outwidth;
+			skip = x_right - outwidth;
 			if (skip > 0)
-				ar->v1.skip_width -= skip;
+				v1.skip_width -= skip;
 		}
 	} else {
-		ar->v1.y_pitch++;
+		v1.y_pitch++;
 		if (!use_scaling) {
-			skip = x_right - ar->outwidth + 1;
+			skip = x_right - outwidth + 1;
 		}
 		if (skip > 0) {
-			ar->v1.skip_width -= skip;
-			akos_codec1_ignorePakCols(ar, skip);
-			x = ar->outwidth - 1;
+			v1.skip_width -= skip;
+			codec1_ignorePakCols(skip);
+			cur_x = outwidth - 1;
 		} else {
 			skip = -1 - x_left;
 			if (skip > 0)
-				ar->v1.skip_width -= skip;
+				v1.skip_width -= skip;
 		}
 	}
 
-	ar->v1.x = x;
-	ar->v1.y = y;
+	v1.x = cur_x;
+	v1.y = cur_y;
 
-	if (ar->v1.skip_width <= 0 || ar->height <= 0)
+	if (v1.skip_width <= 0 || height <= 0)
 		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;
 
-	if ((uint) y_bottom > (uint) ar->outheight)
-		y_bottom = ar->outheight;
+	if ((uint) y_bottom > (uint) outheight)
+		y_bottom = outheight;
 
-	if (y_top < ar->draw_top)
-		ar->draw_top = y_top;
-	if (y_bottom > ar->draw_bottom)
-		ar->draw_bottom = y_bottom;
+	if (y_top < draw_top)
+		draw_top = y_top;
+	if (y_bottom > draw_bottom)
+		draw_bottom = y_bottom;
 
-	if (x == -1)
-		x = 0;											/* ?? */
+	if (cur_x == -1)
+		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;
-	if (ar->clipping) {
-		masking = isMaskActiveAt(x_left, y_top, x_right, y_bottom,
-														 getResourceAddress(rtBuffer,
-																								9) +
-														 gdi._imgBufOffs[ar->clipping] +
-														 _screenStartStrip) != 0;
+	if (clipping) {
+		masking = g_scumm->isMaskActiveAt(x_left, y_top, x_right, y_bottom,
+														 g_scumm->getResourceAddress(rtBuffer, 9) +
+														 g_scumm->gdi._imgBufOffs[clipping] +
+														 g_scumm->_screenStartStrip) != 0;
 	}
 
-	ar->v1.mask_ptr = NULL;
+	v1.mask_ptr = NULL;
 
-	if (masking || charsetmask || ar->shadow_mode) {
-		ar->v1.mask_ptr =
-			getResourceAddress(rtBuffer, 9) + y * 40 + _screenStartStrip;
-		ar->v1.imgbufoffs = gdi._imgBufOffs[ar->clipping];
+	if (masking || charsetmask || shadow_mode) {
+		v1.mask_ptr =
+			g_scumm->getResourceAddress(rtBuffer, 9) + cur_y * 40 + g_scumm->_screenStartStrip;
+		v1.imgbufoffs = g_scumm->gdi._imgBufOffs[clipping];
 		if (!charsetmask && masking) {
-			ar->v1.mask_ptr += ar->v1.imgbufoffs;
-			ar->v1.imgbufoffs = 0;
+			v1.mask_ptr += v1.imgbufoffs;
+			v1.imgbufoffs = 0;
 		}
 	}
 
-	switch (ar->shadow_mode) {
+	switch (shadow_mode) {
 	case 1:
-		akos_c1_spec1(ar);
+		akos_c1_spec1(this);
 		return;
 	case 2:
-//    akos_c1_spec2(ar);
+//    akos_c1_spec2(this);
 		warning("akos_c1_spec2");
 		return;
 	case 3:
-//    akos_c1_spec3(ar);
+//    akos_c1_spec3(this);
 		warning("akos_c1_spec3");
 		return;
 	}
 
-	akos_generic_decode(ar);
+	akos_generic_decode(this);
 
-//  akos_c1_0y_decode(ar);
+//  akos_c1_0y_decode(this);
 
 #if 0
 
 	switch (((byte)y_clipping << 3) | ((byte)use_scaling << 2) |
 					((byte)masking << 1) | (byte)charsetmask) {
 	case 0:
-		akos_c1_0_decode(ar);
+		akos_c1_0_decode(this);
 		break;
 	case 0 + 8:
-		akos_c1_0y_decode(ar);
+		akos_c1_0y_decode(this);
 		break;
 	case 2:
 	case 1:
-		akos_c1_12_decode(ar);
+		akos_c1_12_decode(this);
 		break;
 	case 2 + 8:
 	case 1 + 8:
-		akos_c1_12y_decode(ar);
+		akos_c1_12y_decode(this);
 		break;
 	case 3 + 8:
 	case 3:
-		akos_c1_3_decode(ar);
+		akos_c1_3_decode(this);
 		break;
 	case 4:
-		akos_c1_4_decode(ar);
+		akos_c1_4_decode(this);
 		break;
 	case 4 + 8:
-		akos_c1_4y_decode(ar);
+		akos_c1_4y_decode(this);
 		break;
 	case 6:
 	case 5:
-		akos_c1_56_decode(ar);
+		akos_c1_56_decode(this);
 		break;
 	case 6 + 8:
 	case 5 + 8:
-		akos_c1_56y_decode(ar);
+		akos_c1_56y_decode(this);
 		break;
 	case 7:
 	case 7 + 8:
-		akos_c1_7_decode(ar);
+		akos_c1_7_decode(this);
 		break;
 	}
 #endif
 }
 
 
-void Scumm::akos_codec1_ignorePakCols(AkosRenderer * ar, int num)
+void AkosRenderer::codec1_ignorePakCols(int num)
 {
 	int n;
 	byte repcolor;
 	byte replen;
 	byte *src;
 
-	n = ar->height;
+	n = height;
 	if (num > 1)
 		n *= num;
-	src = ar->srcptr;
+	src = srcptr;
 	do {
 		repcolor = *src++;
-		replen = repcolor & ar->v1.mask;
+		replen = repcolor & v1.mask;
 		if (replen == 0) {
 			replen = *src++;
 		}
 		do {
 			if (!--n) {
-				ar->v1.repcolor = repcolor >> ar->v1.shl;
-				ar->v1.replen = replen;
-				ar->srcptr = src;
+				v1.repcolor = repcolor >> v1.shl;
+				v1.replen = replen;
+				srcptr = src;
 				return;
 			}
 		} while (--replen);
@@ -892,13 +889,11 @@
 }
 
 
-void Scumm::akos_codec5(AkosRenderer * ar)
+void AkosRenderer::codec5()
 {
-
 	VirtScreen *vs;
 	BompDrawData bdd;
 
-	int mirror;
 	int moveX;
 	int moveY;
 	int left;
@@ -909,50 +904,49 @@
 	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;
+	vs = &g_scumm->virtscr[0];
+	//setBlastObjectMode(shadow_mode); // not implemented yet
+	moveX=move_x_cur;
+	moveY=move_y_cur;
 
 	if (!mirror) {
-		left = (ar->x - moveX - ar->width) + 1;
+		left = (x - moveX - width) + 1;
 	} else {
-		left = ar->x + moveX -1;
+		left = x + moveX -1;
 	}
 
 	var_20=0;
-	max_width = ar->outwidth;
+	max_width = outwidth;
 
-	right = left + ar->width - 1;
-	top = ar->y + moveY;
-	bottom = top + ar->height;
+	right = left + width - 1;
+	top = y + moveY;
+	bottom = top + height;
 
 	if(left < 0)
 		left = 0;
 	if(left > max_width)
 		left -= left - max_width;
 
-	ar->draw_top = 0;
-	ar->draw_bottom = 200;
+	draw_top = 0;
+	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.outheight = ar->outheight;
-	bdd.outwidth = ar->outwidth;
+	bdd.outheight = outheight;
+	bdd.outwidth = outwidth;
 	bdd.scale_x = 0xFF;
 	bdd.scale_y = 0xFF;
-	bdd.srcheight = ar->height;
-	bdd.srcwidth = ar->width;
+	bdd.srcheight = height;
+	bdd.srcwidth = width;
 	bdd.x = left+1;
 	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");
 }
@@ -1087,12 +1081,12 @@
 
 		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(a->getAnimVar(GB(2)),
+							"akos_increaseAnim:29"), a->getAnimVar(GB(3)), 0);
 			continue;
 
 		case AKC_Random:
-			setAnimVar(a, GB(6), getRandomNumberRng(GW(2), GW(4)));
+			a->setAnimVar(GB(6), getRandomNumberRng(GW(2), GW(4)));
 			continue;
 		case AKC_SkipGE:
 		case AKC_SkipG:
@@ -1100,17 +1094,17 @@
 		case AKC_SkipL:
 		case AKC_SkipNE:
 		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;
 			continue;
 		case AKC_IncVar:
-			setAnimVar(a, 0, getAnimVar(a, 0) + 1);
+			a->setAnimVar(0, a->getAnimVar(0) + 1);
 			continue;
 		case AKC_SetVar:
-			setAnimVar(a, GB(4), GW(2));
+			a->setAnimVar(GB(4), GW(2));
 			continue;
 		case AKC_AddVar:
-			setAnimVar(a, GB(4), getAnimVar(a, GB(4)) + GW(2));
+			a->setAnimVar(GB(4), a->getAnimVar(GB(4)) + GW(2));
 			continue;
 		case AKC_Flip:
 			a->flip = GW(2) != 0;
@@ -1127,10 +1121,10 @@
 			akos_queCommand(4, a, GB(2), 0);
 			continue;
 		case AKC_StartVarAnim:
-			akos_queCommand(4, a, getAnimVar(a, GB(2)), 0);
+			akos_queCommand(4, a, a->getAnimVar(GB(2)), 0);
 			continue;
 		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)
 				);
 			continue;
@@ -1155,15 +1149,15 @@
 		case AKC_JumpTable:
 			if (akfo == NULL)
 				error("akos_increaseAnim: no AKFO table");
-			tmp = getAnimVar(a, GB(2)) - 1;
+			tmp = a->getAnimVar(GB(2)) - 1;
 			if (tmp < 0 || tmp >= numakfo - 1)
 				error("akos_increaseAnim: invalid jump value %d", tmp);
 			curpos = READ_LE_UINT16(&akfo[tmp]);
 			break;
 		case AKC_JumpIfSet:
-			if (!getAnimVar(a, GB(4)))
+			if (!a->getAnimVar(GB(4)))
 				continue;
-			setAnimVar(a, GB(4), 0);
+			a->setAnimVar(GB(4), 0);
 			curpos = GUW(2);
 			break;
 
@@ -1190,7 +1184,7 @@
 		case AKC_JumpLE:
 		case AKC_JumpG:
 		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;
 			curpos = GUW(2);
 			break;
@@ -1235,14 +1229,4 @@
 	default:
 		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;
 }

Index: akos.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/akos.h,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- akos.h	14 May 2002 23:35:28 -0000	1.7
+++ akos.h	23 May 2002 00:37:00 -0000	1.8
@@ -53,6 +53,7 @@
 #endif	
 
 struct AkosRenderer {
+//protected:
 	CostumeData *cd;
 	int x,y; /* where to draw costume */
 	byte scale_x, scale_y; /* scaling */
@@ -103,7 +104,19 @@
 	byte *akcd;
 
 	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{

Index: script_v2.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/script_v2.cpp,v
retrieving revision 1.65
retrieving revision 1.66
diff -u -d -r1.65 -r1.66
--- script_v2.cpp	22 May 2002 12:56:26 -0000	1.65
+++ script_v2.cpp	23 May 2002 00:37:00 -0000	1.66
@@ -2024,7 +2024,7 @@
 		break;
 	case 198:										/* set anim variable */
 		i = pop();									/* value */
-		setAnimVar(a, pop(), i);
+		a->setAnimVar(pop(), i);
 		break;
 	case 215:
 		a->new_3 = 1;
@@ -2405,7 +2405,7 @@
 void Scumm::o6_getAnimateVariable()
 {
 	int var = pop();
-	push(getAnimVar(derefActorSafe(pop(), "o6_getAnimateVariable"), var));
+	push(derefActorSafe(pop(), "o6_getAnimateVariable")->getAnimVar(var));
 }
 
 void Scumm::o6_soundKludge()





More information about the Scummvm-git-logs mailing list