[Scummvm-cvs-logs] CVS: scummvm actor.cpp,1.92,1.93 boxes.cpp,1.36,1.37 boxes.h,1.4,1.5 costume.cpp,1.37,1.38 guimaps.h,1.6,1.7 scumm.h,1.183,1.184
Max Horn
fingolfin at users.sourceforge.net
Tue Jul 16 11:00:06 CEST 2002
Update of /cvsroot/scummvm/scummvm
In directory usw-pr-cvs1:/tmp/cvs-serv14468
Modified Files:
actor.cpp boxes.cpp boxes.h costume.cpp guimaps.h scumm.h
Log Message:
added costume.h; bumped build date in scumm.h (we have some quite big changes after all); switched ll and lr in the boxes code so that they really are what they are named after: lower left and right coords; removed some stuff from scumm.h/boxes.h
Index: actor.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/actor.cpp,v
retrieving revision 1.92
retrieving revision 1.93
diff -u -d -r1.92 -r1.93
--- actor.cpp 16 Jul 2002 14:54:48 -0000 1.92
+++ actor.cpp 16 Jul 2002 17:59:27 -0000 1.93
@@ -24,6 +24,7 @@
#include "scumm.h"
#include "actor.h"
#include "akos.h"
+#include "costume.h"
#include <math.h>
Index: boxes.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/boxes.cpp,v
retrieving revision 1.36
retrieving revision 1.37
diff -u -d -r1.36 -r1.37
--- boxes.cpp 16 Jul 2002 14:54:49 -0000 1.36
+++ boxes.cpp 16 Jul 2002 17:59:27 -0000 1.37
@@ -26,6 +26,38 @@
#include <math.h>
+#if !defined(__GNUC__)
+ #pragma START_PACK_STRUCTS
+#endif
+
+struct Box { /* Internal walkbox file format */
+ int16 ulx, uly;
+ int16 urx, ury;
+ int16 lrx, lry;
+ int16 llx, lly;
+ byte mask;
+ byte flags;
+ uint16 scale;
+} GCC_PACK;
+
+#if !defined(__GNUC__)
+ #pragma END_PACK_STRUCTS
+#endif
+
+struct PathNode { /* Linked list of walkpath nodes */
+ uint index;
+ struct PathNode *left, *right;
+};
+
+struct PathVertex { /* Linked list of walkpath nodes */
+ PathNode *left;
+ PathNode *right;
+};
+
+
+PathVertex *unkMatrixProc1(PathVertex *vtx, PathNode *node);
+
+
byte Scumm::getMaskFromBox(int box)
{
Box *ptr = getBoxBaseAddr(box);
@@ -106,23 +138,23 @@
getBoxCoordinates(b, &box);
- if (x < box.ul.x && x < box.ur.x && x < box.ll.x && x < box.lr.x)
+ if (x < box.ul.x && x < box.ur.x && x < box.lr.x && x < box.ll.x)
return 0;
- if (x > box.ul.x && x > box.ur.x && x > box.ll.x && x > box.lr.x)
+ if (x > box.ul.x && x > box.ur.x && x > box.lr.x && x > box.ll.x)
return 0;
- if (y < box.ul.y && y < box.ur.y && y < box.ll.y && y < box.lr.y)
+ if (y < box.ul.y && y < box.ur.y && y < box.lr.y && y < box.ll.y)
return 0;
- if (y > box.ul.y && y > box.ur.y && y > box.ll.y && y > box.lr.y)
+ if (y > box.ul.y && y > box.ur.y && y > box.lr.y && y > box.ll.y)
return 0;
- if (box.ul.x == box.ur.x && box.ul.y == box.ur.y && box.ll.x == box.lr.x && box.ll.y == box.lr.y ||
- box.ul.x == box.lr.x && box.ul.y == box.lr.y && box.ur.x == box.ll.x && box.ur.y == box.ll.y) {
+ if (box.ul.x == box.ur.x && box.ul.y == box.ur.y && box.lr.x == box.ll.x && box.lr.y == box.ll.y ||
+ box.ul.x == box.ll.x && box.ul.y == box.ll.y && box.ur.x == box.lr.x && box.ur.y == box.lr.y) {
ScummPoint pt;
- pt = closestPtOnLine(box.ul.x, box.ul.y, box.ll.x, box.ll.y, x, y);
+ pt = closestPtOnLine(box.ul.x, box.ul.y, box.lr.x, box.lr.y, x, y);
if (distanceFromPt(x, y, pt.x, pt.y) <= 4)
return 1;
}
@@ -130,13 +162,13 @@
if (!compareSlope(box.ul.x, box.ul.y, box.ur.x, box.ur.y, x, y))
return 0;
- if (!compareSlope(box.ur.x, box.ur.y, box.ll.x, box.ll.y, x, y))
+ if (!compareSlope(box.ur.x, box.ur.y, box.lr.x, box.lr.y, x, y))
return 0;
- if (!compareSlope(box.lr.x, box.lr.y, x, y, box.ll.x, box.ll.y))
+ if (!compareSlope(box.ll.x, box.ll.y, x, y, box.lr.x, box.lr.y))
return 0;
- if (!compareSlope(box.ul.x, box.ul.y, x, y, box.lr.x, box.lr.y))
+ if (!compareSlope(box.ul.x, box.ul.y, x, y, box.ll.x, box.ll.y))
return 0;
return 1;
@@ -266,19 +298,19 @@
return 1;
t = x - threshold;
- if (t > box.ul.x && t > box.ur.x && t > box.ll.x && t > box.lr.x)
+ if (t > box.ul.x && t > box.ur.x && t > box.lr.x && t > box.ll.x)
return 0;
t = x + threshold;
- if (t < box.ul.x && t < box.ur.x && t < box.ll.x && t < box.lr.x)
+ if (t < box.ul.x && t < box.ur.x && t < box.lr.x && t < box.ll.x)
return 0;
t = y - threshold;
- if (t > box.ul.y && t > box.ur.y && t > box.ll.y && t > box.lr.y)
+ if (t > box.ul.y && t > box.ur.y && t > box.lr.y && t > box.ll.y)
return 0;
t = y + threshold;
- if (t < box.ul.y && t < box.ur.y && t < box.ll.y && t < box.lr.y)
+ if (t < box.ul.y && t < box.ur.y && t < box.lr.y && t < box.ll.y)
return 0;
return 1;
@@ -302,7 +334,7 @@
best.y = pt.y;
}
- pt = closestPtOnLine(box.ur.x, box.ur.y, box.ll.x, box.ll.y, x, y);
+ pt = closestPtOnLine(box.ur.x, box.ur.y, box.lr.x, box.lr.y, x, y);
dist = distanceFromPt(x, y, pt.x, pt.y);
if (dist < bestdist) {
bestdist = dist;
@@ -310,7 +342,7 @@
best.y = pt.y;
}
- pt = closestPtOnLine(box.ll.x, box.ll.y, box.lr.x, box.lr.y, x, y);
+ pt = closestPtOnLine(box.lr.x, box.lr.y, box.ll.x, box.ll.y, x, y);
dist = distanceFromPt(x, y, pt.x, pt.y);
if (dist < bestdist) {
bestdist = dist;
@@ -318,7 +350,7 @@
best.y = pt.y;
}
- pt = closestPtOnLine(box.lr.x, box.lr.y, box.ul.x, box.ul.y, x, y);
+ pt = closestPtOnLine(box.ll.x, box.ll.y, box.ul.x, box.ul.y, x, y);
dist = distanceFromPt(x, y, pt.x, pt.y);
if (dist < bestdist) {
bestdist = dist;
@@ -488,15 +520,15 @@
}
tmp = box1.ul;
box1.ul = box1.ur;
- box1.ur = box1.ll;
- box1.ll = box1.lr;
- box1.lr = tmp;
+ box1.ur = box1.lr;
+ box1.lr = box1.ll;
+ box1.ll = tmp;
}
tmp = box2.ul;
box2.ul = box2.ur;
- box2.ur = box2.ll;
- box2.ll = box2.lr;
- box2.lr = tmp;
+ box2.ur = box2.lr;
+ box2.lr = box2.ll;
+ box2.ll = tmp;
}
return 0;
}
@@ -651,7 +683,7 @@
nukeResource(rtMatrix, 3);
}
-PathVertex *Scumm::unkMatrixProc1(PathVertex *vtx, PathNode *node)
+PathVertex *unkMatrixProc1(PathVertex *vtx, PathNode *node)
{
if (node == NULL || vtx == NULL)
return NULL;
@@ -790,24 +822,24 @@
tmp_y = box2.ul.y;
box2.ul.x = box2.ur.x;
box2.ul.y = box2.ur.y;
- box2.ur.x = box2.ll.x;
- box2.ur.y = box2.ll.y;
- box2.ll.x = box2.lr.x;
- box2.ll.y = box2.lr.y;
- box2.lr.x = tmp_x;
- box2.lr.y = tmp_y;
+ box2.ur.x = box2.lr.x;
+ box2.ur.y = box2.lr.y;
+ box2.lr.x = box2.ll.x;
+ box2.lr.y = box2.ll.y;
+ box2.ll.x = tmp_x;
+ box2.ll.y = tmp_y;
} while (--k);
tmp_x = box.ul.x;
tmp_y = box.ul.y;
box.ul.x = box.ur.x;
box.ul.y = box.ur.y;
- box.ur.x = box.ll.x;
- box.ur.y = box.ll.y;
- box.ll.x = box.lr.x;
- box.ll.y = box.lr.y;
- box.lr.x = tmp_x;
- box.lr.y = tmp_y;
+ box.ur.x = box.lr.x;
+ box.ur.y = box.lr.y;
+ box.lr.x = box.ll.x;
+ box.lr.y = box.ll.y;
+ box.ll.x = tmp_x;
+ box.ll.y = tmp_y;
} while (--j);
return result;
@@ -901,8 +933,8 @@
getBoxCoordinates(trap1, &box);
poly[0] = box.ul;
poly[1] = box.ur;
- poly[2] = box.ll;
- poly[3] = box.lr;
+ poly[2] = box.lr;
+ poly[3] = box.ll;
for (i = 0; i < 4; i++) {
abr = getClosestPtOnBox(trap2, poly[i].x, poly[i].y);
Dist[i] = abr.dist;
@@ -914,8 +946,8 @@
getBoxCoordinates(trap2, &box);
poly[4] = box.ul;
poly[5] = box.ur;
- poly[6] = box.ll;
- poly[7] = box.lr;
+ poly[6] = box.lr;
+ poly[7] = box.ll;
for (i = 4; i < 8; i++) {
abr = getClosestPtOnBox(trap1, poly[i].x, poly[i].y);
Dist[i] = abr.dist;
Index: boxes.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/boxes.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- boxes.h 1 May 2002 00:13:03 -0000 1.4
+++ boxes.h 16 Jul 2002 17:59:28 -0000 1.5
@@ -20,24 +20,10 @@
*
*/
-#if !defined(__GNUC__)
- #pragma START_PACK_STRUCTS
-#endif
+#ifndef BOXES_H
+#define BOXES_H
#define SIZEOF_BOX 20
-struct Box { /* Internal walkbox file format */
- int16 ulx,uly;
- int16 urx,ury;
- int16 llx,lly;
- int16 lrx,lry;
- byte mask;
- byte flags;
- uint16 scale;
-} GCC_PACK;
-
-#if !defined(__GNUC__)
- #pragma END_PACK_STRUCTS
-#endif
struct AdjustBoxResult { /* Result type of AdjustBox functions */
int16 x,y;
@@ -51,12 +37,8 @@
ScummPoint lr;
};
-struct PathNode { /* Linked list of walkpath nodes */
- uint index;
- struct PathNode *left, *right;
-};
+struct Box;
+struct PathNode;
+struct PathVertex;
-struct PathVertex { /* Linked list of walkpath nodes */
- PathNode *left;
- PathNode *right;
-};
+#endif
Index: costume.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/costume.cpp,v
retrieving revision 1.37
retrieving revision 1.38
diff -u -d -r1.37 -r1.38
--- costume.cpp 15 Jul 2002 22:56:24 -0000 1.37
+++ costume.cpp 16 Jul 2002 17:59:28 -0000 1.38
@@ -23,6 +23,7 @@
#include "stdafx.h"
#include "scumm.h"
#include "actor.h"
+#include "costume.h"
const byte revBitMask[8] = { 0x80, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x01 };
Index: guimaps.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/guimaps.h,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- guimaps.h 7 Jul 2002 22:44:29 -0000 1.6
+++ guimaps.h 16 Jul 2002 17:59:28 -0000 1.7
@@ -37,7 +37,7 @@
"Keys", //6
"About", //7
"Pocket ScummVM", //8
- "Build " SCUMMVM_VERSION "(" SCUMMVM_CVS ")", //9
+ "Build " SCUMMVM_VERSION " (" SCUMMVM_CVS ")", //9
"ScummVM http://scummvm.sourceforge.net", //10
"All games (c) LucasArts", //11
"Quit", //12
@@ -48,7 +48,7 @@
"Options", //17
"Misc", //18
"Show speech subtitles", //19
- "Amiga pallette conversion", //20
+ "Amiga palette conversion", //20
"Except:", //21
"Simon the Sorcerer (c) Adventuresoft", //22
"Close" //23
Index: scumm.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm.h,v
retrieving revision 1.183
retrieving revision 1.184
diff -u -d -r1.183 -r1.184
--- scumm.h 15 Jul 2002 22:56:24 -0000 1.183
+++ scumm.h 16 Jul 2002 17:59:28 -0000 1.184
@@ -28,7 +28,7 @@
#include "sound/mixer.h"
#define SCUMMVM_VERSION "0.2.2 CVS"
-#define SCUMMVM_CVS "070802"
+#define SCUMMVM_CVS "2002-07-16"
#define SWAP(a,b) do{int tmp=a; a=b; b=tmp; } while(0)
#define ARRAYSIZE(x) (sizeof(x)/sizeof(x[0]))
@@ -351,87 +351,6 @@
void addLinebreaks(int a, byte *str, int pos, int maxwidth);
};
-class LoadedCostume {
-protected:
- Scumm *_vm;
-
-public:
- byte *_ptr;
- byte *_dataptr;
- byte _numColors;
-
- LoadedCostume(Scumm *vm) : _vm(vm), _ptr(0), _dataptr(0), _numColors(0) {}
-
- void loadCostume(int id);
- byte increaseAnims(Actor *a);
-
-protected:
- byte increaseAnim(Actor *a, int slot);
-};
-
-class CostumeRenderer {
-protected:
- Scumm *_vm;
-
- LoadedCostume _loaded;
-
-public:
- byte *_shadow_table;
-
- byte *_frameptr;
- byte *_srcptr;
- byte *_bgbak_ptr, *_backbuff_ptr, *_mask_ptr, *_mask_ptr_dest;
- int _actorX, _actorY;
- byte _zbuf;
- uint _scaleX, _scaleY;
- int _xmove, _ymove;
- bool _mirror;
- byte _maskval;
- byte _shrval;
- byte _width2;
- int _width;
- byte _height2;
- int _height;
- int _xpos, _ypos;
-
- uint _outheight;
- int _scaleIndexXStep;
- int _scaleIndexYStep;
- byte _scaleIndexX; /* must wrap at 256 */
- byte _scaleIndexY, _scaleIndexYTop;
- int _left, _right;
- int _dir2;
- int _top, _bottom;
- int _ypostop;
- int _ypitch;
- byte _docontinue;
- int _imgbufoffs;
- byte _repcolor;
- byte _replen;
- byte _palette[32];
- byte _transEffect[0x100];
-
- void proc6();
- void proc5();
- void proc4();
- void proc3();
- void proc2();
- void proc1();
- void proc_special(Actor *a, byte mask);
- byte mainRoutine(Actor *a, int slot, int frame);
- void ignorePakCols(int num);
-
- byte drawOneSlot(Actor *a, int slot);
- byte drawCostume(Actor *a);
-
- void setPalette(byte *palette);
- void setFacing(uint16 facing);
- void setCostume(int costume);
-
-public:
- CostumeRenderer(Scumm *vm) : _vm(vm), _loaded(vm) {}
-};
-
#define ARRAY_HDR_SIZE 6
struct ArrayHeader {
int16 dim1_size;
@@ -1183,7 +1102,6 @@
uint16 _extraBoxFlags[65];
int16 _foundPathX, _foundPathY;
- PathVertex *unkMatrixProc1(PathVertex *vtx, PathNode *node);
PathNode *unkMatrixProc2(PathVertex *vtx, int i);
bool areBoxesNeighbours(int i, int j);
void addToBoxMatrix(byte b);
More information about the Scummvm-git-logs
mailing list