Browse Source

Merge branch 'master' of github.com:diasurgical/devilution into hellfire

pull/876/head
Anders Jenbo 6 years ago
parent
commit
de02a0e870
  1. 2
      DiabloUI/bn_prof.cpp
  2. 2
      DiabloUI/diabloui.h
  3. 15
      Source/engine.cpp
  4. 2
      Source/engine.h
  5. 3
      Source/gamemenu.cpp
  6. 12
      Source/items.cpp
  7. 4
      Source/monster.cpp
  8. 52
      Source/objects.cpp
  9. 2
      docs/debug.md
  10. 2
      structs.h

2
DiabloUI/bn_prof.cpp

@ -10,7 +10,7 @@ signed int bn_prof_100014E8() { return 0; }
// 10029404: using guessed type int dword_10029404;
// ref: 0x100014F3
int __stdcall UiProfileGetString() { return 0; }
const char **__stdcall UiProfileGetString() { return NULL; }
//const char *UiProfileGetString() { return 0; }
/* {
return "profile\\sex";

2
DiabloUI/diabloui.h

@ -37,7 +37,7 @@ BOOL __stdcall UiSelHeroSingDialog(BOOL(__stdcall *fninfo)(BOOL(__stdcall *fninf
BOOL __stdcall UiCreditsDialog(int a1);
BOOL __stdcall UiMainMenuDialog(char *name, int *pdwResult, void(__stdcall *fnSound)(char *file), int a4);
BOOL __stdcall UiProgressDialog(HWND window, char *msg, int enable, int(*fnfunc)(), int rate);
int __stdcall UiProfileGetString();
const char **__stdcall UiProfileGetString();
void __cdecl UiProfileCallback();
void __cdecl UiProfileDraw();
BOOL __stdcall UiCategoryCallback(int a1, int a2, int a3, int a4, int a5, DWORD *a6, DWORD *a7);

15
Source/engine.cpp

@ -1594,9 +1594,16 @@ void CelDrawLightRedSafe(int sx, int sy, BYTE *pCelBuff, int nCel, int nWidth, i
}
/**
* @brief Same as CelBlit but cropped to given width
* @brief Blit to a buffer at given coordinates
* @param pBuff Target buffer
* @param x Cordinate in pBuff buffer
* @param y Cordinate in pBuff buffer
* @param wdt Width of pBuff
* @param pCelBuff Cel data
* @param nCel Frame of cel
* @param nWidth Width of cel
*/
void CelBlitWidth(BYTE *pBuff, int CelSkip, int hgt, int wdt, BYTE *pCelBuff, int nCel, int nWidth)
void CelBlitWidth(BYTE *pBuff, int x, int y, int wdt, BYTE *pCelBuff, int nCel, int nWidth)
{
BYTE *pRLEBytes, *dst, *end;
@ -1621,7 +1628,7 @@ void CelBlitWidth(BYTE *pBuff, int CelSkip, int hgt, int wdt, BYTE *pCelBuff, in
mov pRLEBytes, eax
}
dst = &pBuff[hgt * wdt + CelSkip];
dst = &pBuff[y * wdt + x];
__asm {
mov esi, pRLEBytes
@ -1671,7 +1678,7 @@ void CelBlitWidth(BYTE *pBuff, int CelSkip, int hgt, int wdt, BYTE *pCelBuff, in
pRLEBytes = CelGetFrame(pCelBuff, nCel, &nDataSize);
end = &pRLEBytes[nDataSize];
dst = &pBuff[hgt * wdt + CelSkip];
dst = &pBuff[y * wdt + x];
for (; pRLEBytes != end; dst -= wdt + nWidth) {
for (i = nWidth; i;) {

2
Source/engine.h

@ -32,7 +32,7 @@ void CelBlitLightTransSafe(BYTE *pDecodeTo, BYTE *pRLEBytes, int nDataSize, int
void CelDrawLightSafe(int sx, int sy, BYTE *pCelBuff, int nCel, int nWidth, int CelSkip, int CelCap);
void CelClippedBlitLightTransSafe(BYTE *pBuff, BYTE *pCelBuff, int nCel, int nWidth, int CelSkip, int CelCap);
void CelDrawLightRedSafe(int sx, int sy, BYTE *pCelBuff, int nCel, int nWidth, int CelSkip, int CelCap, char light);
void CelBlitWidth(BYTE *pBuff, int always_0, int hgt, int wdt, BYTE *pCelBuff, int nCel, int nWidth);
void CelBlitWidth(BYTE *pBuff, int x, int y, int wdt, BYTE *pCelBuff, int nCel, int nWidth);
void CelBlitOutline(char col, int sx, int sy, BYTE *pCelBuff, int nCel, int nWidth, int CelSkip, int CelCap);
void CelBlitOutlineSafe(char col, int sx, int sy, BYTE *pCelBuff, int nCel, int nWidth, int CelSkip, int CelCap);
void ENG_set_pixel(int sx, int sy, BYTE col);

3
Source/gamemenu.cpp

@ -294,7 +294,8 @@ void gamemenu_gamma(BOOL bActivate)
{
int gamma;
if (bActivate) {
if (UpdateGamma(0) == 30)
gamma = UpdateGamma(0);
if (gamma == 30)
gamma = 100;
else
gamma = 30;

12
Source/items.cpp

@ -3111,8 +3111,8 @@ void CheckIdentify(int pnum, int cii)
{
ItemStruct *pi;
if (cii >= 7)
pi = &plr[pnum].InvList[cii - 7];
if (cii >= NUM_INVLOC)
pi = &plr[pnum].InvList[cii - NUM_INVLOC];
else
pi = &plr[pnum].InvBody[cii];
@ -3131,8 +3131,8 @@ void DoRepair(int pnum, int cii)
p = &plr[pnum];
PlaySfxLoc(IS_REPAIR, p->WorldX, p->WorldY);
if (cii >= 7) {
pi = &p->InvList[cii - 7];
if (cii >= NUM_INVLOC) {
pi = &p->InvList[cii - NUM_INVLOC];
} else {
pi = &p->InvBody[cii];
}
@ -3182,8 +3182,8 @@ void DoRecharge(int pnum, int cii)
int r;
p = &plr[pnum];
if (cii >= 7) {
pi = &p->InvList[cii - 7];
if (cii >= NUM_INVLOC) {
pi = &p->InvList[cii - NUM_INVLOC];
} else {
pi = &p->InvBody[cii];
}

4
Source/monster.cpp

@ -1848,7 +1848,7 @@ void MonstStartKill(int i, int pnum, BOOL sendmsg)
monster[i]._mhitpoints = 0;
SetRndSeed(monster[i]._mRndSeed);
if (QuestStatus(QTYPE_GARB) && monster[i].mName == UniqMonst[UMT_GARBUD].mName) {
CreateTypeItem(monster[i]._mx + 1, monster[i]._my + 1, TRUE, 4, 0, TRUE, FALSE);
CreateTypeItem(monster[i]._mx + 1, monster[i]._my + 1, TRUE, ITYPE_MACE, IMISC_NONE, TRUE, FALSE);
} else if (i > 3) {
SpawnItem(i, monster[i]._mx, monster[i]._my, sendmsg);
}
@ -2652,7 +2652,7 @@ int M_DoTalk(int i)
&& !(Monst->_mFlags & MFLAG_QUEST_COMPLETE)) {
quests[QTYPE_ZHAR]._qactive = 2;
quests[QTYPE_ZHAR]._qlog = TRUE;
CreateTypeItem(Monst->_mx + 1, Monst->_my + 1, FALSE, 0, 24, TRUE, FALSE);
CreateTypeItem(Monst->_mx + 1, Monst->_my + 1, FALSE, ITYPE_MISC, IMISC_BOOK, TRUE, FALSE);
Monst->_mFlags |= MFLAG_QUEST_COMPLETE;
}
if (Monst->mName == UniqMonst[UMT_SNOTSPIL].mName) {

52
Source/objects.cpp

@ -2848,8 +2848,8 @@ void OperateTrapLvr(int i)
for (; j < nobjects; j++) {
oi = objectactive[j];
if (object[oi]._otype == object[i]._oVar2 && object[oi]._oVar1 == object[i]._oVar1) {
object[oi]._oAnimFlag = 0;
object[oi]._oVar2 = 1;
object[oi]._oAnimFlag = 0;
}
}
return;
@ -3602,9 +3602,9 @@ void OperateSkelBook(int pnum, int i, DIABOOL sendmsg)
if (!deltaload) {
SetRndSeed(object[i]._oRndSeed);
if (random_(161, 5))
CreateTypeItem(object[i]._ox, object[i]._oy, FALSE, ITYPE_MISC, 21, sendmsg, FALSE);
CreateTypeItem(object[i]._ox, object[i]._oy, FALSE, ITYPE_MISC, IMISC_SCROLL, sendmsg, FALSE);
else
CreateTypeItem(object[i]._ox, object[i]._oy, FALSE, ITYPE_MISC, 24, sendmsg, FALSE);
CreateTypeItem(object[i]._ox, object[i]._oy, FALSE, ITYPE_MISC, IMISC_BOOK, sendmsg, FALSE);
if (pnum == myplr)
NetSendCmdParam1(FALSE, CMD_OPERATEOBJ, i);
}
@ -3660,16 +3660,16 @@ void OperateArmorStand(int pnum, int i, DIABOOL sendmsg)
SetRndSeed(object[i]._oRndSeed);
uniqueRnd = random_(0, 2);
if (currlevel <= 5) {
CreateTypeItem(object[i]._ox, object[i]._oy, TRUE, ITYPE_LARMOR, 0, sendmsg, FALSE);
CreateTypeItem(object[i]._ox, object[i]._oy, TRUE, ITYPE_LARMOR, IMISC_NONE, sendmsg, FALSE);
} else if (currlevel >= 6 && currlevel <= 9) {
CreateTypeItem(object[i]._ox, object[i]._oy, uniqueRnd, ITYPE_MARMOR, 0, sendmsg, FALSE);
CreateTypeItem(object[i]._ox, object[i]._oy, uniqueRnd, ITYPE_MARMOR, IMISC_NONE, sendmsg, FALSE);
} else if (currlevel >= 10 && currlevel <= 12) {
CreateTypeItem(object[i]._ox, object[i]._oy, FALSE, ITYPE_HARMOR, 0, sendmsg, FALSE);
CreateTypeItem(object[i]._ox, object[i]._oy, FALSE, ITYPE_HARMOR, IMISC_NONE, sendmsg, FALSE);
} else if (currlevel >= 13 && currlevel <= 16) {
CreateTypeItem(object[i]._ox, object[i]._oy, TRUE, ITYPE_HARMOR, 0, sendmsg, FALSE);
CreateTypeItem(object[i]._ox, object[i]._oy, TRUE, ITYPE_HARMOR, IMISC_NONE, sendmsg, FALSE);
#ifdef HELLFIRE
} else if (currlevel >= 17) {
CreateTypeItem(object[i]._ox, object[i]._oy, TRUE, ITYPE_HARMOR, 0, sendmsg, FALSE);
CreateTypeItem(object[i]._ox, object[i]._oy, TRUE, ITYPE_HARMOR, IMISC_NONE, sendmsg, FALSE);
#endif
}
if (pnum == myplr)
@ -3720,8 +3720,8 @@ void OperateCauldron(int pnum, int i, int sType)
SetRndSeed(object[i]._oRndSeed);
object[i]._oVar1 = FindValidShrine(i);
OperateShrine(pnum, i, sType);
object[i]._oAnimFlag = 0;
object[i]._oAnimFrame = 3;
object[i]._oAnimFlag = 0;
force_redraw = 255;
}
@ -3873,9 +3873,9 @@ void OperateWeaponRack(int pnum, int i, DIABOOL sendmsg)
return;
if (leveltype > 1)
CreateTypeItem(object[i]._ox, object[i]._oy, TRUE, weaponType, 0, sendmsg, FALSE);
CreateTypeItem(object[i]._ox, object[i]._oy, TRUE, weaponType, IMISC_NONE, sendmsg, FALSE);
else
CreateTypeItem(object[i]._ox, object[i]._oy, FALSE, weaponType, 0, sendmsg, FALSE);
CreateTypeItem(object[i]._ox, object[i]._oy, FALSE, weaponType, IMISC_NONE, sendmsg, FALSE);
if (pnum == myplr)
NetSendCmdParam1(FALSE, CMD_OPERATEOBJ, i);
}
@ -4396,30 +4396,22 @@ void SyncPedistal(int i)
void SyncL2Doors(int i)
{
int val;
int x, y;
val = object[i]._oVar4;
if (!val)
if (object[i]._oVar4 == 0)
object[i]._oMissFlag = FALSE;
else
object[i]._oMissFlag = TRUE;
x = object[i]._ox;
y = object[i]._oy;
object[i]._oSelFlag = 2;
if (object[i]._otype == OBJ_L2LDOOR && val == 0) {
if (object[i]._otype == OBJ_L2LDOOR && object[i]._oVar4 == 0) {
ObjSetMicro(x, y, 538);
return;
}
if (object[i]._otype == OBJ_L2LDOOR && (val == 1 || val == 2)) {
} else if (object[i]._otype == OBJ_L2LDOOR && (object[i]._oVar4 == 1 || object[i]._oVar4 == 2)) {
ObjSetMicro(x, y, 13);
return;
}
if (object[i]._otype == OBJ_L2RDOOR && val == 0) {
} else if (object[i]._otype == OBJ_L2RDOOR && object[i]._oVar4 == 0) {
ObjSetMicro(x, y, 540);
return;
}
if (object[i]._otype == OBJ_L2RDOOR && (val == 1 || val == 2)) {
} else if (object[i]._otype == OBJ_L2RDOOR && (object[i]._oVar4 == 1 || object[i]._oVar4 == 2)) {
ObjSetMicro(x, y, 17);
}
}
@ -4434,17 +4426,11 @@ void SyncL3Doors(int i)
object[i]._oSelFlag = 2;
if (object[i]._otype == OBJ_L3LDOOR && object[i]._oVar4 == 0) {
ObjSetMicro(x, y, 531);
return;
}
if (object[i]._otype == OBJ_L3LDOOR && (object[i]._oVar4 == 1 || object[i]._oVar4 == 2)) {
} else if (object[i]._otype == OBJ_L3LDOOR && (object[i]._oVar4 == 1 || object[i]._oVar4 == 2)) {
ObjSetMicro(x, y, 538);
return;
}
if (object[i]._otype == OBJ_L3RDOOR && object[i]._oVar4 == 0) {
} else if (object[i]._otype == OBJ_L3RDOOR && object[i]._oVar4 == 0) {
ObjSetMicro(x, y, 534);
return;
}
if (object[i]._otype == OBJ_L3RDOOR && (object[i]._oVar4 == 1 || object[i]._oVar4 == 2)) {
} else if (object[i]._otype == OBJ_L3RDOOR && (object[i]._oVar4 == 1 || object[i]._oVar4 == 2)) {
ObjSetMicro(x, y, 541);
}
}

2
docs/debug.md

@ -3,7 +3,7 @@ There are debug features available through both in-game and through the command-
Command-line parameters
- `-^` : enable god mode and debug tools
- `-$` : enable god mode with less stuff (further documenting needed) [NOT YET IMPLEMENTED]
- `-b` : enables item drop log [NOT YET IMPLEMENTED]
- `-b` : enable item drop log [NOT YET IMPLEMENTED]
- `-d` : disable startup video + increased item drops [PARTIALLY IMPLEMENTED]
- `-f` : display frames per second
- `-i` : disable network timeout

2
structs.h

@ -1374,7 +1374,7 @@ typedef struct _SNETUIDATA {
void(* categorylistcallback)();
void(* newaccountcallback)();
void(* profilecallback)();
int profilefields;
const char **profilefields;
void(* profilebitmapcallback)();
int(__stdcall *selectnamecallback)(
const struct _SNETPROGRAMDATA *,

Loading…
Cancel
Save