diasurgical/devilution

Fix function order

Opened this issue · 2 comments

As seen in the PSX symbol and the MAC release, some files have functions in a completely different order. It is apparent they are scrambled in the PC release with assertions where the line number is greater than functions that comes after it. In order to fix this, the functions must be put in the correct order and local functions set as static. This will allow removing tons of prototypes for functions only called locally.

All releases on the PC have scrambled function order except the August 1996 Demo. Otherwise we can also infer from any of the PSX symbols or MAC releases:

  • appfat.cpp
  • automap.cpp
  • capture.cpp #1870 (no reference)
  • codec.cpp
  • control.cpp
  • cursor.cpp
  • dead.cpp
  • debug.cpp
  • diablo.cpp
  • doom.cpp
  • drlg_l1.cpp #1803
  • drlg_l2.cpp #1804
  • drlg_l3.cpp #1805
  • drlg_l4.cpp #1806
  • dthread.cpp
  • dx.cpp #1818
  • effects.cpp
  • encrypt.cpp
  • engine.cpp
  • error.cpp
  • fault.cpp
  • gamemenu.cpp
  • gendung.cpp #1843
  • gmenu.cpp
  • help.cpp
  • init.cpp
  • interfac.cpp
  • inv.cpp
  • items.cpp
  • lighting.cpp
  • loadsave.cpp
  • logging.cpp
  • mainmenu.cpp
  • minitext.cpp
  • missiles.cpp
  • monster.cpp
  • movie.cpp
  • mpqapi.cpp
  • msg.cpp
  • msgcmd.cpp
  • multi.cpp
  • nthread.cpp
  • objects.cpp
  • pack.cpp #1837
  • palette.cpp #1846
  • path.cpp
  • pfile.cpp
  • player.cpp
  • plrmsg.cpp
  • portal.cpp
  • quests.cpp
  • render.cpp
  • restrict.cpp
  • scrollrt.cpp #1800
  • setmaps.cpp
  • sha.cpp
  • sound.cpp
  • spells.cpp #1837
  • stores.cpp
  • sync.cpp
  • themes.cpp
  • tmsg.cpp
  • town.cpp
  • towners.cpp
  • track.cpp
  • trigs.cpp
  • wave.cpp
qndel commented

🎉

Glad to see someone took up the task to finish this. Now, just get the variables in the right order. But don't forget the maze it will be ;P