Commit graph

33 commits

Author SHA1 Message Date
Dennis Duda
d45a175064 Fixed CreatePlayer to now be binary exact! 2018-08-28 23:21:56 +02:00
Dennis Duda
4120348056 Switched all pre-increments to post-increments, added some spacing 2018-08-28 16:38:29 +02:00
Anders Jenbo
e750efcfce Clean up NextPlrLevel 2018-08-28 16:38:29 +02:00
Anders Jenbo
2e383d6810 Minor clean ups for player.cpp 2018-08-28 01:46:45 +02:00
Dennis Duda
0b29cbb97b Reverted MAX_PLRS to raw literal without unsigned annotation 2018-08-27 23:10:04 +02:00
Dennis Duda
565a4b8bce Flipped back the leveltype check
:S
2018-08-27 18:55:25 +02:00
Dennis Duda
9e18f07d5b Cleaned up the if branches further, removed pAnims var so that register and instruction generation comes very close 2018-08-27 18:24:26 +02:00
Anders Jenbo
cd99c0b800 Clean up player.cpp SetPlrAnims 2018-08-27 18:24:26 +02:00
Dennis Duda
9770783f41 Cleaned up CreatePlayer to be only one instruction off!
The devilution code generates one additional `cdq` instruction, the rest is perfect...
2018-08-27 16:28:27 +02:00
Dennis Duda
4ae7211fa0 Cleaned up CreatePlayer.
This is now as close as it gets without switching to enum types/parameters everywhere, so the compiler can optimize all accesses/checks accordingly. This is especially noticeable in the way the code for the switch is generated (line 775). In the original binary you can see it does weird stuff if c is not one of the classes' enum value (probably due to optimization since the switch should be exhaustive).

I've tried switching the type of c to _ui_classes, also removing the UI_NUM_CLASSES value to see if that'd be enough to let it generate the optimized code, but nope, seems like we need to change it all at once. Currently, _pClass is a char, but an enum value would fit there as well, size-wise (alignment).

