Devilution
Diablo devolved - magic behind the 1996 computer game
|
Go to the documentation of this file.
34 pFrameTable = (DWORD *)pCelBuff;
36 return pCelBuff +
SwapLE32(pFrameTable[nCel]);
39 #define LOAD_LE32(b) (((DWORD)(b)[3] << 24) | ((DWORD)(b)[2] << 16) | ((DWORD)(b)[1] << 8) | (DWORD)(b)[0])
40 inline BYTE *
CelGetFrame(BYTE *pCelBuff,
int nCel,
int *nDataSize)
44 nCellStart =
LOAD_LE32(&pCelBuff[nCel * 4]);
45 *nDataSize =
LOAD_LE32(&pCelBuff[(nCel+1) * 4]) - nCellStart;
46 return pCelBuff + nCellStart;
52 BYTE *pRLEBytes =
CelGetFrame(pCelBuff, nCel, nDataSize);
54 nDataStart = pRLEBytes[1] << 8 | pRLEBytes[0];
55 *nDataSize -= nDataStart;
57 return pRLEBytes + nDataStart;
60 void CelDraw(
int sx,
int sy, BYTE *pCelBuff,
int nCel,
int nWidth);
61 void CelBlitFrame(BYTE *pBuff, BYTE *pCelBuff,
int nCel,
int nWidth);
62 void CelClippedDraw(
int sx,
int sy, BYTE *pCelBuff,
int nCel,
int nWidth);
63 void CelDrawLight(
int sx,
int sy, BYTE *pCelBuff,
int nCel,
int nWidth, BYTE *tbl);
66 void CelDrawLightRed(
int sx,
int sy, BYTE *pCelBuff,
int nCel,
int nWidth,
char light);
67 void CelBlitSafe(BYTE *pDecodeTo, BYTE *pRLEBytes,
int nDataSize,
int nWidth);
69 void CelBlitLightSafe(BYTE *pDecodeTo, BYTE *pRLEBytes,
int nDataSize,
int nWidth, BYTE *tbl);
72 void CelBlitWidth(BYTE *pBuff,
int x,
int y,
int wdt, BYTE *pCelBuff,
int nCel,
int nWidth);
73 void CelBlitOutline(
char col,
int sx,
int sy, BYTE *pCelBuff,
int nCel,
int nWidth);
76 void DrawLine(
int x0,
int y0,
int x1,
int y1, BYTE col);
87 void Cl2Draw(
int sx,
int sy, BYTE *pCelBuff,
int nCel,
int nWidth);
88 void Cl2DrawOutline(
char col,
int sx,
int sy, BYTE *pCelBuff,
int nCel,
int nWidth);
89 void Cl2DrawLightTbl(
int sx,
int sy, BYTE *pCelBuff,
int nCel,
int nWidth,
char light);
90 void Cl2DrawLight(
int sx,
int sy, BYTE *pCelBuff,
int nCel,
int nWidth);
91 void Cl2BlitSafe(BYTE *pDecodeTo, BYTE *pRLEBytes,
int nDataSize,
int nWidth);
92 void Cl2BlitOutlineSafe(BYTE *pDecodeTo, BYTE *pRLEBytes,
int nDataSize,
int nWidth,
char col);
93 void Cl2BlitLightSafe(BYTE *pDecodeTo, BYTE *pRLEBytes,
int nDataSize,
int nWidth, BYTE *pTable);
BYTE * CelGetFrame(BYTE *pCelBuff, int nCel, int *nDataSize)
void Cl2BlitLightSafe(BYTE *pDecodeTo, BYTE *pRLEBytes, int nDataSize, int nWidth, BYTE *pTable)
Blit CL2 sprite, and apply lighting, to the given buffer.
int orgseed
Seed value before the most recent call to SetRndSeed()
BYTE * LoadFileInMem(char *pszName, DWORD *pdwFileLen)
Load a file in to a buffer.
BYTE * DiabloAllocPtr(DWORD dwBytes)
Multithreaded safe malloc.
void Cl2DrawLight(int sx, int sy, BYTE *pCelBuff, int nCel, int nWidth)
Blit CL2 sprite, and apply lighting, to the back buffer at the given coordinates.
int GetDirection(int x1, int y1, int x2, int y2)
Calculate the best fit direction between two points.
void Cl2DrawOutline(char col, int sx, int sy, BYTE *pCelBuff, int nCel, int nWidth)
Blit a solid colder shape one pixel larger then the given sprite shape, to the back buffer at the giv...
BOOL gbNotInView
valid - if x/y are in bounds
BYTE * CelGetFrameStart(BYTE *pCelBuff, int nCel)
int SeedCount
Track number of calls to GetRndSeed() since last call to SetRndSeed()
void CelBlitWidth(BYTE *pBuff, int x, int y, int wdt, BYTE *pCelBuff, int nCel, int nWidth)
Blit to a buffer at given coordinates.
void CelBlitOutline(char col, int sx, int sy, BYTE *pCelBuff, int nCel, int nWidth)
Blit a solid colder shape one pixel larger then the given sprite shape, to the back buffer at the giv...
void ENG_set_pixel(int sx, int sy, BYTE col)
Set the value of a single pixel in the back buffer, checks bounds.
void Cl2DrawLightTbl(int sx, int sy, BYTE *pCelBuff, int nCel, int nWidth, char light)
Blit CL2 sprite, and apply a given lighting, to the back buffer at the given coordianates.
void Cl2ApplyTrans(BYTE *p, BYTE *ttbl, int nCel)
Apply the color swaps to a CL2 sprite.
void Cl2Draw(int sx, int sy, BYTE *pCelBuff, int nCel, int nWidth)
Blit CL2 sprite, to the back buffer at the given coordianates.
void CelDrawLightRedSafe(int sx, int sy, BYTE *pCelBuff, int nCel, int nWidth, char light)
Same as CelDrawLightRed but checks for drawing outside the buffer.
void Cl2BlitOutlineSafe(BYTE *pDecodeTo, BYTE *pRLEBytes, int nDataSize, int nWidth, char col)
Blit a solid colder shape one pixel larger then the given sprite shape, to the given buffer.
void CelClippedDraw(int sx, int sy, BYTE *pCelBuff, int nCel, int nWidth)
Same as CelDraw but with the option to skip parts of the top and bottom of the sprite.
DWORD LoadFileWithMem(const char *pszName, void *p)
Load a file in to the given buffer.
int random_(BYTE idx, int v)
Main RNG function.
void CelClippedBlitLightTrans(BYTE *pBuff, BYTE *pCelBuff, int nCel, int nWidth)
Same as CelBlitLightTransSafe.
void CelBlitLightTransSafe(BYTE *pDecodeTo, BYTE *pRLEBytes, int nDataSize, int nWidth)
Same as CelBlitLightSafe, with transparancy applied.
int GetRndSeed()
Get the current RNG seed.
void CelDrawLightRed(int sx, int sy, BYTE *pCelBuff, int nCel, int nWidth, char light)
Blit CEL sprite, and apply lighting, to the back buffer at the given coordinates, translated to a red...
BYTE * CelGetFrameClipped(BYTE *pCelBuff, int nCel, int *nDataSize)
const int RndInc
Specifies the increment used in the Borland C/C++ pseudo-random.
void CelDrawLight(int sx, int sy, BYTE *pCelBuff, int nCel, int nWidth, BYTE *tbl)
Blit CEL sprite, and apply lighting, to the back buffer at the given coordinates.
void CelDraw(int sx, int sy, BYTE *pCelBuff, int nCel, int nWidth)
Blit CEL sprite to the back buffer at the given coordinates.
void CelBlitLightSafe(BYTE *pDecodeTo, BYTE *pRLEBytes, int nDataSize, int nWidth, BYTE *tbl)
Blit CEL sprite, and apply lighting, to the given buffer, checks for drawing outside the buffer.
char gbPixelCol
automap pixel color 8-bit (palette entry)
void mem_free_dbg(void *p)
Multithreaded safe memfree.
BOOL gbRotateMap
flip - if y < x
void CelClippedDrawSafe(int sx, int sy, BYTE *pCelBuff, int nCel, int nWidth)
Same as CelClippedDraw but checks for drawing outside the buffer.
void DrawLine(int x0, int y0, int x1, int y1, BYTE col)
Draw a line on the back buffer.
const int RndMult
Specifies the multiplier used in the Borland C/C++ pseudo-random number generator algorithm.
void engine_debug_trap(BOOL show_cursor)
void CelBlitFrame(BYTE *pBuff, BYTE *pCelBuff, int nCel, int nWidth)
Blit a given CEL frame to the given buffer.
void Cl2BlitSafe(BYTE *pDecodeTo, BYTE *pRLEBytes, int nDataSize, int nWidth)
Blit CL2 sprite to the given buffer.
void SetRndSeed(int s)
Set the RNG seed.
void engine_draw_pixel(int sx, int sy)
Set the value of a single pixel in the back buffer to that of gbPixelCol, checks bounds.
void CelBlitSafe(BYTE *pDecodeTo, BYTE *pRLEBytes, int nDataSize, int nWidth)
Blit CEL sprite to the given buffer, checks for drawing outside the buffer.
void PlayInGameMovie(char *pszMovie)
Fade to black and play a video.
void CelClippedDrawLight(int sx, int sy, BYTE *pCelBuff, int nCel, int nWidth)
Same as CelDrawLight but with the option to skip parts of the top and bottom of the sprite.