Commit Graph

78 Commits

Author SHA1 Message Date
mazmazz 6844ed37c5 Colormap overhaul: %d format size_t -> UINT32 fix 2018-09-15 01:50:33 -04:00
mazmazz 57959522e2 Colormap overhaul r_data: Mixed D+C fix 2018-09-15 00:49:03 -04:00
mazmazz 07af82aa84 Missed fog boolean -> integer 2018-09-13 12:18:53 -04:00
mazmazz 6824e6a359 Make extracolormap_t->fog UINT8; it's not boolean, but categorical 2018-09-13 12:08:46 -04:00
mazmazz 9a6a8b0b82 Outdated comment; unused var 2018-09-12 08:07:34 -04:00
mazmazz 55c43a2161 R_AddColormap will not return an existing colormap, and new colormap is not added to chain 2018-09-12 07:24:22 -04:00
mazmazz 87ad2a87f7 Smarter default fadergbaA and fadeend for relative calc 2018-09-12 07:14:23 -04:00
mazmazz 133c3598a7 Add fadestart/fadeend/fog to R_AddColormaps 2018-09-12 07:07:26 -04:00
mazmazz 90aeac5058 Add R_CheckEqualColormaps comparison method 2018-09-11 22:43:12 -04:00
mazmazz f0c11eb135 R_AddColormaps method 2018-09-11 21:03:55 -04:00
mazmazz 548f02eea1 Extra macros R_GetRgbaRGB; R_PutRgbaR/G/B/A/RGB/RGBA 2018-09-11 17:30:43 -04:00
mazmazz 5975f26177 Don't set sector's extra_colormap if we just made a default clone
* Allow colormap parsing to proceed in p_setup always
* Add R_CheckDefaultColormap
* Add R_GetRgbaR/G/B/A macros
2018-09-11 17:08:57 -04:00
mazmazz 71ade23739 Ifdef typo 2018-09-11 15:59:56 -04:00
mazmazz c920827032 Consolidate colormap matching into R_GetColormapFromList 2018-09-11 15:56:21 -04:00
mazmazz 85d89287de Add R_CopyColormap 2018-09-11 15:20:30 -04:00
mazmazz ba88f8ebb6 Smarter string digit parsing; allow alpha-only values
* GetDefaultColormap and CheckDefaultColormapValues methods
2018-09-11 15:01:05 -04:00
mazmazz 4ef016e40f Clear colormaps properly (resolve sigsegv crash) 2018-09-11 13:46:34 -04:00
mazmazz a818b9a1dc Remove cr/cg/cb/ca in favor of rgba * Change default colormap values to be in sync with rgba/fadergba 2018-09-11 13:27:04 -04:00
mazmazz b7a216c78b Add COLORMAPREVERSELIST ifdef to toggle Newest -> Oldest extra_colormaps order 2018-09-10 22:37:27 -04:00
mazmazz 43ae25c4fd Make default extracolormap on init
* Calc fadedist in R_CreateLightTable
2018-09-10 21:56:57 -04:00
mazmazz 3da38f2a9b Fixed colormap matching code again * Added debug messages for matching code 2018-09-10 20:56:59 -04:00
mazmazz 8d78c22194 extracolormap_t refinement and netsyncing
* Store raw values per rgba in extracolormap_t (no maskcolor or fadecolor)
* Crunched some UINT16/32 into UINT8
* Calculate mask values in R_CreateLightTable
* ifdef out EXTRACOLORMAPLUMPS
2018-09-10 20:36:34 -04:00
mazmazz 7608583c6f Fix shared colormap matching 2018-09-10 16:42:07 -04:00
mazmazz 2701976ba3 Compiler fixes 2018-09-10 16:28:39 -04:00
mazmazz e33ed45b7b Colormap overhaul in r_data.c
* Split R_CreateColormap to R_CreateLightTable
* Replace extra_colormaps array with next/prev pointer chain
* Remove foundcolormaps; instead store lumpnum in extracolormap_t
* Add properties to extracolormap_t for portability
2018-09-10 15:59:31 -04:00
mazmazz fef38acc59 Merge remote-tracking branch 'public-gitlab/colormap-code-cleanup' into colormap-cleanup 2018-09-10 13:24:57 -04:00
Monster Iestyn 40ff436829 Remove commented out stuff, now I've confirmed everything works fine without them 2018-09-10 15:49:21 +01:00
Monster Iestyn c0bf79ad8e R_CreateColormap2 and R_MakeColormaps have been made obsolete, it's just R_CreateColormap now, like it used to be!
With that, I moved R_CreateColormap2's exclusive software colormap malloc code to R_CreateColormap, and merged the two software-only blocks of code into one. I also disabled any unneeded variables and fixed a preprocessor-related goofup
2018-09-09 22:48:09 +01:00
Monster Iestyn 58a844d3cf Merge branch 'public_next'
# Conflicts:
#	src/r_things.c
#	src/v_video.c
2018-08-28 19:31:08 +01:00
toaster 973b3c3f5e Continuing my recent streak of making random lighting/colormap-related fixes to long-standing bugs:
* Fix that thing where ALL transparent FOF planes were continuously fullbright unless encased in a fog which disables sprite fullbrightness, which was long-hated by many people in the community!
	* For backwards compatibility, setting flag 1 in that fog field (which is probably the most common "in-the-wild" usage of this feature) will continue to make objects un-fullbright.
	* For situations where you desperately want the behaviour to be enabled, you can apply fog flag 2.
