diff options
-rw-r--r-- | engines/drascula/drascula.cpp | 51 | ||||
-rw-r--r-- | engines/drascula/drascula.h | 51 |
2 files changed, 50 insertions, 52 deletions
diff --git a/engines/drascula/drascula.cpp b/engines/drascula/drascula.cpp index 1ca80c37ed..932cb32b44 100644 --- a/engines/drascula/drascula.cpp +++ b/engines/drascula/drascula.cpp @@ -205,21 +205,21 @@ void DrasculaEngine::salir_al_dos(int r) { } void DrasculaEngine::asigna_memoria() { - dir_zona_pantalla = (char *)malloc(64000); + dir_zona_pantalla = (byte *)malloc(64000); assert(dir_zona_pantalla); - dir_dibujo1 = (char *)malloc(64000); + dir_dibujo1 = (byte *)malloc(64000); assert(dir_dibujo1); - dir_hare_fondo = (char *)malloc(64000); + dir_hare_fondo = (byte *)malloc(64000); assert(dir_hare_fondo); - dir_dibujo3 = (char *)malloc(64000); + dir_dibujo3 = (byte *)malloc(64000); assert(dir_dibujo3); - dir_dibujo2 = (char *)malloc(64000); + dir_dibujo2 = (byte *)malloc(64000); assert(dir_dibujo2); - dir_mesa = (char *)malloc(64000); + dir_mesa = (byte *)malloc(64000); assert(dir_mesa); - dir_hare_dch = (char *)malloc(64000); + dir_hare_dch = (byte *)malloc(64000); assert(dir_hare_dch); - dir_hare_frente = (char *)malloc(64000); + dir_hare_frente = (byte *)malloc(64000); assert(dir_hare_frente); } @@ -273,10 +273,10 @@ void DrasculaEngine::lee_dibujos(const char *NamePcc) { file.close(); } -void DrasculaEngine::descomprime_dibujo(char *dir_escritura, int plt) { +void DrasculaEngine::descomprime_dibujo(byte *dir_escritura, int plt) { memcpy(dir_escritura, Buffer_pcx, 64000); free(Buffer_pcx); - asigna_rgb((unsigned char *)cPal, plt); + asigna_rgb((byte *)cPal, plt); if (plt > 1) funde_rgb(plt); } @@ -290,7 +290,7 @@ void DrasculaEngine::paleta_hare() { } -void DrasculaEngine::asigna_rgb(unsigned char *dir_lectura, int plt) { +void DrasculaEngine::asigna_rgb(byte *dir_lectura, int plt) { int x, cnt = 0; for (x = 0; x < plt; x++) { @@ -348,7 +348,7 @@ void DrasculaEngine::setvgapalette256(byte *PalBuf) { } void DrasculaEngine::DIBUJA_FONDO(int xorg, int yorg, int xdes, int ydes, int Ancho, - int Alto, char *Origen, char *Destino) { + int Alto, byte *Origen, byte *Destino) { int x; Destino += xdes + ydes * 320; Origen += xorg + yorg * 320; @@ -360,7 +360,7 @@ void DrasculaEngine::DIBUJA_FONDO(int xorg, int yorg, int xdes, int ydes, int An } void DrasculaEngine::DIBUJA_BLOQUE(int xorg, int yorg, int xdes, int ydes, int Ancho, - int Alto, char *Origen, char *Destino) { + int Alto, byte *Origen, byte *Destino) { int y, x; Destino += xdes + ydes * 320; @@ -372,7 +372,7 @@ void DrasculaEngine::DIBUJA_BLOQUE(int xorg, int yorg, int xdes, int ydes, int A Destino[x + y * 320] = Origen[x + y * 320]; } -void DrasculaEngine::DIBUJA_BLOQUE_CUT(int *Array, char *Origen, char *Destino) { +void DrasculaEngine::DIBUJA_BLOQUE_CUT(int *Array, byte *Origen, byte *Destino) { int y, x; int xorg = Array[0]; int yorg = Array[1]; @@ -405,7 +405,7 @@ void DrasculaEngine::DIBUJA_BLOQUE_CUT(int *Array, char *Origen, char *Destino) Destino[x + y * 320] = Origen[x + y * 320]; } -void DrasculaEngine::VUELCA_PANTALLA(int xorg, int yorg, int xdes, int ydes, int Ancho, int Alto, char *Buffer) { +void DrasculaEngine::VUELCA_PANTALLA(int xorg, int yorg, int xdes, int ydes, int Ancho, int Alto, byte *Buffer) { int x; VGA += xdes + ydes * 320; @@ -465,8 +465,8 @@ void DrasculaEngine::escoba() { bucles: if (hare_se_mueve == 0) { - paso_x=PASO_HARE_X; - paso_y=PASO_HARE_Y; + paso_x = PASO_HARE_X; + paso_y = PASO_HARE_Y; } if (hare_se_mueve == 0 && anda_a_objeto==1) { sentido_hare = sentido_final; @@ -2120,7 +2120,7 @@ void DrasculaEngine::color_abc(int cl) { setvgapalette256((byte *)&palJuego); } -char DrasculaEngine::LimitaVGA(char valor) { +byte DrasculaEngine::LimitaVGA(byte valor) { return (valor & 0x3F) * (valor > 0); } @@ -2213,8 +2213,8 @@ void DrasculaEngine::anima(const char *animacion, int FPS) { int cnt = 2; TimeMed = CLOCKS_PER_SEC / FPS; - AuxBuffLast = (char *)malloc(65000); - AuxBuffDes = (char *)malloc(65000); + AuxBuffLast = (byte *)malloc(65000); + AuxBuffDes = (byte *)malloc(65000); FileIn.open(animacion); @@ -2224,7 +2224,7 @@ void DrasculaEngine::anima(const char *animacion, int FPS) { FileIn.read(&NFrames, sizeof(NFrames)); FileIn.read(&Leng, sizeof(Leng)); - AuxBuffOrg = (char *)malloc(Leng); + AuxBuffOrg = (byte *)malloc(Leng); FileIn.read(AuxBuffOrg, Leng); FileIn.read(cPal, 768); carga_pcx(AuxBuffOrg); @@ -2237,7 +2237,7 @@ void DrasculaEngine::anima(const char *animacion, int FPS) { WaitForNext(TimeMed); while (cnt < NFrames) { FileIn.read(&Leng, sizeof(Leng)); - AuxBuffOrg = (char *)malloc(Leng); + AuxBuffOrg = (byte *)malloc(Leng); FileIn.read(AuxBuffOrg, Leng); FileIn.read(cPal, 768); carga_pcx(AuxBuffOrg); @@ -2278,7 +2278,6 @@ void DrasculaEngine::FundeAlNegro(int VelocidadDeFundido) { for (color = 0; color < 256; color++) { for (componente = 0; componente < 3; componente++) { palFundido[color][componente] = LimitaVGA(palJuego[color][componente] - 63 + fundido); - palFundido[color][3] = 0; } } pausa(VelocidadDeFundido); @@ -3855,12 +3854,12 @@ int DrasculaEngine::chkkey() { return 0; } -char *DrasculaEngine::carga_pcx(char *NamePcc) { +byte *DrasculaEngine::carga_pcx(byte *NamePcc) { signed int con = 0; unsigned int X = 0; unsigned int fExit = 0; char ch, rep; - char *AuxPun; + byte *AuxPun; AuxPun = AuxBuffDes; @@ -3895,7 +3894,7 @@ float DrasculaEngine::vez() { return _system->getMillis() / 1000; } -void DrasculaEngine::reduce_hare_chico(int x1,int y1, int x2,int y2, int ancho,int alto, int factor, char *dir_inicio, char *dir_fin) { +void DrasculaEngine::reduce_hare_chico(int x1,int y1, int x2,int y2, int ancho,int alto, int factor, byte *dir_inicio, byte *dir_fin) { float suma_x, suma_y; int n, m; float pixel_x, pixel_y; diff --git a/engines/drascula/drascula.h b/engines/drascula/drascula.h index 00dda68433..213d860db1 100644 --- a/engines/drascula/drascula.h +++ b/engines/drascula/drascula.h @@ -354,21 +354,21 @@ public: void salir_al_dos(int r); void lee_dibujos(const char *); - void descomprime_dibujo(char *dir_escritura, int plt); + void descomprime_dibujo(byte *dir_escritura, int plt); - typedef unsigned char DacPalette256[256][3]; + typedef byte DacPalette256[256][3]; - void asigna_rgb(unsigned char *dir_lectura, int plt); + void asigna_rgb(byte *dir_lectura, int plt); void funde_rgb(int plt); void paleta_hare(); void ActualizaPaleta(); void setvgapalette256(byte *PalBuf); void DIBUJA_FONDO(int xorg, int yorg, int xdes, int ydes, int Ancho, - int Alto, char *Origen, char *Destino); + int Alto, byte *Origen, byte *Destino); void DIBUJA_BLOQUE(int xorg, int yorg, int xdes, int ydes, int Ancho, - int Alto, char *Origen, char *Destino); - void DIBUJA_BLOQUE_CUT(int *Array, char *Origen, char *Destino); - void VUELCA_PANTALLA(int xorg, int yorg, int xdes, int ydes, int Ancho, int Alto, char *Buffer); + int Alto, byte *Origen, byte *Destino); + void DIBUJA_BLOQUE_CUT(int *Array, byte *Origen, byte *Destino); + void VUELCA_PANTALLA(int xorg, int yorg, int xdes, int ydes, int Ancho, int Alto, byte *Buffer); DacPalette256 palJuego; DacPalette256 palHare; @@ -377,16 +377,16 @@ public: byte *VGA; - char *dir_dibujo1; - char *dir_hare_fondo; - char *dir_dibujo3; - char *dir_dibujo2; - char *dir_mesa; - char *dir_hare_dch; - char *dir_zona_pantalla; - char *dir_hare_frente; - char *dir_texto; - char *dir_pendulo; + byte *dir_dibujo1; + byte *dir_hare_fondo; + byte *dir_dibujo3; + byte *dir_dibujo2; + byte *dir_mesa; + byte *dir_hare_dch; + byte *dir_zona_pantalla; + byte *dir_hare_frente; + byte *dir_texto; + byte *dir_pendulo; byte cPal[768]; byte *Buffer_pcx; @@ -413,7 +413,7 @@ public: int con_voces; int menu_bar, menu_scr, hay_nombre; char texto_nombre[13]; - char key; + byte key; int flags[NUM_BANDERAS]; @@ -497,7 +497,7 @@ public: int resta_objeto(int osj); void fliplay(const char *filefli, int vel); void FundeDelNegro(int VelocidadDeFundido); - char LimitaVGA(char valor); + byte LimitaVGA(byte valor); void color_abc(int cl); void centra_texto(const char *,int,int); void comienza_sound(const char *); @@ -547,7 +547,7 @@ public: void introduce_nombre(); void para_grabar(char[]); int LookForFree(); - void OpenSSN(const char *Name,int Pause); + void OpenSSN(const char *Name, int Pause); void WaitFrameSSN(); void MixVideo(byte *OldScreen, byte *NewScreen); void Des_RLE(byte *BufferRLE, byte *MiVideoRLE); @@ -558,10 +558,9 @@ public: int PlayFrameSSN(); int chkkey(); - char *AuxBuffOrg; - char *AuxBuffLast; - char *AuxBuffDes; - //TODO duplicate char cPal[768]; + byte *AuxBuffOrg; + byte *AuxBuffLast; + byte *AuxBuffDes; int Leng; byte *pointer; @@ -579,11 +578,11 @@ public: long TimeLast; long TimeMed; - char *carga_pcx(char *NamePcc); + byte *carga_pcx(byte *NamePcc); void set_dac(byte *dac); void WaitForNext(long TimeMed); float vez(); - void reduce_hare_chico(int, int, int, int, int, int, int, char *,char *); + void reduce_hare_chico(int, int, int, int, int, int, int, byte *, byte *); char codifica(char); void cuadrante_1(); void cuadrante_2(); |