by AryanWolf3D on Thu Aug 06, 2020 11:25 am
Yes, that's the memory of a completely virgin wolf3d.exe (at least for 1.4; older versions have significantly more bytes free.)
I don't really want to go all over the code saying what changed and where, because there's way too much, but as a general tip for
#ifdef/#ifndef, wrap them around the declared constants and variables first (most of them are in WL_DEF.H) and try to compile. When the compiler finds those things in the code, it will report an error and where it occurred. Use that to find where you should exclude those bits of code.
Turning off Word Alignment will stop it from adding padding bytes to structs, which can get quite expensive. It will theoretically make the program slower, but it won't make any real difference (unless you ran it on a veeery slow machine maybe.)
Turning off Treat Enums as Ints will make variables/structure members with a typedef enum datatype 1 byte in size instead of 2. A better option in my opinion is to instead remove all the stupid typedef enums (because they are a terrible and useless feature of C) and just give them 8 bit datatypes (usually "byte" or "char".)
The main memory thing isn't that useful for now, because for the most part it will stay the same after startup. The "before preload" thing is because when you start a level, all available main memory is used to cache in as many of the VSWAP's graphical assets as possible to avoid having to cache them in during gameplay, which could cause short but severe framerate drops.
Finally, I'd recommend checking out this thread on DHWs: http://dhw.wolfenstein3d.com/viewtopic.php?t=2798
Many of the posts there were included in my list. But don't just follow them without studying what it does, or you could break something. In the case of completely unused variables, you can just follow the list.