154 lines
5.3 KiB
C
154 lines
5.3 KiB
C
![]() |
#ifndef _LOADREALBIN_H_
|
|||
|
#define _LOADREALBIN_H_
|
|||
|
#include "directdraw.h"
|
|||
|
void initAutoMapColor( char * );
|
|||
|
void makeAutoMapColor( void );
|
|||
|
int writeAutoMapColor( char *, char * );
|
|||
|
int readAutoMapColor( char *, char * );
|
|||
|
|
|||
|
int initRealbinFileOpen(char *realbinfilename, char *addrbinfilename);
|
|||
|
#ifdef _READ16BITBMP
|
|||
|
int InitRealTruebinFileOpen(char *szRealTrueBinFileName,char *szAdrnTruebinFileName);
|
|||
|
#endif
|
|||
|
void cleanupRealbin(void);
|
|||
|
|
|||
|
extern unsigned char autoMapColorTbl[];
|
|||
|
|
|||
|
#include <stdio.h>
|
|||
|
typedef unsigned char MOJI;
|
|||
|
typedef unsigned char U1;
|
|||
|
typedef char S1;
|
|||
|
typedef unsigned short U2;
|
|||
|
typedef short S2;
|
|||
|
typedef unsigned long U4;
|
|||
|
typedef long S4;
|
|||
|
typedef float F4;
|
|||
|
typedef double F8;
|
|||
|
#ifdef _READ16BITBMP
|
|||
|
BOOL Read16BMP(int BmpNo,unsigned char **BmpData,int *width,int *height,BYTE **AlphaData,BOOL *useAlpha);
|
|||
|
#endif
|
|||
|
int realGetImage(int graphicNo, unsigned char **bmpdata, int *width, int *height);
|
|||
|
int realGetPos(U4 GraphicNo , S2 *x , S2 *y);
|
|||
|
int realGetWH(U4 GraphicNo , S2 *w , S2 *h);
|
|||
|
int realGetHitPoints(U4 GraphicNo , S2 *HitX , S2 *HitY);
|
|||
|
int realGetHitFlag(U4 GraphicNo , S2 *Hit);
|
|||
|
BOOL realGetPrioType(U4 GraphicNo , S2 *prioType);
|
|||
|
int realGetHeightFlag(U4 GraphicNo , S2 *Height);
|
|||
|
int realGetNo( U4 CharAction , U4 *GraphicNo );
|
|||
|
int realGetSoundEffect(U4 GraphicNo);
|
|||
|
int realGetWalkSoundEffect(U4 GraphicNo);
|
|||
|
int realGetBitmapNo( int num );
|
|||
|
typedef struct {
|
|||
|
unsigned char atari_x,atari_y; //<2F><>??
|
|||
|
unsigned short hit; // <20>ɷ<EFBFBD><C9B7><EFBFBD><EFBFBD><EFBFBD> //<2F><>???
|
|||
|
short height; //?????
|
|||
|
short broken; //????
|
|||
|
short indamage; //<2F>VHP????
|
|||
|
short outdamage; //<2F><>????
|
|||
|
short inpoison; //<2F>V<EFBFBD><56>
|
|||
|
short innumb; //<2F>V???
|
|||
|
short inquiet; //<2F>V<EFBFBD><56>?
|
|||
|
short instone; //<2F>V<EFBFBD><56>?
|
|||
|
short indark; //<2F>V??
|
|||
|
short inconfuse; //<2F>V??
|
|||
|
short outpoison; //<2F>ҥ<EFBFBD>
|
|||
|
short outnumb; //<2F><>??
|
|||
|
short outquiet; //<2F>ң<EFBFBD>?
|
|||
|
short outstone; //<2F><><EFBFBD><EFBFBD>?
|
|||
|
short outdark; //<2F><>??
|
|||
|
short outconfuse; //<2F><>??
|
|||
|
short effect1; //?????1??<3F><>????????<3F><>?????
|
|||
|
short effect2; //?????2?<3F>V???????<3F><>?????
|
|||
|
unsigned short damy_a;
|
|||
|
unsigned short damy_b;
|
|||
|
unsigned short damy_c;
|
|||
|
unsigned int bmpnumber; //??<3F>k?
|
|||
|
} MAP_ATTR;
|
|||
|
|
|||
|
struct ADRNBIN{
|
|||
|
unsigned long bitmapno;
|
|||
|
unsigned long adder;
|
|||
|
unsigned long size;
|
|||
|
int xoffset;
|
|||
|
int yoffset;
|
|||
|
unsigned int width;
|
|||
|
unsigned int height;
|
|||
|
MAP_ATTR attr;
|
|||
|
};
|
|||
|
|
|||
|
#ifdef _READ16BITBMP
|
|||
|
struct AddressBin_s{
|
|||
|
unsigned int bitmapno; // ͼ<><CDBC>
|
|||
|
unsigned int adder; // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͼ<EFBFBD>ص<EFBFBD><D8B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʼλַ
|
|||
|
unsigned int palSize; // ɫ<><C9AB><EFBFBD><EFBFBD><EFBFBD>ϴ<EFBFBD>С
|
|||
|
unsigned int size; // һ<><D2BB><EFBFBD><EFBFBD><EFBFBD>ϵĴ<CFB5>С
|
|||
|
unsigned int alpha_size; // alpha_size<7A><65>Ϊ0<CEAA><30>ʾ<EFBFBD><CABE>ͼ<EFBFBD><CDBC><EFBFBD><EFBFBD><EFBFBD>Ϻ<EFBFBD><CFBA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>alpha<68><61><EFBFBD><EFBFBD>,alpha_size<7A><65><EFBFBD><EFBFBD>alpha<68><61><EFBFBD>ϵĴ<CFB5>С
|
|||
|
// <20><><EFBFBD><EFBFBD>alpha_sizeΪ0<CEAA><30>ʾû<CABE>д<EFBFBD>alpha<68><61><EFBFBD><EFBFBD>
|
|||
|
int xoffset;
|
|||
|
int yoffset;
|
|||
|
unsigned int width; // ͼ<><CDBC>
|
|||
|
unsigned int height; // ͼ<><CDBC>
|
|||
|
unsigned int staturated; // <20>Ƿ<EFBFBD><C7B7>ñ<EFBFBD><C3B1><EFBFBD>Ч<EFBFBD><D0A7>
|
|||
|
};
|
|||
|
#endif
|
|||
|
|
|||
|
// ????????
|
|||
|
static DWORD FontPal[FONT_PAL_NUM]={
|
|||
|
#ifdef _SA_VERSION_25
|
|||
|
RGB(0xff ,0xff, 0xff ), // 0:FONT_PAL_WHITE
|
|||
|
RGB(0x00 ,0xff, 0xff ), // 1:FONT_PAL_AQUA
|
|||
|
RGB(0xff ,0x00, 0xff ), // 2:FONT_PAL_PURPLE
|
|||
|
RGB(0x48 ,0x48, 0xfa ), // 3:FONT_PAL_BLUE
|
|||
|
RGB(0xff ,0xea, 0x39 ), // 4:FONT_PAL_YELLOW
|
|||
|
RGB(0xa0 ,0xf4, 0x3a ), // 5:FONT_PAL_GREEN a0f43a
|
|||
|
RGB(0xB5 ,0x38, 0x17 ), // 6:FONT_PAL_RED
|
|||
|
RGB(0xa0 ,0xa0, 0xa4 ), // 7:FONT_PAL_GRAY
|
|||
|
RGB(0xa6 ,0xca, 0xf0 ), // 8:FONT_PAL_BLUE2
|
|||
|
RGB(0xc0 ,0xdc, 0xc0 ), // 9:FONT_PAL_GREEN
|
|||
|
#endif
|
|||
|
|
|||
|
|
|||
|
#ifdef _EXTEND_FONT_PAL
|
|||
|
RGB(0xff ,0x80, 0x00 ), // 10
|
|||
|
RGB(0x6f ,0xc6, 0x6f ), // 11
|
|||
|
RGB(0x98 ,0x3d, 0xf3 ), // 12
|
|||
|
RGB(0xff ,0x80, 0xff ), // 13
|
|||
|
RGB(0x4a ,0x9f, 0xf4 ), // 14
|
|||
|
RGB(0xb4 ,0x0e, 0xb4 ), // 15
|
|||
|
RGB(0xbf ,0xbf, 0x19 ), // 16
|
|||
|
RGB(0xff ,0x00, 0x80 ), // 17
|
|||
|
RGB(0xff ,0x80, 0x80 ), // 18
|
|||
|
RGB(0x80 ,0x80, 0x80 ), // 19
|
|||
|
|
|||
|
RGB(0xff ,0xff, 0x80 ), // 20
|
|||
|
RGB(0x80 ,0xff, 0xff ), // 21
|
|||
|
RGB(0x80 ,0xff, 0x00 ), // 22
|
|||
|
RGB(0x00 ,0x80, 0xff ), // 23
|
|||
|
RGB(0xd0 ,0x2a, 0x7d ), // 24
|
|||
|
RGB(0x8d ,0x56, 0x8d ), // 25
|
|||
|
#endif
|
|||
|
};
|
|||
|
|
|||
|
/*
|
|||
|
BOOL InitRealbinFileOpen( char *realbinfilename, char *addrbinfilename); //<2F><>ʼ<EFBFBD><CABC>realbin<69><6E><EFBFBD><EFBFBD><EFBFBD>ϲ<EFBFBD><CFB2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>صļ<D8B5><C4BC><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
//void SetCurFrame(); //<2F>ۼ<EFBFBD>CurFrame<6D><65>counter<65><72><EFBFBD><EFBFBD>ÿ<EFBFBD><C3BF>frameִ<65><D6B4>һ<EFBFBD><D2BB>
|
|||
|
void CacheRLU( int howlong); //<2F>ͷ<EFBFBD>̫<EFBFBD><CCAB>ûʹ<C3BB>õ<EFBFBD>ͼ<EFBFBD><CDBC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
BOOL realGetNo( DWORD CharAction, DWORD *GraphicNo); //<2F><>char actionת<6E><D7AA>ͼ<EFBFBD><CDBC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
DWORD realGetNo2( DWORD bnum); //<2F><>bnumת<6D><D7AA>ͼ<EFBFBD><CDBC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
BOOL realIsValid( DWORD CharAction); //<2F><><EFBFBD><EFBFBD>ͼ<EFBFBD><CDBC><EFBFBD>Ƿ<EFBFBD><C7B7><EFBFBD>Ч
|
|||
|
DWORD realGetBitmapNo( DWORD num); //<2F><>ͼ<EFBFBD><CDBC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ת<EFBFBD><D7AA>bnum
|
|||
|
BOOL realGetPos( DWORD GraphicNo, short *x, short *y); //ȡ<><C8A1>GraphicNo<4E><6F>x<EFBFBD><78>y offset
|
|||
|
BOOL realGetWH( DWORD GraphicNo, short *w, short *h); //ȡ<><C8A1>GraphicNo<4E>Ŀ<EFBFBD><C4BF><EFBFBD>
|
|||
|
BOOL realGetHitPoints( DWORD GraphicNo, short *HitX, short *HitY); //ȡ<><C8A1>GraphicNo<4E><6F>ʵ<EFBFBD>ʿ<EFBFBD><CABF><EFBFBD>
|
|||
|
BOOL realGetPrioType( DWORD GraphicNo , short *prioType); //ȡ<><C8A1>GraphicNo<4E><6F><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ȩ<EFBFBD><C8A8><EFBFBD><EFBFBD>
|
|||
|
BOOL realGetHitFlag( DWORD GraphicNo, short *Hit); //ȡ<><C8A1>GraphicNo<4E><6F>Hit
|
|||
|
BOOL realGetHeightFlag( DWORD GraphicNo, short *Height); //ȡ<><C8A1>GraphicNo<4E>Ƿ<EFBFBD><C7B7>и߶<D0B8>
|
|||
|
int realGetSoundEffect( DWORD GraphicNo); //ȡ<><C8A1>GraphicNo<4E>Ļ<EFBFBD><C4BB><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
int realGetWalkSoundEffect( DWORD GraphicNo); //ȡ<><C8A1>GraphicNo<4E>ĽŲ<C4BD><C5B2><EFBFBD>
|
|||
|
LPBYTE ReadRealBin( DWORD GraphicNo);
|
|||
|
//<2F><><EFBFBD><EFBFBD>realbin
|
|||
|
BOOL DrawScaleImage( DWORD GraphicNo, int screenx, int screeny, int screenw, int screenh, LPWORD dest,
|
|||
|
int destw, int desth, int pitch, LPWORD pal);
|
|||
|
*/
|
|||
|
#endif /*_LOADREALBIN_H_*/
|