That's also why I'm guessing there had to be another enum for player classes, without the UI_NUM_CLASSES value...
2018-08-27 16:28:27 +02:00
Anders Jenbo
71c4c71796 Clean up player NewPlrAnim and ClearPlrPVars 2018-08-26 17:31:46 +02:00
Dennis Duda
2a492cf9c3 Merge remote-tracking branch 'devilution/master' 2018-08-23 18:06:00 +02:00
galaxyhaxz
5ed2336e90
Fix types of animation data (#176) 2018-08-22 23:15:16 -05:00
Dennis Duda
27b1fea2f7 Merge remote-tracking branch 'devilution/master' 2018-08-22 17:43:55 +02:00
galaxyhaxz
5ff8756116
Fix junk (#174) 2018-08-21 23:58:17 -05:00
Dennis Duda
fd70d0933b Merge remote-tracking branch 'devilution/master' 2018-08-21 14:35:08 +02:00
galaxyhaxz
0a3503dd55
Fix operating objects from top (sarcophagus) 2018-08-20 23:09:00 -05:00
Dennis Duda
0603e3e042 Cleaned up InitMonsterGFX, InitMonster, MonstPlace 2018-08-19 23:18:46 +02:00
galaxyhaxz
fa64b2148d
Add defines [W.I.P] (#160) 2018-08-15 22:13:15 -05:00
galaxyhaxz
a08be06427
Fix decompilation in player pathing
Doesn't fix any bugs sadly, the code still generates the same :(
2018-08-15 00:43:25 -05:00
galaxyhaxz
a336c38226
Fix random(idx,v) calls (#157) 2018-08-10 22:45:32 -05:00
Dennis Duda
0200a2abba Refactored spells.cpp (#147)
Finished refactoring spells.cpp, modifying other files only as needed.
Some functions are 99% binary exact now, like PlacePlayer, for example.
Added notes/TODOs for places with remaining discrepancies.
2018-07-22 04:49:32 +00:00
galaxyhaxz
f50dab25ba
Several fixes for storm/msgcmd (#146) 2018-07-19 02:05:50 -05:00
Stephan Unverwerth
c8af0523ac refactor leveltype to use macros (#103) 2018-06-29 10:40:22 -05:00
Adam Heinermann
87ca6557c3 Changed _oBreak and _oSelFlag to char (#95)
* Changed _oBreak and _oSelFlag to char
2018-06-28 08:53:06 -05:00
galaxyhaxz
49a6f4f9fc
Add include guards, prepare for XRef (#28)
Add definitions, other junk.
2018-06-20 05:17:44 -05:00
galaxyhaxz
7ee880f968
Fixed typos 2018-06-19 02:04:55 -05:00
galaxyhaxz
bb01c6f084
Remove the "fear factor" (#21)
Snakes, spiders, Demons, what scares you?
2018-06-18 19:16:32 -05:00
galaxyhaxz
0dac197965
Update player.cpp 2018-06-08 22:12:26 -05:00
mewmew
f5f76f8b8a Fix build on Linux 2018-06-08 11:23:30 +02:00
galaxyhaxz
b1ee40f6e7
Revert "Add preliminary support for compiling on Linux" 2018-06-07 22:00:35 -05:00
mewmew
20fdbf8aa2 Fix compile errors on Linux
Source/../types.h:35:10: fatal error: DiabloUI/_diabloui.h: No such file or directory
 #include "DiabloUI/_diabloui.h"

---

Source/../Source/init.h:43:109: error: fastcall and stdcall attributes are not compatible
 LRESULT (__stdcall *__fastcall SetWindowProc(void *func))(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);

---

Source/missiles.cpp:915:27: error: unable to find numeric literal operator ‘operator""i64’
  *(_QWORD *)&Dirs[0][2] = 0i64;

---

Source/world.cpp:38:1: error: narrowing conversion of ‘3937053354’ from ‘unsigned int’ to ‘int’ inside { } [-Wnarrowing]

---

Source/lighting.cpp:429:1: error: narrowing conversion of ‘-1’ from ‘int’ to ‘unsigned char’ inside { } [-Wnarrowing]

---

Source/objects.cpp:5459:62: error: unable to find numeric literal operator ‘operator""i64’
      while ( !(plr[v53]._pMemSpells[1] & ((unsigned __int64)(1i64 << v60) >> 32) | plr[v53]._pMemSpells[0] & (unsigned int)(1i64 << v60)) );

---

Source/control.cpp:488:9: error: unable to find numeric literal operator ‘operator""i64’
   v26 = 1i64;

---

Source/objects.cpp:243:1: error: narrowing conversion of ‘255’ from ‘int’ to ‘char’ inside { } [-Wnarrowing]

---

Source/gamemenu.cpp:22:1: error: narrowing conversion of ‘2147483648’ from ‘unsigned int’ to ‘int’ inside { } [-Wnarrowing]

---

Source/sound.cpp:41:88: error: narrowing conversion of ‘240’ from ‘unsigned int’ to ‘char’ inside { } [-Wnarrowing]

---

Source/quests.cpp:46:1: error: narrowing conversion of ‘255’ from ‘int’ to ‘char’ inside { } [-Wnarrowing]

---

Source/player.cpp:4666:8: error: unable to find numeric literal operator ‘operator""i64’
  v14 = 0i64;

---

Source/init.cpp:546:109: error: fastcall and stdcall attributes are not compatible
 LRESULT (__stdcall *__fastcall SetWindowProc(void *func))(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)

---

Source/items.cpp:114:1: error: narrowing conversion of ‘(item_effect_type)255’ from ‘unsigned int’ to ‘char’ inside { } [-Wnarrowing]

---

Source/items.cpp:307:1: error: narrowing conversion of ‘(unique_base_item)255’ from ‘unsigned int’ to ‘char’ inside { } [-Wnarrowing]

---

Source/items.cpp:854:8: error: unable to find numeric literal operator ‘operator""i64’
  v37 = 0i64;

---

Source/items.cpp:471:1: error: narrowing conversion of ‘(item_equip_type)255’ from ‘unsigned int’ to ‘char’ inside { } [-Wnarrowing]
2018-06-07 22:44:03 +02:00
galaxyhaxz
dde68ff89e
Add files via upload 2018-06-06 21:25:54 -05:00