[Scummvm-cvs-logs] CVS: scummvm/scumm actor.cpp,1.115,1.116 base-costume.h,1.8,1.9

Max Horn fingolfin at users.sourceforge.net
Thu May 29 10:15:06 CEST 2003


Update of /cvsroot/scummvm/scummvm/scumm
In directory sc8-pr-cvs1:/tmp/cvs-serv26023

Modified Files:
	actor.cpp base-costume.h 
Log Message:
cleanup

Index: actor.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/actor.cpp,v
retrieving revision 1.115
retrieving revision 1.116
diff -u -d -r1.115 -r1.116
--- actor.cpp	29 May 2003 02:14:30 -0000	1.115
+++ actor.cpp	29 May 2003 17:14:47 -0000	1.116
@@ -904,34 +904,32 @@
 	bcr->_dirty_id = number;
 
 	if (!(_vm->_features & GF_NEW_COSTUMES)) {
-		CostumeRenderer& cr = *(CostumeRenderer *)bcr;
 
 		if (forceClip)
-			cr._zbuf = forceClip;
+			bcr->_zbuf = forceClip;
 		else if (isInClass(kObjectClassNeverClip))
-			cr._zbuf = 0;
+			bcr->_zbuf = 0;
 		else {
-			cr._zbuf = _vm->getMaskFromBox(walkbox);
-			if (cr._zbuf > _vm->gdi._numZBuffer)
-				cr._zbuf = _vm->gdi._numZBuffer;
+			bcr->_zbuf = _vm->getMaskFromBox(walkbox);
+			if (bcr->_zbuf > _vm->gdi._numZBuffer)
+				bcr->_zbuf = _vm->gdi._numZBuffer;
 		}
 
-		cr._draw_top = top = 0xFF;
-		cr._draw_bottom = bottom = 0;
+		bcr->_draw_top = top = 0xFF;
 	} else {
-		AkosRenderer& ar = *(AkosRenderer *)bcr;
 
-		ar._zbuf = forceClip;
-		if (ar._zbuf == 100) {
-			ar._zbuf = _vm->getMaskFromBox(walkbox);
-			if (ar._zbuf > _vm->gdi._numZBuffer)
-				ar._zbuf = _vm->gdi._numZBuffer;
+		bcr->_zbuf = forceClip;
+		if (bcr->_zbuf == 100) {
+			bcr->_zbuf = _vm->getMaskFromBox(walkbox);
+			if (bcr->_zbuf > _vm->gdi._numZBuffer)
+				bcr->_zbuf = _vm->gdi._numZBuffer;
 		}
 
-		ar._draw_top = top = 0x7fffffff;
-		ar._draw_bottom = bottom = 0;
+		bcr->_draw_top = top = 0x7fffffff;
 	}
 
+	bcr->_draw_bottom = bottom = 0;
+
 	bcr->_outptr = _vm->virtscr[0].screenPtr + _vm->virtscr[0].xstart;
 	bcr->_outwidth = _vm->virtscr[0].width;
 	bcr->_outheight = _vm->virtscr[0].height;
@@ -953,9 +951,14 @@
 		needRedraw = true;
 	}
 
+	// Record the vertical extent of the drawn actor
 	top = bcr->_draw_top;
 	bottom = bcr->_draw_bottom;
 	
+	// Finally get rid of the costume renderer again.
+	// TODO: Instead of creating costume renderers on the fly and then
+	// disposing them again, we could once at the start create one,
+	// and then reuse it.
 	delete bcr;
 }
 

Index: base-costume.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/base-costume.h,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- base-costume.h	29 May 2003 10:46:06 -0000	1.8
+++ base-costume.h	29 May 2003 17:14:47 -0000	1.9
@@ -43,8 +43,8 @@
 class Actor;
 class Scumm;
 
-/*
- * Base class for both CostumeRenderer and AkosRenderer
+/**
+ * Base class for both CostumeRenderer and AkosRenderer.
  */
 struct BaseCostumeRenderer {
 public:





More information about the Scummvm-git-logs mailing list