[Scummvm-cvs-logs] CVS: scummvm/sword2/driver animation.h,1.1,1.2 d_draw.h,1.21,1.22 render.cpp,1.49,1.50
Pawel Kolodziejski
aquadran at users.sourceforge.net
Mon Jan 12 11:09:02 CET 2004
Update of /cvsroot/scummvm/scummvm/sword2/driver
In directory sc8-pr-cvs1:/tmp/cvs-serv18424/driver
Modified Files:
animation.h d_draw.h render.cpp
Log Message:
- whitespaces
- fix for compilation at MAX, at include types
- changed to our types
Index: animation.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sword2/driver/animation.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- animation.h 12 Jan 2004 11:11:19 -0000 1.1
+++ animation.h 12 Jan 2004 19:08:04 -0000 1.2
@@ -1,7 +1,6 @@
#ifndef ANIMATION_H
#define ANIMATION_H
-#include <inttypes.h>
#ifdef USE_MPEG2
extern "C" {
#include <mpeg2dec/mpeg2.h>
@@ -10,32 +9,30 @@
namespace Sword2 {
-#define SQR(x) ((x)*(x))
+#define SQR(x) ((x) * (x))
#define SHIFT 3
-#define BITDEPTH (1<<(8-SHIFT))
-#define ROUNDADD (1<<(SHIFT-1))
+#define BITDEPTH (1 << (8 - SHIFT))
+#define ROUNDADD (1 << (SHIFT - 1))
#define BUFFER_SIZE 4096
typedef struct {
-
-
int palnum;
- unsigned char lookup[2][BITDEPTH*BITDEPTH*BITDEPTH];
- unsigned char * lut;
- unsigned char * lut2;
+ byte lookup[2][BITDEPTH * BITDEPTH * BITDEPTH];
+ byte *lut;
+ byte *lut2;
int lutcalcnum;
int framenum;
#ifdef USE_MPEG2
- mpeg2dec_t * decoder;
- const mpeg2_info_t * info;
+ mpeg2dec_t *decoder;
+ const mpeg2_info_t *info;
#endif
- File * mpgfile;
+ File *mpgfile;
int curpal;
int cr;
@@ -44,10 +41,10 @@
struct {
int cnt;
int end;
- unsigned char pal[4*256];
+ byte pal[4 * 256];
} palettes[50];
- unsigned char buffer[BUFFER_SIZE];
+ byte buffer[BUFFER_SIZE];
PlayingSoundHandle bgSound;
Index: d_draw.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sword2/driver/d_draw.h,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -d -r1.21 -r1.22
--- d_draw.h 12 Jan 2004 11:10:30 -0000 1.21
+++ d_draw.h 12 Jan 2004 19:08:04 -0000 1.22
@@ -249,7 +249,7 @@
void plotPoint(uint16 x, uint16 y, uint8 colour);
void drawLine(int16 x1, int16 y1, int16 x2, int16 y2, uint8 colour);
- void plotYUV(unsigned char * lut, int width, int height, uint8_t * const * buf);
+ void plotYUV(byte *lut, int width, int height, uint8 *const *buf);
int32 createSurface(SpriteInfo *s, uint8 **surface);
void drawSurface(SpriteInfo *s, uint8 *surface, Common::Rect *clipRect = NULL);
Index: render.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sword2/driver/render.cpp,v
retrieving revision 1.49
retrieving revision 1.50
diff -u -d -r1.49 -r1.50
--- render.cpp 12 Jan 2004 11:10:30 -0000 1.49
+++ render.cpp 12 Jan 2004 19:08:04 -0000 1.50
@@ -821,9 +821,8 @@
}
-void Graphics::plotYUV(unsigned char * lut, int width, int height, uint8_t * const * dat)
-{
- uint8 *buf = _buffer + (40+(400-height)/2) * RENDERWIDE + (640-width)/2;
+void Graphics::plotYUV(byte *lut, int width, int height, byte *const *dat) {
+ byte *buf = _buffer + (40 + (400 - height) / 2) * RENDERWIDE + (640 - width) / 2;
int x, y;
@@ -831,17 +830,17 @@
int cpos = 0;
int linepos = 0;
- 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;
+ 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;
cpos++;
- buf[linepos ] = lut[i+((dat[0][ ypos ]+ROUNDADD)>>SHIFT)];
- buf[RENDERWIDE + linepos++] = lut[i+((dat[0][width+ypos++]+ROUNDADD)>>SHIFT)];
- buf[linepos ] = lut[i+((dat[0][ ypos ]+ROUNDADD)>>SHIFT)];
- buf[RENDERWIDE + linepos++] = lut[i+((dat[0][width+ypos++]+ROUNDADD)>>SHIFT)];
+ buf[linepos ] = lut[i + ((dat[0][ ypos ] + ROUNDADD) >> SHIFT)];
+ buf[RENDERWIDE + linepos++] = lut[i + ((dat[0][width + ypos++] + ROUNDADD) >> SHIFT)];
+ buf[linepos ] = lut[i + ((dat[0][ ypos ] + ROUNDADD) >> SHIFT)];
+ buf[RENDERWIDE + linepos++] = lut[i + ((dat[0][width + ypos++] + ROUNDADD) >> SHIFT)];
}
- linepos += (2*RENDERWIDE-width);
+ linepos += (2 * RENDERWIDE - width);
ypos += width;
}
}
More information about the Scummvm-git-logs
mailing list