123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252 |
- #ifndef _PALUTILS_H
- #define _PALUTILS_H
- #include "common.h"
- typedef LPBYTE LPSPRITE, LPBITMAPRLE
- typedef LPCBYTE LPCSPRITE, LPCBITMAPRLE
- #ifndef PAL_POS_DEFINED
- #define PAL_POS_DEFINED
- typedef DWORD PAL_POS
- #endif
- #define PAL_XY(x, y) (PAL_POS)(((((WORD)(y)) << 16) & 0xFFFF0000) | (((WORD)(x)) & 0xFFFF))
- #define PAL_X(xy) (SHORT)((xy) & 0xFFFF)
- #define PAL_Y(xy) (SHORT)(((xy) >> 16) & 0xFFFF)
- #define PAL_XY_OFFSET(xy, x, y) (PAL_POS)(((((INT)(y) << 16) & 0xFFFF0000) + ((xy) & 0xFFFF0000)) | (((INT)(x) & 0xFFFF) + ((xy) & 0xFFFF)))
- #define MAX_PLAYERS_IN_PARTY 3
- #define MAX_PLAYER_ROLES 6
- #define MAX_PLAYABLE_PLAYER_ROLES 5
- #define MAX_INVENTORY 256
- #define MAX_STORE_ITEM 9
- #define NUM_MAGIC_ELEMENTAL 5
- #define MAX_ENEMIES_IN_TEAM 5
- #define MAX_PLAYER_EQUIPMENTS 6
- #define MAX_PLAYER_MAGICS 32
- #define MAX_SCENES 300
- #define MAX_OBJECTS 600
- #define MAX_EVENT_OBJECTS 5500
- #define MAX_POISONS 16
- #define MAX_LEVELS 99
- #define OBJECT_ITEM_START 0x3D
- #define OBJECT_ITEM_END 0x126
- #define OBJECT_MAGIC_START 0x127
- #define OBJECT_MAGIC_END 0x18D
- #define MINIMAL_WORD_COUNT (MAX_OBJECTS + 13)
- typedef enum tagPALDIRECTION
- {
- kDirSouth = 0,
- kDirWest,
- kDirNorth,
- kDirEast,
- kDirUnknown
- } PALDIRECTION, *LPPALDIRECTION
- typedef enum tagMUSICTYPE
- {
- MUSIC_MIDI,
- MUSIC_RIX,
- MUSIC_MP3,
- MUSIC_OGG,
- MUSIC_SDLCD
- } MUSICTYPE, *LPMUSICTYPE
- typedef enum tagOPLTYPE
- {
- OPL_DOSBOX,
- OPL_MAME,
- OPL_DOSBOX_NEW,
- } OPLTYPE, *LPOPLTYPE
- typedef enum tagCODEPAGE {
- CP_MIN = 0,
- CP_BIG5 = 0,
- CP_GBK = 1,
-
-
- CP_MAX = CP_GBK + 1,
- CP_UTF_8 = CP_MAX + 1
- } CODEPAGE
- PAL_C_LINKAGE_BEGIN
- INT
- PAL_RLEBlitToSurface(
- LPCBITMAPRLE lpBitmapRLE,
- SDL_Surface *lpDstSurface,
- PAL_POS pos
- )
- INT
- PAL_RLEBlitToSurfaceWithShadow(
- LPCBITMAPRLE lpBitmapRLE,
- SDL_Surface *lpDstSurface,
- PAL_POS pos,
- BOOL bShadow
- )
- INT
- PAL_RLEBlitWithColorShift(
- LPCBITMAPRLE lpBitmapRLE,
- SDL_Surface *lpDstSurface,
- PAL_POS pos,
- INT iColorShift
- )
- INT
- PAL_RLEBlitMonoColor(
- LPCBITMAPRLE lpBitmapRLE,
- SDL_Surface *lpDstSurface,
- PAL_POS pos,
- BYTE bColor,
- INT iColorShift
- )
- INT
- PAL_FBPBlitToSurface(
- LPBYTE lpBitmapFBP,
- SDL_Surface *lpDstSurface
- )
- INT
- PAL_RLEGetWidth(
- LPCBITMAPRLE lpBitmapRLE
- )
- INT
- PAL_RLEGetHeight(
- LPCBITMAPRLE lpBitmapRLE
- )
- WORD
- PAL_SpriteGetNumFrames(
- LPCSPRITE lpSprite
- )
- LPCBITMAPRLE
- PAL_SpriteGetFrame(
- LPCSPRITE lpSprite,
- INT iFrameNum
- )
- INT
- PAL_MKFGetChunkCount(
- FILE *fp
- )
- INT
- PAL_MKFGetChunkSize(
- UINT uiChunkNum,
- FILE *fp
- )
- INT
- PAL_MKFReadChunk(
- LPBYTE lpBuffer,
- UINT uiBufferSize,
- UINT uiChunkNum,
- FILE *fp
- )
- INT
- PAL_MKFGetDecompressedSize(
- UINT uiChunkNum,
- FILE *fp
- )
- INT
- PAL_MKFDecompressChunk(
- LPBYTE lpBuffer,
- UINT uiBufferSize,
- UINT uiChunkNum,
- FILE *fp
- )
- extern INT
- (*Decompress)(
- LPCVOID Source,
- LPVOID Destination,
- INT DestSize
- )
- INT
- YJ1_Decompress(
- LPCVOID Source,
- LPVOID Destination,
- INT DestSize
- )
- INT
- YJ2_Decompress(
- LPCVOID Source,
- LPVOID Destination,
- INT DestSize
- )
- PAL_C_LINKAGE_END
- #define PAL_DelayUntil(t) \
- PAL_ProcessEvent()
- while (!SDL_TICKS_PASSED(SDL_GetTicks(), (t))) \
- { \
- PAL_ProcessEvent()
- SDL_Delay(1)
- }
- #endif
|