Browse Source

Fix debug build as C (#566)

* Clean up todo

* Fix debug build
pull/25/head
Anders Jenbo 7 years ago committed by Robin Eklind
parent
commit
429ececce0
  1. 4
      Source/debug.cpp
  2. 4
      Source/sound.cpp
  3. 4
      Source/spells.cpp
  4. 29
      docs/TODO.md

4
Source/debug.cpp

@ -95,7 +95,9 @@ void __cdecl TakeGoldCheat()
void __cdecl MaxSpellsCheat() void __cdecl MaxSpellsCheat()
{ {
for (int i = 1; i < MAX_SPELLS; i++) { int i;
for (i = 1; i < MAX_SPELLS; i++) {
if (spelldata[i].sBookLvl != -1) { if (spelldata[i].sBookLvl != -1) {
plr[myplr]._pMemSpells |= (__int64)1 << (i - 1); plr[myplr]._pMemSpells |= (__int64)1 << (i - 1);
plr[myplr]._pSplLvl[i] = 10; plr[myplr]._pSplLvl[i] = 10;

4
Source/sound.cpp

@ -449,13 +449,15 @@ void __cdecl music_stop()
void __fastcall music_start(int nTrack) void __fastcall music_start(int nTrack)
{ {
BOOL success;
/// ASSERT: assert((DWORD) nTrack < NUM_MUSIC); /// ASSERT: assert((DWORD) nTrack < NUM_MUSIC);
music_stop(); music_stop();
if (sglpDS && gbMusicOn) { if (sglpDS && gbMusicOn) {
#ifdef _DEBUG #ifdef _DEBUG
SFileEnableDirectAccess(FALSE); SFileEnableDirectAccess(FALSE);
#endif #endif
BOOL success = SFileOpenFile(sgszMusicTracks[nTrack], &sgpMusicTrack); success = SFileOpenFile(sgszMusicTracks[nTrack], &sgpMusicTrack);
#ifdef _DEBUG #ifdef _DEBUG
SFileEnableDirectAccess(TRUE); SFileEnableDirectAccess(TRUE);
#endif #endif

4
Source/spells.cpp

@ -127,12 +127,14 @@ void __fastcall UseMana(int id, int sn)
BOOL __fastcall CheckSpell(int id, int sn, BYTE st, BOOL manaonly) BOOL __fastcall CheckSpell(int id, int sn, BYTE st, BOOL manaonly)
{ {
BOOL result;
#ifdef _DEBUG #ifdef _DEBUG
if (debug_mode_key_inverted_v) if (debug_mode_key_inverted_v)
return TRUE; return TRUE;
#endif #endif
BOOL result = TRUE; result = TRUE;
if (!manaonly && pcurs != 1) { if (!manaonly && pcurs != 1) {
result = FALSE; result = FALSE;
} else { } else {

29
docs/TODO.md

@ -1,20 +1,9 @@
### Comments ### Comments
- `BUGFIX` known bugs in original (vanilla) code - `BUGFIX` known bugs in original (vanilla) code
- `/* */` block comments are things to be fixed/checked - `/* */` block comments are things to be fixed/checked
- `FIX_ME` bad data - `FIX_ME` bad data
### Known Bugs Code issues (incorrect code that still works)
Serious bugs (crash/fault) - Critical sections should be constructors using `CCritSect`
- TBA - Some code uses macros such as `__ROL2__`
- Some functions/structures have incorrect signing (signed/unsigned BYTE)
Minor bugs (noticeable but can be avoided)
- Server commands are broken and have been disabled `msgcmd.cpp`
Code issues (incorrect code that still works)
- Critical sections should be constructors using `CCritSect`
- Some code uses macros such as `__ROL4__`
- Some functions/structures have incorrect signing (signed/unsigned BYTE)
- Function `GetLevelMTypes`, decompile and check `monster.cpp`
- Function `SetAutomapView`, decompile and check `automap.cpp`
- Function `engine_draw_automap_pixels`, decompile and check `engine.cpp`
- Double check `LOBYTE` of function `random(int, int)`

Loading…
Cancel
Save