[Scummvm-cvs-logs] SF.net SVN: scummvm: [26765] scummvm/trunk/engines/parallaction
peres001 at users.sourceforge.net
peres001 at users.sourceforge.net
Sun May 6 16:45:21 CEST 2007
Revision: 26765
http://scummvm.svn.sourceforge.net/scummvm/?rev=26765&view=rev
Author: peres001
Date: 2007-05-06 07:45:20 -0700 (Sun, 06 May 2007)
Log Message:
-----------
Fixed sketch glitches in the introduction.
Modified Paths:
--------------
scummvm/trunk/engines/parallaction/graphics.cpp
scummvm/trunk/engines/parallaction/graphics.h
scummvm/trunk/engines/parallaction/intro.cpp
Modified: scummvm/trunk/engines/parallaction/graphics.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/graphics.cpp 2007-05-06 14:36:02 UTC (rev 26764)
+++ scummvm/trunk/engines/parallaction/graphics.cpp 2007-05-06 14:45:20 UTC (rev 26765)
@@ -787,7 +787,7 @@
}
-void Gfx::maskOpNot(uint16 x, uint16 y, uint16 unused) {
+void Gfx::plotMaskPixel(uint16 x, uint16 y, byte color) {
uint16 _ax = x + y * SCREEN_WIDTH;
_buffers[kMask0][_ax >> 2] &= ~(3 << ((_ax & 3) << 1));
@@ -797,12 +797,12 @@
-void Gfx::maskClearRectangle(const Common::Rect& r) {
+void Gfx::fillMaskRect(const Common::Rect& r, byte color) {
uint16 _di = r.left/4 + r.top*80;
for (uint16 _si = r.top; _si < r.bottom; _si++) {
- memset(&_buffers[kMask0][_di], 0, r.width()/4+1);
+ memset(&_buffers[kMask0][_di], color, r.width()/4+1);
_di += 80;
}
Modified: scummvm/trunk/engines/parallaction/graphics.h
===================================================================
--- scummvm/trunk/engines/parallaction/graphics.h 2007-05-06 14:36:02 UTC (rev 26764)
+++ scummvm/trunk/engines/parallaction/graphics.h 2007-05-06 14:45:20 UTC (rev 26765)
@@ -184,8 +184,8 @@
void restoreBackground(const Common::Rect& r);
// intro
- void maskClearRectangle(const Common::Rect& r);
- void maskOpNot(uint16 x, uint16 y, uint16 unused);
+ void fillMaskRect(const Common::Rect& r, byte color);
+ void plotMaskPixel(uint16 x, uint16 y, byte color);
// low level
void swapBuffers();
Modified: scummvm/trunk/engines/parallaction/intro.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/intro.cpp 2007-05-06 14:36:02 UTC (rev 26764)
+++ scummvm/trunk/engines/parallaction/intro.cpp 2007-05-06 14:45:20 UTC (rev 26765)
@@ -28,6 +28,8 @@
#include "parallaction/graphics.h"
#include "parallaction/zone.h"
+#include "graphics/primitives.h"
+
namespace Parallaction {
static Animation *_rightHandAnim;
@@ -123,7 +125,6 @@
extern Credit _credits[];
-
void _c_startIntro(void *parm) {
_rightHandAnim = _vm->findAnimation("righthand");
@@ -196,134 +197,25 @@
return;
}
-
-void introFunc1(uint16 oldX, uint16 oldY, uint16 newX, uint16 newY) {
-
- uint16 unused = 0;
- int16 dx = newX - oldX;
- int16 dy = newY - oldY;
-
- _vm->_gfx->maskOpNot(oldX, oldY, unused);
- _vm->_gfx->maskOpNot(newX, newY, unused);
-
- if (ABS(dx) >= ABS(dy)) {
-
- int16 v4 = ABS(dy);
- if (dx >= 0 && dy >= 0) {
- for (uint16 i = 1; i < dx; i++) {
- v4 += dy;
- if (ABS(dx) < v4) {
- oldY++;
- v4 -= dx;
- }
- _vm->_gfx->maskOpNot(i + oldX, oldY, unused);
- }
- }
-
- if (dx < 0 && dy >= 0) {
- for (uint16 i = 1; i > ABS(dx); i++) {
- v4 += dy;
- if (ABS(dx) < v4) {
- oldY++;
- v4 -= ABS(dx);
- }
- _vm->_gfx->maskOpNot(oldX - i, oldY, unused);
- }
- }
-
- if (dx < 0 && dy < 0) {
- for (uint16 i = 1; i > ABS(dx); i++) {
- v4 += dy;
- if (ABS(v4) > ABS(dx)) {
- oldY--;
- v4 -= ABS(dx);
- }
- _vm->_gfx->maskOpNot(oldX - i, oldY, unused);
- }
- }
-
- if (dx >= 0 && dy < 0) {
- for (uint16 i = 1; i < dx; i++) {
- v4 -= dy;
- if (v4 > dx) {
- oldY--;
- v4 -= dx;
- }
- _vm->_gfx->maskOpNot(i + oldX, oldY, unused);
- }
- }
-
- }
-
- if (ABS(dy) < ABS(dx)) {
-
- int16 v4 = ABS(dx);
-
- if (dx >= 0 && dy >= 0) {
- for (uint16 i = 1; i < dy; i++) {
- v4 += dx;
- if (v4 > dy) {
- oldX++;
- v4 -= dy;
- }
- _vm->_gfx->maskOpNot(oldX, i + oldY, unused);
- }
- }
-
- if (dx < 0 && dy >= 0) {
- for (uint16 i = 1; i < dy; i++) {
- v4 -= dx;
- if (v4 > dy) {
- oldX--;
- v4 -= dy;
- }
- _vm->_gfx->maskOpNot(oldX, i + oldY, unused);
- }
- }
-
- if (dx < 0 && dy < 0) {
- for (uint16 i = 1; i < ABS(dy); i++) {
- v4 -= ABS(dx);
- if (v4 > ABS(dy)) {
- oldX--;
- v4 -= ABS(dy);
- }
- _vm->_gfx->maskOpNot(oldX, oldY - i, unused);
- }
- }
-
- if (dx >= 0 && dy < 0) {
- for (uint16 i = 1; i < ABS(dy); i++) {
- v4 += ABS(dx);
- if (v4 > ABS(dy)) {
- oldX++;
- v4 -= ABS(dy);
- }
- _vm->_gfx->maskOpNot(oldX, oldY - i, unused);
- }
- }
-
- }
-
-
- return;
+void plotPixel(int x, int y, int color, void *data) {
+ _vm->_gfx->plotMaskPixel(x, y, color);
}
-
void _c_sketch(void *parm) {
static uint16 index = 1;
- uint16 _4 = _rightHandPositions[2*index+1];
- uint16 _3 = _rightHandPositions[2*index];
- uint16 _2 = _rightHandPositions[2*(index-1)+1];
- uint16 _1 = _rightHandPositions[2*(index-1)];
+ uint16 newy = _rightHandPositions[2*index+1];
+ uint16 newx = _rightHandPositions[2*index];
- introFunc1(_1, _2, _3, _4);
+ uint16 oldy = _rightHandPositions[2*(index-1)+1];
+ uint16 oldx = _rightHandPositions[2*(index-1)];
- _rightHandAnim->_left = _rightHandPositions[index*2];
- _rightHandAnim->_top = _rightHandPositions[index*2+1] - 20;
+ Graphics::drawLine(oldx, oldy, newx, newy, 0, plotPixel, NULL);
+ _rightHandAnim->_left = newx;
+ _rightHandAnim->_top = newy - 20;
+
index++;
return;
@@ -341,7 +233,7 @@
_rightHandAnim->_top
);
- _vm->_gfx->maskClearRectangle(r);
+ _vm->_gfx->fillMaskRect(r, 0);
return;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list