* Change the fadestart and fadeend range in which colormaps are generated.
	* The problem HERE was that the darkest light level reached by generated colormaps was actually slightly brighter than the darkest level reached by normal colormaps.
	* The typo I fixed does have SOME basis in fact - standard colormap lumps are 34 (33 in 0-indexing) long rather than 32 (31), but whoever wrote this didn't realise that the code for generating them didn't do it DooM style, just bright-to-dark with no extras on the end...
2018-08-25 16:46:45 +01:00
Monster Iestyn bf88407d00 Make sure both software and OpenGL ignore patches that are completely out of a multi-patch texture's bounds.
This fixes OpenGL in particular crashing because of such a weird situation.
2018-02-09 17:23:35 +00:00
Alam Ed Arias 7f4424b4a0 whitespace cleanup 2017-11-02 23:13:34 -04:00
toasterbabe efc4d2f81d * Make multiple ANIMDEFS lumps get loaded.
* Refactor the multiple TEXTURES lump code.
2017-10-28 17:12:08 +01:00
toasterbabe 50d6208913 Merge branch 'master' of http://git.magicalgirl.moe/STJr/SRB2Internal.git into FileManagement 2017-10-21 14:28:44 +01:00
wolfy852 b298c7a541 Fix p_spec.c and r_things.h, get the compiler to shut up
This compiles with no errors or warnings, but hasn't been tested yet. Please review/test when you can.
2017-10-07 17:18:25 -05:00
Monster Iestyn 302d0425e0 Incinerated WinCE 2017-09-29 23:25:34 +01:00
Nevur b087c16eb1 Merge branch 'toastfixes' of http://git.magicalgirl.moe/STJr/SRB2Internal.git into FileManagement
# Conflicts:
#	src/p_setup.c
#	src/p_spec.c
2017-09-04 21:13:29 +02:00
toasterbabe a3767fedac Clean out code/update comments relating to TEXTUREn, TEXTURE (SOC), PNAMES, and ANIMATED. 2017-08-08 22:03:37 +01:00
Nevur d5e38c087d Merge branch 'master' of http://git.magicalgirl.moe/STJr/SRB2Internal.git into FileManagement
# Conflicts:
#	src/p_setup.c
2017-06-25 14:51:37 +02:00
Nevur 35189dc219 Fixed PK3s.
-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.
2017-06-25 14:02:39 +02:00
Nevur 16336dbe22 I'm pushing this because I'm having issues. Changes so far:
-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.
2017-05-28 21:47:15 +02:00
Monster Iestyn 21d29c8550 Merge branch 'public_next' 2017-05-17 16:19:01 +01:00
Nevur d4c324eb30 PK3 stuff again.
-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.
2017-05-16 21:10:02 +02:00
Monster Iestyn f8482421e5 Don't need to use WADFILENUM/LUMPNUM in this function, since W_CheckNumForNamePwad returns just the lump number, not a combined WAD + lump number frankenstein's monster
This is just in case someone actually tries to dump in C_START/C_END and "add" colormaps using them, not that they would ever be used currently anyway.
2017-05-15 14:38:55 +01:00
Monster Iestyn 222807c6f6 Fix R_InitExtraColormaps reporting 6 or more colormaps every time you loaded the game, even though we haven't used C_START/C_END in more than a decade now
Note to self: W_ functions are awfully confusing with returning with LUMPERROR or INT16_MAX. Should sort out what's going on there if necessary
2017-05-15 14:29:31 +01:00
Nevur ea2846394e More PK3 work. Now we're getting somewhere.
-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>
2017-05-07 12:30:06 +02:00
Nevur 8ef6d6fd9e A bit more work on PK3.
-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.
2017-05-06 16:52:53 +02:00
Nevur 2c614f8f2c More work on PK3 handling.
-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.
2017-05-01 16:37:32 +02:00
toasterbabe d669a4e84a Introducing pMasterPalette.
Used instead of pLocalPalette when attempting to determine objective truths, such as "the colours of this gif without color profile modification" and "what indicies should this colormap remap to".

Also, made f_wipe.c's paldiv only get calculated once.
2017-04-30 22:18:06 +01:00
Monster Iestyn f0256c41be Be gone ye old texture hack 2017-04-19 20:00:19 +01:00