aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorVincent Hamm2007-11-03 22:44:27 +0000
committerVincent Hamm2007-11-03 22:44:27 +0000
commit121fc7d5691a3409f7501e3e8e2ae6ecff7abf94 (patch)
tree9ee89b0bee236da2e156937b6fa50704e59713f8 /engines
parent2e6b14539a9e5674fbb91002b619aecbf2e664c8 (diff)
downloadscummvm-rg350-121fc7d5691a3409f7501e3e8e2ae6ecff7abf94.tar.gz
scummvm-rg350-121fc7d5691a3409f7501e3e8e2ae6ecff7abf94.tar.bz2
scummvm-rg350-121fc7d5691a3409f7501e3e8e2ae6ecff7abf94.zip
More polygon fix
svn-id: r29390
Diffstat (limited to 'engines')
-rw-r--r--engines/cruise/mainDraw.cpp19
1 files changed, 11 insertions, 8 deletions
diff --git a/engines/cruise/mainDraw.cpp b/engines/cruise/mainDraw.cpp
index d8741f30ec..3cd3316d06 100644
--- a/engines/cruise/mainDraw.cpp
+++ b/engines/cruise/mainDraw.cpp
@@ -248,8 +248,7 @@ void blitPolyMode2(char *dest, int16 * buffer, char color)
int XMIN = XMIN_XMAX[1+i*2];
int XMAX = XMIN_XMAX[1+i*2+1];
- if(XMAX > 0)
- line(XMIN, currentY, XMAX, currentY, color);
+ line(XMIN, currentY, XMAX, currentY, color);
}
/* int i;
@@ -402,7 +401,7 @@ void buildSegment(void)
do
{
- if((BX < ptrMax) && (BX > ptrMini)) // are we in screen ?
+ if((BX <= ptrMax) && (BX >= ptrMini)) // are we in screen ?
{
if(CX < BX[0])
BX[0] = CX;
@@ -588,7 +587,7 @@ void buildSegment(void)
}while(--segCount);
}
-char *drawPolyMode1(char *dataPointer, int linesToDraw) {
+unsigned char *drawPolyMode1(unsigned char *dataPointer, int linesToDraw) {
int index;
int16 *pBufferDest;
@@ -638,7 +637,7 @@ char *drawPolyMode1(char *dataPointer, int linesToDraw) {
return dataPointer;
}
-char *drawPolyMode2(char *dataPointer, int linesToDraw)
+unsigned char *drawPolyMode2(unsigned char *dataPointer, int linesToDraw)
{
int index;
int16 *pBufferDest;
@@ -805,10 +804,12 @@ void buildPolyModel(int positionX, int positionY, int scale, char *pMask, char *
// position of the dataPointer is m_coordCount * 2
+ int polygonCount = 0;
+
do {
int linesToDraw = *dataPointer++;
- if (linesToDraw > 1) { // if value not zero
+ if (linesToDraw > 1){ // if value not zero
uint16 minimumScale;
m_color = *dataPointer; // color
@@ -822,9 +823,9 @@ void buildPolyModel(int positionX, int positionY, int scale, char *pMask, char *
if (minimumScale <= scale)
{
if (m_flipLeftRight) {
- drawPolyMode1((char *)dataPointer, linesToDraw);
+ drawPolyMode1((unsigned char *)dataPointer, linesToDraw);
} else {
- drawPolyMode2((char *)dataPointer, linesToDraw);
+ drawPolyMode2((unsigned char *)dataPointer, linesToDraw);
}
if (destBuffer) {
@@ -840,6 +841,8 @@ void buildPolyModel(int positionX, int positionY, int scale, char *pMask, char *
} else {
dataPointer += 4;
}
+
+ polygonCount ++;
} while (*dataPointer != 0xFF);
}