diff options
author | Eugene Sandulenko | 2016-09-14 23:48:01 +0200 |
---|---|---|
committer | Eugene Sandulenko | 2017-01-25 22:41:54 +0100 |
commit | 0fbe26e06ac2a9f128a102f5a291aad715f9e2a2 (patch) | |
tree | e39154a8a22aad054ce9b6b757eef6d0ca383b89 /engines/cryo/cryolib.h | |
parent | 85ba17c475f154c6e670e0fcd22642d680d85e6c (diff) | |
download | scummvm-rg350-0fbe26e06ac2a9f128a102f5a291aad715f9e2a2.tar.gz scummvm-rg350-0fbe26e06ac2a9f128a102f5a291aad715f9e2a2.tar.bz2 scummvm-rg350-0fbe26e06ac2a9f128a102f5a291aad715f9e2a2.zip |
CRYO: Use standard ScummVM types
Diffstat (limited to 'engines/cryo/cryolib.h')
-rw-r--r-- | engines/cryo/cryolib.h | 182 |
1 files changed, 91 insertions, 91 deletions
diff --git a/engines/cryo/cryolib.h b/engines/cryo/cryolib.h index 1262c75d42..7bc324c8b4 100644 --- a/engines/cryo/cryolib.h +++ b/engines/cryo/cryolib.h @@ -44,8 +44,8 @@ namespace Cryo { #define BE16(n) SW16(n) #define BE32(n) SW32(n) #endif -#define PLE16(p) ( (((unsigned char*)(p))[1] << 8) | ((unsigned char*)(p))[0] ) -#define PLE32(p) ( (((unsigned char*)(p))[3] << 24) | (((unsigned char*)(p))[2] << 16) | (((unsigned char*)(p))[1] << 8) | ((unsigned char*)(p))[0] ) +#define PLE16(p) ( (((byte*)(p))[1] << 8) | ((byte*)(p))[0] ) +#define PLE32(p) ( (((byte*)(p))[3] << 24) | (((byte*)(p))[2] << 16) | (((byte*)(p))[1] << 8) | ((byte*)(p))[0] ) typedef void *SndChannel; typedef char *Handle; @@ -53,11 +53,11 @@ enum { fsFromStart = 1 }; -extern short __debug2; +extern int16 __debug2; -extern short __debug, __libError, __osError; +extern int16 __debug, __libError, __osError; -#define CLBeginCheck { short __oldDebug = __debug; __debug = -1; +#define CLBeginCheck { int16 __oldDebug = __debug; __debug = -1; #define CLEndCheck __debug = __oldDebug; } #define CLNoError __libError = 0; @@ -79,12 +79,12 @@ struct rect_t { typedef struct rect_t rect_t; struct view_t { - unsigned char *p_buffer; + byte *p_buffer; int width; int height; - short pitch; - short doubled; - short allocated; + int16 pitch; + int16 doubled; + int16 allocated; struct { int src_left; int src_top; @@ -97,12 +97,12 @@ struct view_t { typedef struct view_t view_t; struct color3_t { - short r, g, b; + int16 r, g, b; }; typedef struct color3_t color3_t; struct color_t { - short a, r, g, b; + int16 a, r, g, b; }; typedef struct color_t color_t; @@ -118,15 +118,15 @@ struct hnmheader_t { char flag2; char reseverd; char bpp; - unsigned short width; - unsigned short height; + uint16 width; + uint16 height; int filesize; int nframe; int table_offset; - short speed; - short maxbuffer; + int16 speed; + int16 maxbuffer; int buffersize; - short ff_20; + int16 ff_20; char reserved2[14]; char copyright[16]; }; @@ -138,18 +138,18 @@ struct hnm_t { int ff_4; file_t *file; hnmheader_t header; - unsigned char *work_buffer[2]; - unsigned char *final_buffer; - unsigned char *new_frame_buffer; - unsigned char *old_frame_buffer; - unsigned char *read_buffer; - unsigned char *data_ptr; + byte *work_buffer[2]; + byte *final_buffer; + byte *new_frame_buffer; + byte *old_frame_buffer; + byte *read_buffer; + byte *data_ptr; color_t palette[256]; - short can_loop; + int16 can_loop; - short ff_896; - short chunk_id; + int16 ff_896; + int16 chunk_id; int total_read; }; typedef struct hnm_t hnm_t; @@ -160,23 +160,23 @@ typedef struct hnm_t hnm_t; struct sound_t { Handle sndHandle; - short headerLen; + int16 headerLen; long headerOffset; - short ff_A; + int16 ff_A; char *buffer; int ff_16; - short ff_1A; + int16 ff_1A; float rate; - short sampleSize; + int16 sampleSize; int length; - short mode; - volatile short locked; + int16 mode; + volatile int16 locked; long loopStart; - short loopTimes; - short reversed; - short ff_32; - short volume; + int16 loopTimes; + int16 reversed; + int16 ff_32; + int16 volume; }; typedef struct sound_t sound_t; @@ -184,10 +184,10 @@ typedef struct sound_t sound_t; struct soundgroup_t { sound_t *sound[CL_MAX_SOUNDS]; - short numSounds; - short soundIndex; - short playIndex; - short ff_106; + int16 numSounds; + int16 soundIndex; + int16 playIndex; + int16 ff_106; }; typedef struct soundgroup_t soundgroup_t; @@ -197,13 +197,13 @@ struct soundchannel_t { Audio::SoundHandle ch; int xx; - short volumeLeft; - short volumeRight; - short numSounds; + int16 volumeLeft; + int16 volumeRight; + int16 numSounds; sound_t *sounds[CL_MAX_CH_SOUNDS]; - short ff_536; + int16 ff_536; }; typedef struct soundchannel_t soundchannel_t; @@ -211,15 +211,15 @@ extern volatile long TimerTicks; extern view_t ScreenView; -soundgroup_t *CLSoundGroup_New(short numSounds, short arg4, short sampleSize, float rate, short mode); +soundgroup_t *CLSoundGroup_New(int16 numSounds, int16 arg4, int16 sampleSize, float rate, int16 mode); void CLSoundGroup_Free(soundgroup_t *sg); void CLSoundGroup_Reverse16All(soundgroup_t *sg); void *CLSoundGroup_GetNextBuffer(soundgroup_t *sg); -short CLSoundGroup_AssignDatas(soundgroup_t *sg, void *buffer, int length, short isSigned); -short CLSoundGroup_SetDatas(soundgroup_t *sg, void *data, int length, short isSigned); +int16 CLSoundGroup_AssignDatas(soundgroup_t *sg, void *buffer, int length, int16 isSigned); +int16 CLSoundGroup_SetDatas(soundgroup_t *sg, void *data, int length, int16 isSigned); void CLSoundGroup_PlayNextSample(soundgroup_t *sg, soundchannel_t *ch); -sound_t *CLSoundRaw_New(short arg1, float rate, short sampleSize, short mode); +sound_t *CLSoundRaw_New(int16 arg1, float rate, int16 sampleSize, int16 mode); void CLSoundRaw_Free(sound_t *sound); void CLSoundRaw_AssignBuffer(sound_t *sound, void *buffer, int bufferOffs, int length); @@ -227,16 +227,16 @@ char *c2pstr(char *s); void DebugStr(char *s); void *CLMemory_Alloc(int size); void CLMemory_Free(void *ptr); -short MemError(); +int16 MemError(); void SysBeep(int x); long TickCount(); -void FlushEvents(short arg1, short arg2); +void FlushEvents(int16 arg1, int16 arg2); void CLBlitter_CopyViewRect(view_t *view1, view_t *view2, rect_t *rect1, rect_t *rect2); -void CLBlitter_Send2ScreenNextCopy(color_t *palette, unsigned short first, unsigned short count); +void CLBlitter_Send2ScreenNextCopy(color_t *palette, uint16 first, uint16 count); void CLBlitter_OneBlackFlash(); -void CLBlitter_CopyView2ViewSimpleSize(unsigned char *src, short srcw, short srcp, short srch, - unsigned char *dst, short dstw, short dstp, short dsth); +void CLBlitter_CopyView2ViewSimpleSize(byte *src, int16 srcw, int16 srcp, int16 srch, + byte *dst, int16 dstw, int16 dstp, int16 dsth); void CLBlitter_CopyView2ScreenCUSTOM(view_t *view); void CLBlitter_CopyView2Screen(view_t *view); void CLBlitter_UpdateScreen(); @@ -244,13 +244,13 @@ void CLBlitter_FillView(view_t *view, unsigned int fill); void CLBlitter_FillScreenView(unsigned int fill); void CLPalette_Init(); -void CLPalette_SetLastPalette(color_t *palette, short first, short count); +void CLPalette_SetLastPalette(color_t *palette, int16 first, int16 count); void CLPalette_GetLastPalette(color_t *palette); -void CLPalette_SetRGBColor(color_t *palette, unsigned short index, color3_t *rgb); -void CLPalette_Macintize(short macintize); -void CLPalette_SetInterval(unsigned short first, unsigned short last); +void CLPalette_SetRGBColor(color_t *palette, uint16 index, color3_t *rgb); +void CLPalette_Macintize(int16 macintize); +void CLPalette_SetInterval(uint16 first, uint16 last); void CLPalette_DeactivateInterval(); -void CLPalette_Send2Screen(struct color_t *palette, unsigned short first, unsigned short count); +void CLPalette_Send2Screen(struct color_t *palette, uint16 first, uint16 count); void CLPalette_BeBlack(); void CLPalette_BeSystem(); @@ -259,35 +259,35 @@ void CLFile_SetFinderInfos(void *fs, int a4, int a5); void CLFile_GetFullPath(void *a3, char *a4); void CLFile_MakeStruct(int a3, int a4, char *name, filespec_t *fs); void CLFile_Create(filespec_t *fs); -void CLFile_Open(filespec_t *fs, short mode, file_t &handle); +void CLFile_Open(filespec_t *fs, int16 mode, file_t &handle); void CLFile_Close(file_t &handle); -void CLFile_SetPosition(file_t &handle, short mode, long pos); +void CLFile_SetPosition(file_t &handle, int16 mode, long pos); void CLFile_Read(file_t &handle, void *buffer, long *size); void CLFile_Write(file_t &handle, void *buffer, long *size); -void CLSound_PrepareSample(sound_t *sound, short mode); -void CLSound_SetWantsDesigned(short designed); +void CLSound_PrepareSample(sound_t *sound, int16 mode); +void CLSound_SetWantsDesigned(int16 designed); void CLSound_SetLength(sound_t *sound, int length); soundchannel_t *CLSoundChannel_New(int arg1); void CLSoundChannel_Free(soundchannel_t *ch); void CLSoundChannel_Stop(soundchannel_t *ch); void CLSoundChannel_Play(soundchannel_t *ch, sound_t *sound); -short CLSoundChannel_GetVolume(soundchannel_t *ch); -void CLSoundChannel_SetVolume(soundchannel_t *ch, short volume); -void CLSoundChannel_SetVolumeRight(soundchannel_t *ch, short volume); -void CLSoundChannel_SetVolumeLeft(soundchannel_t *ch, short volume); +int16 CLSoundChannel_GetVolume(soundchannel_t *ch); +void CLSoundChannel_SetVolume(soundchannel_t *ch, int16 volume); +void CLSoundChannel_SetVolumeRight(soundchannel_t *ch, int16 volume); +void CLSoundChannel_SetVolumeLeft(soundchannel_t *ch, int16 volume); -short CLKeyboard_HasCmdDown(); +int16 CLKeyboard_HasCmdDown(); void CLKeyboard_Read(); -unsigned char CLKeyboard_GetLastASCII(); -short CLKeyboard_IsScanCodeDown(short scancode); +byte CLKeyboard_GetLastASCII(); +int16 CLKeyboard_IsScanCodeDown(int16 scancode); void CLMouse_Hide(); void CLMouse_Show(); -void CLMouse_GetPosition(short *x, short *y); -void CLMouse_SetPosition(short x, short y); -unsigned short CLMouse_IsDown(); +void CLMouse_GetPosition(int16 *x, int16 *y); +void CLMouse_SetPosition(int16 x, int16 y); +uint16 CLMouse_IsDown(); void CLView_SetSrcZoomValues(view_t *view, int x, int y); void CLView_SetDisplayZoomValues(view_t *view, int w, int h); @@ -306,37 +306,37 @@ void CRYOLib_Done(); void CRYOLib_MinimalInit(); void CRYOLib_ManagersInit(); void CRYOLib_ManagersDone(); -void CRYOLib_SetDebugMode(short enable); +void CRYOLib_SetDebugMode(int16 enable); void CRYOLib_InstallEmergencyExit(void(*proc)()); void CRYOLib_SetupEnvironment(); void CRYOLib_RestoreEnvironment(); void CRYOLib_TestConfig(); -short CLComputer_Has68030(); -short CLComputer_Has68040(); +int16 CLComputer_Has68030(); +int16 CLComputer_Has68040(); void CLDesktop_TestOpenFileAtStartup(); -void CLHNM_DecompLempelZiv(unsigned char *buffer, unsigned char *output); -void CLHNM_DecompUBA(unsigned char *output, unsigned char *curr_buffer, unsigned char *prev_buffer, - unsigned char *input, int width, char flags); +void CLHNM_DecompLempelZiv(byte *buffer, byte *output); +void CLHNM_DecompUBA(byte *output, byte *curr_buffer, byte *prev_buffer, + byte *input, int width, char flags); void CLHNM_Init(); void CLHNM_Done(); void CLHNM_SetupTimer(float rate); void CLHNM_WaitLoop(hnm_t *hnm); -void CLHNM_SetupSound(short numSounds, short arg4, short sampleSize, float rate, short mode); -void CLHNM_SetupSoundADPCM(short numSounds, short arg4, short sampleSize, float rate, short mode); +void CLHNM_SetupSound(int16 numSounds, int16 arg4, int16 sampleSize, float rate, int16 mode); +void CLHNM_SetupSoundADPCM(int16 numSounds, int16 arg4, int16 sampleSize, float rate, int16 mode); void CLHNM_CloseSound(); -void CLHNM_SetForceZero2Black(short forceblack); +void CLHNM_SetForceZero2Black(int16 forceblack); hnm_t *CLHNM_New(int preload_size); void CLHNM_Dispose(hnm_t *hnm); void CLHNM_SetFile(hnm_t *hnm, file_t *file); -void CLHNM_SetFinalBuffer(hnm_t *hnm, unsigned char *buffer); +void CLHNM_SetFinalBuffer(hnm_t *hnm, byte *buffer); void CLHNM_AllocMemory(hnm_t *hnm); void CLHNM_DeallocMemory(hnm_t *hnm); void CLHNM_Read(hnm_t *hnm, int size); void CLHNM_GiveTime(hnm_t *hnm); -void CLHNM_CanLoop(hnm_t *hnm, short can_loop); +void CLHNM_CanLoop(hnm_t *hnm, int16 can_loop); void CLHNM_SelectBuffers(hnm_t *hnm); void CLHNM_ChangePalette(hnm_t *hnm); void CLHNM_Desentrelace(hnm_t *hnm); @@ -345,20 +345,20 @@ soundchannel_t *CLHNM_GetSoundChannel(); void CLHNM_TryRead(hnm_t *hnm, int size); void CLHNM_ResetInternalTimer(); void CLHNM_Reset(hnm_t *hnm); -short CLHNM_LoadFrame(hnm_t *hnm); -void CLHNM_WantsSound(short sound); -void CLHNM_LoadDecompTable(short *buffer); -void CLHNM_DecompADPCM(unsigned char *buffer, short *output, int size); -void CLHNM_SoundInADPCM(short is_adpcm); -void CLHNM_SoundMono(short is_mono); -short CLHNM_NextElement(hnm_t *hnm); +int16 CLHNM_LoadFrame(hnm_t *hnm); +void CLHNM_WantsSound(int16 sound); +void CLHNM_LoadDecompTable(int16 *buffer); +void CLHNM_DecompADPCM(byte *buffer, int16 *output, int size); +void CLHNM_SoundInADPCM(int16 is_adpcm); +void CLHNM_SoundMono(int16 is_mono); +int16 CLHNM_NextElement(hnm_t *hnm); void CLHNM_ReadHeader(hnm_t *hnm); -short CLHNM_GetVersion(hnm_t *hnm); +int16 CLHNM_GetVersion(hnm_t *hnm); int CLHNM_GetFrameNum(hnm_t *hnm); void CLHNM_DeactivatePreloadBuffer(); void CLHNM_Prepare2Read(hnm_t *hnm, int mode); void CLHNM_SetPosIntoFile(hnm_t *hnm, long pos); -void CLHNM_Desentrelace320(unsigned char *frame_buffer, unsigned char *final_buffer, unsigned short height); +void CLHNM_Desentrelace320(byte *frame_buffer, byte *final_buffer, uint16 height); } // End of namespace Cryo |