aboutsummaryrefslogtreecommitdiff
path: root/sword2
diff options
context:
space:
mode:
authorPaweł Kołodziejski2004-01-12 19:08:04 +0000
committerPaweł Kołodziejski2004-01-12 19:08:04 +0000
commitb8e3dda84cd39f7bbd67c818acb42e7614bf7d02 (patch)
tree3d19112fc0c23d785b82eeebd0a792c49a9974f6 /sword2
parente4628fbb07c034362d4e46f9939bb49e8fb74dbb (diff)
downloadscummvm-rg350-b8e3dda84cd39f7bbd67c818acb42e7614bf7d02.tar.gz
scummvm-rg350-b8e3dda84cd39f7bbd67c818acb42e7614bf7d02.tar.bz2
scummvm-rg350-b8e3dda84cd39f7bbd67c818acb42e7614bf7d02.zip
- whitespaces
- fix for compilation at MAX, at include types - changed to our types svn-id: r12344
Diffstat (limited to 'sword2')
-rw-r--r--sword2/driver/animation.h25
-rw-r--r--sword2/driver/d_draw.h2
-rw-r--r--sword2/driver/render.cpp21
-rw-r--r--sword2/function.cpp2
4 files changed, 23 insertions, 27 deletions
diff --git a/sword2/driver/animation.h b/sword2/driver/animation.h
index 889a68d9fd..8060303a4c 100644
--- a/sword2/driver/animation.h
+++ b/sword2/driver/animation.h
@@ -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 @@ extern "C" {
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 @@ typedef struct {
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;
diff --git a/sword2/driver/d_draw.h b/sword2/driver/d_draw.h
index 3b29ccf02b..eefb71ca30 100644
--- a/sword2/driver/d_draw.h
+++ b/sword2/driver/d_draw.h
@@ -249,7 +249,7 @@ public:
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);
diff --git a/sword2/driver/render.cpp b/sword2/driver/render.cpp
index 7e05fa9919..5252453004 100644
--- a/sword2/driver/render.cpp
+++ b/sword2/driver/render.cpp
@@ -821,9 +821,8 @@ void Graphics::closeBackgroundLayer(void) {
}
-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 @@ void Graphics::plotYUV(unsigned char * lut, int width, int height, uint8_t * con
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;
}
}
diff --git a/sword2/function.cpp b/sword2/function.cpp
index 701a57c9e4..83da75a184 100644
--- a/sword2/function.cpp
+++ b/sword2/function.cpp
@@ -614,7 +614,7 @@ int32 Logic::fnPlayCredits(int32 *params) {
// credits. Note that musicTimeRemaining() will return 0 if the music
// is muted, so we need a sensible fallback for that case.
- uint32 musicLength = MAX(1000 * (_vm->_sound->musicTimeRemaining() - 3), 25 * scrollSteps);
+ uint32 musicLength = MAX(1000 * (_vm->_sound->musicTimeRemaining() - 3), 25 * (int32)scrollSteps);
while (scrollPos < scrollSteps && !_vm->_quit) {
bool foundStartLine = false;