this also means we can remove a few ancient hacks relating to using the same code used to load SOC/Lua in WADs for loading standalone Lua/SOC files, though I haven't fully done this yet
-Colormaps, palettes and other stuff are properly loaded now. It was a bug related to the generation of the lump name with files in the root of the PK3.
Known issues:
-Map WADs' REJECT and BLOCKMAP are still not loaded.
-Folders aren't loaded as lumps anymore
-Can now load an arbitrary number of TEXTURES lumps in PK3s. Name them textures.gfz, textures.thz, ..., for example.
-Removed code duplicity on map resource reading.
-Fixed all known PK3-related bugs so far except for the ones mentioned below.
Issues:
-Blockmap and reject matrix still aren't loaded yet when using a map WAD.
-Palettes and colormaps aren't loaded (by extension, TRANS tables might not work either).
-Now can load map WAD files inside Maps/ directory, but they must only contain map data explicitly!
Known problems:
-There's an issue causing a crash with palettes and colormaps in PK3s.
-SS_START and SS_END don't work now. Will check later.
-Standalone lumps for maps in the Maps/ folder don't work anymore; perhaps I should keep that functionality?
Notes:
-It's now a mashup of something dumb that I wanted to do and yet piling hacks again.
-A lot of code duplicity with map lump loading functions.
-DEFLATE-compressed lumps work properly now.
-All "big" lumps are supported now with the exception of WAD maps.
Notes:
-Compiler spits out a shitload of warnings still.
-Individual lump reading clashes with folders of the same name (see TEXTURES lump, and the Textures/ folder).
Signed-off-by: Nevur <apophycens@gmail.com>
-Expanded folder recognition for PK3s. Some resources are still not loaded from them yet.
-Took a glimpse at how maps are loaded, since the flat recognition is rooted somewhere there; did nothing yet about it though.
-Working towards "generalizing" how new resources are handled. Some var and functionality redundancy is still present.
* M_StartMessages when file loading goes wrong! (Determined by CONS_Alerts of warning level CONS_WARNING and CONS_ERROR happening after W_LoadWadFile has been called.)
* Now actively tries to keep your place on the menu if files are deleted between calls to preparefilemenu().
* More enums! DIR_ (for if you want to try embed more metadata in the dirmenu strings) and REFRESHDIR_ (for refreshing the menu and handling warnings).
* Handle changing size menu between calls to opendir() better.
* Don't crash on draw/enter attempt if one of the dirmenu's is null.
* Moved the addons menu to OP_MainMenu instead of MainMenu for now so it can be tested in MP without needing to mess with several menus.
* Display the amount of space used for serverinfo_pak's fileneeded on the addons menu, both visually and with a percentage.
-Moved the MD5 check for added files up so it avoids unnecessary work when you mess up and re-add a file.
-Using compression enum for compressed lumps now.
-Vastly improved central directory seeking algorithm, big files are read fine now. Thanks a lot JTE!
-Improved remaining central directory navigation algorithm, we know and expect what data is coming from now on, after all.
-TX_ textures and sounds are replaced, but textures crash the game on mapload, and sounds are simply mute when replaced. Might have to do something with caching, I don't know yet.
-Removed a redundant boolean related to texture loading in P_AddWadFile.
-Started working on handling PK3s differently, except that I'm not sure about what I'm doing.
I don't know what to do from now on for today, so I'll leave it here for now.
-PK3 files are now properly loaded as files.
-PK3 lumps are still being treated the same way as WAD files. It means they're dependant on markers, if that makes any sense in the context of a ZIP file (it doesn't). I haven't worked out this part yet but I obviously intend to do so.
-I don't know if the lumps' position address is correct, we'll figure out when I fix the thing from above.
-Tweaked compression conditional to a switch-case format, looking towards adding several comrpession algorithms; haven't removed the previous "compressed" boolean yet.
-Added dynamically allocated name strings for lumps; haven't removed the previous name field.
-Added rudimentary PK3 central directory recognition; nothing is actually loaded in the end.
This is used by Command_Addfile in the MD5 calculation code, so that it can search subfolders properly and allow addfile in netgames to treat them the same way as in SP
* Create a normal skin, but replace the S_SKIN lump with an almost empty one named P_SKIN.
* Provide "name = existing skin name as one of the first line (comments allowed)
* Reset individual spritenames back to zero sprite2s (or one for SPR2_STND to prevent complete removal) via "reset = SPR2_****" statements.
* No support for changing skin properties that are non-visual at the moment, but I don't really feel like it's wise to have those changable with patch alone. (Hello, tons of "modern Sonic" wadfiles which just change vanilla Sonic's ability to CA_HOMINGTHOK!)
* Sprites patch over.
To see an example in action, look at <root>/toaster/smilespatch.wad.
Basically this makes sure numwadfiles is updated before loading the SOC/Lua scripts, so if a Lua script calls COM_BufInsertText with the contents "addfile scr_mysticrealm.wad" it can't overwrite the last written wadfile slot! Not that COM_BufInsertText really should be used like that to begin with