Devilution
Diablo devolved - magic behind the 1996 computer game
|
Go to the documentation of this file.
48 void (*
DrawPlrProc)(int, int, int, int, int, BYTE *, int, int, int, int);
65 "attacking (special)",
70 "attacking (special ranged)",
153 if (mx < 0 -
cursW - 1) {
159 if (my < 0 -
cursH - 1) {
198 if (
plr[
myplr].HoldItem._iMagical != 0) {
201 if (!
plr[
myplr].HoldItem._iStatFlag) {
224 int mx, my, nCel, frames;
236 frames = SDL_SwapLE32(*(DWORD *)pCelBuff);
237 if (nCel < 1 || frames > 50 || nCel > frames) {
308 frames = SDL_SwapLE32(*(DWORD *)pCelBuff);
309 if (nCel < 1 || frames > 50 || nCel > frames) {
353 static void DrawPlayer(
int pnum,
int x,
int y,
int px,
int py, BYTE *pCelBuff,
int nCel,
int nWidth)
362 frames = SDL_SwapLE32(*(DWORD *)pCelBuff);
363 if (nCel < 1 || frames > 50 || nCel > frames) {
382 Cl2Draw(px, py, pCelBuff, nCel, nWidth);
383 if (
plr[pnum].pManaShield)
392 if (
plr[pnum].pManaShield)
407 if (
plr[pnum].pManaShield)
428 int i, px, py, nCel, frames;
443 frames = SDL_SwapLE32(*(DWORD *)pCelBuff);
444 if (nCel < 1 || frames > 50 || nCel > frames) {
464 static void DrawObject(
int x,
int y,
int ox,
int oy, BOOL pre)
466 int sx, sy, xx, yy, nCel, frames;
475 if (
object[bv]._oPreFlag != pre)
477 sx = ox -
object[bv]._oAnimWidth2;
481 if (
object[bv]._oPreFlag != pre)
483 xx =
object[bv]._ox - x;
484 yy =
object[bv]._oy - y;
485 sx = (xx << 5) + ox -
object[bv]._oAnimWidth2 - (yy << 5);
486 sy = oy + (yy << 4) + (xx << 4);
491 pCelBuff =
object[bv]._oAnimData;
497 nCel =
object[bv]._oAnimFrame;
498 frames = SDL_SwapLE32(*(DWORD *)pCelBuff);
499 if (nCel < 1 || frames > 50 || nCel > (
int)frames) {
505 CelBlitOutline(194, sx, sy,
object[bv]._oAnimData,
object[bv]._oAnimFrame,
object[bv]._oAnimWidth);
506 if (
object[bv]._oLight) {
507 CelClippedDrawLight(sx, sy,
object[bv]._oAnimData,
object[bv]._oAnimFrame,
object[bv]._oAnimWidth);
509 CelClippedDraw(sx, sy,
object[bv]._oAnimData,
object[bv]._oAnimFrame,
object[bv]._oAnimWidth);
532 for (
int i = 0; i<MicroTileLen>> 1; i++) {
581 static void DrawItem(
int x,
int y,
int sx,
int sy, BOOL pre)
583 char bItem =
dItem[x][y];
589 pItem = &
item[bItem - 1];
618 mi = mi > 0 ? mi - 1 : -(mi + 1);
639 if (pMonster->
MType != NULL) {
644 py = sy + pMonster->
_myoff;
662 p = p > 0 ? p - 1 : -(p + 1);
665 int py = sy + pPlayer->
_pyoff;
679 int mi, px, py, nCel, nMon, negMon, frames;
680 char bFlag, bDead, bObj, bItem, bPlr, bArch, bMap, negPlr, dd;
696 bDead =
dDead[sx][sy];
710 pDeadGuy = &
dead[(bDead & 0x1F) - 1];
711 dd = (bDead >> 5) & 7;
715 if (pCelBuff != NULL) {
755 if (sx > 0 && sy > 0 && dy > 32 +
SCREEN_Y) {
777 for (
int i = 0; i < (blocks << 1); i++) {
778 for (
int j = 0; j < chunks ; j++) {
779 if (x >= 0 && x < MAXDUNX && y >= 0 && y <
MAXDUNY) {
813 #define IsWall(x, y) (dPiece[x][y] == 0 || nSolidTable[dPiece[x][y]] || dSpecial[x][y] != 0)
814 #define IsWalktabke(x, y) (dPiece[x][y] != 0 && !nSolidTable[dPiece[x][y]])
825 static void scrollrt_draw(
int x,
int y,
int sx,
int sy,
int blocks,
int chunks)
829 for (
int i = 0; i < (blocks << 1); i++) {
830 for (
int j = 0; j < chunks ; j++) {
831 if (x >= 0 && x < MAXDUNX && y >= 0 && y <
MAXDUNY) {
877 int i, sx, sy, chunks, blocks;
878 int wdt, nSrcOff, nDstOff;
998 BYTE *src, *dst1, *dst2;
1005 for (i = wdt; i != 0; i--) {
1205 tc = SDL_GetTicks();
1212 snprintf(String, 12,
"%d FPS",
framerate);
1226 SDL_Rect SrcRect = {
1232 SDL_Rect DstRect = {
1251 static void DrawMain(
int dwHgt, BOOL draw_desc, BOOL draw_hp, BOOL draw_mana, BOOL draw_sbar, BOOL draw_btn)
1336 BOOL ddsdesc, ctrlPan;
unsigned char * _deadData[8]
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 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...
DEVILUTION_BEGIN_NAMESPACE int cursH
void CelClippedBlitLightTrans(BYTE *pBuff, BYTE *pCelBuff, int nCel, int nWidth)
Same as CelBlitLightTransSafe.
ItemStruct item[MAXITEMS+1]
void CelBlitFrame(BYTE *pBuff, BYTE *pCelBuff, int nCel, int nWidth)
Blit a given CEL frame to the given buffer.
MissileStruct missile[MAXMISSILES]
BOOL automapflag
Specifies whether the automap is enabled.
void RenderTile(BYTE *pBuff)
Blit current world CEL to the given buffer.
char dObject[MAXDUNX][MAXDUNY]
void BltFast(SDL_Rect *src_rect, SDL_Rect *dst_rect)
unsigned char * _iAnimData
BYTE gbMaxPlayers
Specifies the maximum number of players in a game, where 1 represents a single player game and 4 repr...
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.
void UpdateManaFlask()
Controls the drawing of the area of the life flask within the control panel.
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.
char dLight[MAXDUNX][MAXDUNY]
int dPiece[MAXDUNX][MAXDUNY]
BOOLEAN nSolidTable[2049]
List of path blocking dPieces.
void UpdateLifeFlask()
Controls the drawing of the area of the life flask within the control panel.
#define DEVILUTION_END_NAMESPACE
unsigned char * _pAnimData
MonsterStruct monster[MAXMONSTERS]
void DrawCtrlBtns()
Draws the control panel buttons in their current state.
char dMissile[MAXDUNX][MAXDUNY]
char dItem[MAXDUNX][MAXDUNY]
void unlock_buf(BYTE idx)
DEVILUTION_BEGIN_NAMESPACE int missileactive[MAXMISSILES]
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.
void DrawLifeFlask()
Draws the top dome of the life flask (that part that protrudes out of the control panel).
MICROS dpiece_defs_map_2[MAXDUNX][MAXDUNY]
void CelClippedDrawSafe(int sx, int sy, BYTE *pCelBuff, int nCel, int nWidth)
Same as CelClippedDraw but checks for drawing outside the buffer.
DEVILUTION_BEGIN_NAMESPACE BOOL invflag
unsigned char * _miAnimData
char dTransVal[MAXDUNX][MAXDUNY]
char dSpecial[MAXDUNX][MAXDUNY]
void DrawInfoBox()
Sets a string to be drawn in the info box and then draws it.
BOOLEAN nTransTable[2049]
List of transparent dPieces.
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 world_draw_black_tile(int sx, int sy)
Render a black tile.
int dMonster[MAXDUNX][MAXDUNY]
MisFileData misfiledata[]
Data related to each missile graphic ID.
void DrawGoldSplit(int amount)
char dPlayer[MAXDUNX][MAXDUNY]
char dFlags[MAXDUNX][MAXDUNY]
void Cl2Draw(int sx, int sy, BYTE *pCelBuff, int nCel, int nWidth)
Blit CL2 sprite, to the back buffer at the given coordianates.
unsigned char * _mAnimData
char dDead[MAXDUNX][MAXDUNY]
PlayerStruct plr[MAX_PLRS]
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 PrintGameStr(int x, int y, const char *str, int color)