aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Horn2003-05-29 17:14:47 +0000
committerMax Horn2003-05-29 17:14:47 +0000
commitd8844871f5127a80b72d89802b81e50d9475d7f3 (patch)
tree8ce7759be2427834c04d9efb4d15c93a88c69c5f
parent74bc20597c20b151a405cdf931c05a71c2a61983 (diff)
downloadscummvm-rg350-d8844871f5127a80b72d89802b81e50d9475d7f3.tar.gz
scummvm-rg350-d8844871f5127a80b72d89802b81e50d9475d7f3.tar.bz2
scummvm-rg350-d8844871f5127a80b72d89802b81e50d9475d7f3.zip
cleanup
svn-id: r8109
-rw-r--r--scumm/actor.cpp35
-rw-r--r--scumm/base-costume.h4
2 files changed, 21 insertions, 18 deletions
diff --git a/scumm/actor.cpp b/scumm/actor.cpp
index 0faa1c53f7..dd54cc171a 100644
--- a/scumm/actor.cpp
+++ b/scumm/actor.cpp
@@ -904,34 +904,32 @@ void Actor::drawActorCostume() {
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 @@ void Actor::drawActorCostume() {
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;
}
diff --git a/scumm/base-costume.h b/scumm/base-costume.h
index 4211a954d7..72b2f1cdfb 100644
--- a/scumm/base-costume.h
+++ b/scumm/base-costume.h
@@ -43,8 +43,8 @@ struct CostumeInfo {
class Actor;
class Scumm;
-/*
- * Base class for both CostumeRenderer and AkosRenderer
+/**
+ * Base class for both CostumeRenderer and AkosRenderer.
*/
struct BaseCostumeRenderer {
public: