[Scummvm-cvs-logs] CVS: scummvm/sword2/driver animation.cpp,1.27,1.28 animation.h,1.20,1.21 render.cpp,1.56,1.57
James Brown
ender at users.sourceforge.net
Sun Feb 29 20:24:31 CET 2004
- Previous message: [Scummvm-cvs-logs] CVS: scummvm/sword1 animation.cpp,1.15,1.16 animation.h,1.6,1.7 screen.cpp,1.40,1.41
- Next message: [Scummvm-cvs-logs] CVS: scummvm/scumm script_v7he.cpp,NONE,2.1 intern.h,2.144,2.145 module.mk,1.34,1.35 scummvm.cpp,2.593,2.594
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Update of /cvsroot/scummvm/scummvm/sword2/driver
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7263/sword2/driver
Modified Files:
animation.cpp animation.h render.cpp
Log Message:
Fix from Roever for bug #892827
Index: animation.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sword2/driver/animation.cpp,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -d -r1.27 -r1.28
--- animation.cpp 1 Mar 2004 00:32:47 -0000 1.27
+++ animation.cpp 1 Mar 2004 04:05:10 -0000 1.28
@@ -178,16 +178,16 @@
pos = 0;
}
- if (cr >= BITDEPTH)
+ if (cr > BITDEPTH)
return;
for (ii = 0; ii < lines; ii++) {
r = (-16 * 256 + (int) (256 * 1.596) * ((cr << SHIFT) - 128)) / 256;
- for (cb = 0; cb < BITDEPTH; cb++) {
+ for (cb = 0; cb <= BITDEPTH; cb++) {
g = (-16 * 256 - (int) (0.813 * 256) * ((cr << SHIFT) - 128) - (int) (0.391 * 256) * ((cb << SHIFT) - 128)) / 256;
b = (-16 * 256 + (int) (2.018 * 256) * ((cb << SHIFT) - 128)) / 256;
- for (y = 0; y < BITDEPTH; y++) {
+ for (y = 0; y <= BITDEPTH; y++) {
int idx, bst = 0;
int dis = 2 * SQR(r - palettes[p].pal[0]) + 4 * SQR(g - palettes[p].pal[1]) + SQR(b - palettes[p].pal[2]);
@@ -204,10 +204,10 @@
g += (1 << SHIFT);
b += (1 << SHIFT);
}
- r -= 256;
+ r -= (BITDEPTH+1)*(1 << SHIFT);
}
cr++;
- if (cr >= BITDEPTH)
+ if (cr > BITDEPTH)
return;
}
}
@@ -235,14 +235,14 @@
if (lookup)
return;
- lookup = (OverlayColor *)calloc(BITDEPTH * BITDEPTH * 256, sizeof(OverlayColor));
+ lookup = (OverlayColor *)calloc((BITDEPTH+1) * (BITDEPTH+1) * 256, sizeof(OverlayColor));
int y, cb, cr;
int r, g, b;
int pos = 0;
- for (cr = 0; cr < BITDEPTH; cr++) {
- for (cb = 0; cb < BITDEPTH; cb++) {
+ for (cr = 0; cr <= BITDEPTH; cr++) {
+ for (cb = 0; cb <= BITDEPTH; cb++) {
for (y = 0; y < 256; y++) {
r = ((y - 16) * 256 + (int) (256 * 1.596) * ((cr << SHIFT) - 128)) / 256;
g = ((y - 16) * 256 - (int) (0.813 * 256) * ((cr << SHIFT) - 128) - (int) (0.391 * 256) * ((cb << SHIFT) - 128)) / 256;
@@ -274,7 +274,7 @@
for (y = 0; y < height; y += 2) {
for (x = 0; x < width; x += 2) {
- int i = ((((dat[2][cpos] + ROUNDADD) >> SHIFT) * BITDEPTH) + ((dat[1][cpos] + ROUNDADD)>>SHIFT)) * 256;
+ int i = ((((dat[2][cpos] + ROUNDADD) >> SHIFT) * (BITDEPTH+1)) + ((dat[1][cpos] + ROUNDADD)>>SHIFT)) * 256;
cpos++;
ptr[linepos ] = lut[i + dat[0][ ypos ]];
Index: animation.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sword2/driver/animation.h,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -d -r1.20 -r1.21
--- animation.h 28 Feb 2004 12:58:13 -0000 1.20
+++ animation.h 1 Mar 2004 04:05:10 -0000 1.21
@@ -90,7 +90,7 @@
int palnum;
int maxPalnum;
- byte lookup[2][BITDEPTH * BITDEPTH * BITDEPTH];
+ byte lookup[2][(BITDEPTH+1) * (BITDEPTH+1) * (BITDEPTH+1)];
byte *lut;
byte *lut2;
int lutcalcnum;
Index: render.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sword2/driver/render.cpp,v
retrieving revision 1.56
retrieving revision 1.57
diff -u -d -r1.56 -r1.57
--- render.cpp 7 Feb 2004 15:09:13 -0000 1.56
+++ render.cpp 1 Mar 2004 04:05:10 -0000 1.57
@@ -841,7 +841,7 @@
for (y = 0; y < height; y += 2) {
for (x = 0; x < width; x += 2) {
- int i = ((((dat[2][cpos] + ROUNDADD) >> SHIFT) * BITDEPTH) + ((dat[1][cpos] + ROUNDADD)>>SHIFT)) * BITDEPTH;
+ int i = ((((dat[2][cpos] + ROUNDADD) >> SHIFT) * (BITDEPTH+1)) + ((dat[1][cpos] + ROUNDADD)>>SHIFT)) * (BITDEPTH+1);
cpos++;
buf[linepos ] = lut[i + ((dat[0][ ypos ] + ROUNDADD) >> SHIFT)];
- Previous message: [Scummvm-cvs-logs] CVS: scummvm/sword1 animation.cpp,1.15,1.16 animation.h,1.6,1.7 screen.cpp,1.40,1.41
- Next message: [Scummvm-cvs-logs] CVS: scummvm/scumm script_v7he.cpp,NONE,2.1 intern.h,2.144,2.145 module.mk,1.34,1.35 scummvm.cpp,2.593,2.594
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the Scummvm-git-logs
mailing list