[Scummvm-cvs-logs] CVS: scummvm/scumm actor.cpp,1.275,1.276 actor.h,1.57,1.58 script_v8.cpp,2.270,2.271
Max Horn
fingolfin at users.sourceforge.net
Fri Sep 3 12:56:02 CEST 2004
- Previous message: [Scummvm-cvs-logs] CVS: scummvm/scumm gfx.cpp,2.295,2.296 gfx.h,1.66,1.67 intern.h,2.212,2.213 palette.cpp,2.15,2.16 script_v72he.cpp,2.41,2.42 scumm.h,1.464,1.465
- Next message: [Scummvm-cvs-logs] CVS: scummvm NEWS,1.76,1.77
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Update of /cvsroot/scummvm/scummvm/scumm
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21440
Modified Files:
actor.cpp actor.h script_v8.cpp
Log Message:
Fix for bug #1021538 (COMI: Graphic glitches in ship-to-ship fight)
Index: actor.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/actor.cpp,v
retrieving revision 1.275
retrieving revision 1.276
diff -u -d -r1.275 -r1.276
--- actor.cpp 3 Sep 2004 15:39:14 -0000 1.275
+++ actor.cpp 3 Sep 2004 19:54:58 -0000 1.276
@@ -986,11 +986,13 @@
}
}
-void Actor::drawActorCostume() {
- if (!needRedraw)
- return;
-
- needRedraw = false;
+void Actor::drawActorCostume(bool hitTestMode) {
+ if (!hitTestMode) {
+ if (!needRedraw)
+ return;
+
+ needRedraw = false;
+ }
setupActorScale();
@@ -1055,9 +1057,9 @@
}
- bcr->_draw_top = top = 0x7fffffff;
+ bcr->_draw_top = 0x7fffffff;
+ bcr->_draw_bottom = 0;
- bcr->_draw_bottom = bottom = 0;
bcr->_skipLimb = (skipLimb != 0);
// If the actor is partially hidden, redraw it next frame.
@@ -1066,9 +1068,26 @@
needRedraw = (_vm->_version <= 6);
}
- // Record the vertical extent of the drawn actor
- top = bcr->_draw_top;
- bottom = bcr->_draw_bottom;
+ if (!hitTestMode) {
+ // Record the vertical extent of the drawn actor
+ top = bcr->_draw_top;
+ bottom = bcr->_draw_bottom;
+ }
+}
+
+bool Actor::actorHitTest(int x, int y) {
+ AkosRenderer *ar = (AkosRenderer *)_vm->_costumeRenderer;
+
+ ar->_actorHitX = x;
+ ar->_actorHitY = y;
+ ar->_actorHitMode = true;
+ ar->_actorHitResult = false;
+
+ drawActorCostume(true);
+
+ ar->_actorHitMode = false;
+
+ return ar->_actorHitResult;
}
void Actor::animateCostume() {
Index: actor.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/actor.h,v
retrieving revision 1.57
retrieving revision 1.58
diff -u -d -r1.57 -r1.58
--- actor.h 29 Aug 2004 11:27:15 -0000 1.57
+++ actor.h 3 Sep 2004 19:54:58 -0000 1.58
@@ -156,12 +156,14 @@
void turnToDirection(int newdir);
void walkActor();
void walkActorOld();
- void drawActorCostume();
+ void drawActorCostume(bool hitTestMode = false);
void animateCostume();
void setActorCostume(int c);
void animateLimb(int limb, int f);
+ bool actorHitTest(int x, int y);
+
byte *getActorName();
void startWalkActor(int x, int y, int dir);
void stopActorMoving();
Index: script_v8.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/script_v8.cpp,v
retrieving revision 2.270
retrieving revision 2.271
diff -u -d -r2.270 -r2.271
--- script_v8.cpp 2 Sep 2004 22:47:10 -0000 2.270
+++ script_v8.cpp 3 Sep 2004 19:54:58 -0000 2.271
@@ -1402,20 +1402,7 @@
case 0xD9: { // actorHit - used, for example, to detect ship collision
// during ship-to-ship combat.
Actor *a = derefActor(args[1], "actorHit");
- AkosRenderer *ar = (AkosRenderer *) _costumeRenderer;
- bool old_need_redraw = a->needRedraw;
-
- ar->_actorHitX = args[2];
- ar->_actorHitY = args[3] + _screenTop;
- ar->_actorHitMode = true;
- ar->_actorHitResult = false;
-
- a->needRedraw = true;
- a->drawActorCostume();
- a->needRedraw = old_need_redraw;
-
- ar->_actorHitMode = false;
- push(ar->_actorHitResult);
+ push(a->actorHitTest(args[2], args[3] + _screenTop));
break;
}
case 0xDA: // lipSyncWidth
- Previous message: [Scummvm-cvs-logs] CVS: scummvm/scumm gfx.cpp,2.295,2.296 gfx.h,1.66,1.67 intern.h,2.212,2.213 palette.cpp,2.15,2.16 script_v72he.cpp,2.41,2.42 scumm.h,1.464,1.465
- Next message: [Scummvm-cvs-logs] CVS: scummvm NEWS,1.76,1.77
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the Scummvm-git-logs
mailing list