Skip to content

GameLib_CommonFunction

박상희 (Alex Park) edited this page Jan 12, 2019 · 2 revisions

Table of Content

Graphic
Input
MusicSE
System

CommonFunctionGraphic

LoadPIFromDat

(C2DImage** pRet,unsigned char *outPalette, Cth5DatFile *pDatFile,char *piFileName)

Load Palette to (outPalette) and Image to (pRet) from FileName (piFileName) in Dat File (pDatFile)

LoadCD2CDGFromDat

(C2DImage** pRet,Cth5DatFile *pDatFile, char *cd2cdgFileName,int spriteIdx, unsigned char *inPalette)

Load Images which has CD2 and CDG file extensions
others are same with LoadPIFromDat
spriteIdx: sprite ID of the Image (= TexID??)
inPalette: (CD2 Images ONLY) Pointer of palette we are using.

LoadBFTFromDat

(C2DImage** pRet,unsigned char *outPalette,Cth5DatFile *pDatFile, char *bftFileName,int patternIdx,int transparentColorIdx)

others are same with LoadPIFromDat
Render text with BFT font provided

LoadCD2CDGAllSpriteFromDat

(C2DImageArray *pOutImgArray,Cth5DatFile *pDatFile, char *cd2cdgFileName,unsigned char *inPalette)

Not Documented, Please Update. Please Help Us Out!

LoadBFTAllPatternFromDat

(C2DImageArray *pOutImgArray,unsigned char *outPalette, Cth5DatFile *pDatFile,char *bftFileName, int transparentColorIdx, unsigned char *inPalette)

Not Documented, Please Update. Please Help Us Out!

LoadBinaryImageFile

(C2DImage **pRet,unsigned char transparentColor[3], const char *fileName)

Loads Binary Image File from filename, provided color (transparentColor { R, G, B }) will be turned into transparent while loading. external bmp files only

LoadBMPImageFile

(C2DImage **pRet,unsigned char transparentColor[3], const char *fileName)

Simillar to LoadBinaryImageFile but it can load 32-bit bmp files, Unavailable in Upstream Written by WindowsTiger

ScreenFade

(float fadeScale)

Fades the screen, it's somehow similar to brightness.
fadeScale can be 0 (darkest) to 200 (brightest)

DrawRectangle

(float XLow,float YLow,float XHigh,float YHigh, float colorR,float colorG,float colorB,float alpha,bool bSolid)

As you expected, It draws rectangle.

CommonFunctionInput

GetAllKeyState

()

CommonFunctionMusicSE

LoadMusicToPMDFromDat

(Cth5DatFile *pDatFile,char *musicFileName)

LoadMusicFromDat

(Cth5DatFile *pDatFile, char *musicFileName, bool m2exist = true)

UnloadData

()

Play

()

Pause

()

Resume

()

Finalize

()

SetVolume

(float volume)

PlaySe

(int soundIdx)

CommonFunctionSystem

CreateConsoleWindow

()

GetFileMD5

(unsigned char *retMD5,const char *fileName)

Returns MD5 Checksum to retMD5, Not using anymore