Commit graph

465 commits

Author SHA1 Message Date
Christoph Oelckers
4efb5187c7 - defaulted constructors and assignment operators of several trivial types.
# Conflicts:
#	src/hwrenderer/textures/hw_material.cpp
2018-08-28 13:43:51 +02:00
Magnus Norddahl
9c74c9629a - rewrite the user shader support for materials - new syntax is to create a 'Material ProcessMaterial()' function
# Conflicts:
#	src/gl/shaders/gl_shader.cpp
#	src/hwrenderer/textures/hw_material.cpp
#	src/r_data/gldefs.cpp
#	wadsrc/static/shaders/glsl/main.fp
2018-08-20 01:22:34 +02:00
usernameak
4c106de5d7 Custom hardware shaders now can use custom texture units
# Conflicts:
#	src/gl/textures/gl_material.cpp
#	src/textures/textures.h
2018-08-19 21:47:32 +02:00
Christoph Oelckers
b03c329ec6 - moved all GLDEFS parsing into a dedicated source file.
- split gl_postprocessshader.h in two so that the hardware independent part can be used by GLDEFS without pulling in all of OpenGL.

# Conflicts:
#	src/CMakeLists.txt
#	src/gl/dynlights/gl_glow.cpp
#	src/gl/renderer/gl_postprocess.cpp
#	src/gl/textures/gl_texture.cpp
2018-08-19 20:56:49 +02:00
Christoph Oelckers
0fd1909f2c - got rid of FNameNoInit and made the default constructor of FName non-initializing.
This setup has been a constant source of problems so now I reviewed all uses of FName to make sure that everything that needs to be initialized is done manually.
This also merges the player_t constructor into the class definition as default values.
2018-08-19 10:36:10 +02:00
David Carlier
ce4d1fc1e4 Texture data overlap occuring here, using memmove instead. 2018-08-04 09:51:26 +02:00
David Carlier
4902143d7b foo being allocated with metadata based allocator needs to
be freed similarly.

(cherry picked from commit 2a59327aeb)
2018-07-06 11:04:56 +02:00
Magnus Norddahl
f6e64f5018 - add #include support to TEXTURES lump
(cherry picked from commit cadc4f2a30)

# Conflicts:
#	src/textures/texturemanager.cpp
2018-05-25 12:59:28 +02:00
alexey.lysiuk
a545e7de35 - added end line to various messages
so they don't screw up further output anymore

(cherry picked from commit f17f8c9359)

# Conflicts:
#	src/gl/compatibility/gl_swshader20.cpp
2018-05-12 11:49:10 +02:00
Christoph Oelckers
f8019637cf - fixed: FBuildTexture::CopyTrueColorPixels returned incorrect transparency information 2018-03-26 11:46:33 +02:00
Christoph Oelckers
e89a598b31 - renamed FTexture's UseType flags and gave them a dedicated type.
This was done mainly to reduce the amount of occurences of the word FTexture but it immediately helped detect two small and mostly harmless bugs that were found due to the stricter type checks.
2018-03-25 20:26:16 +02:00
alexey.lysiuk
2951476ce0 Fixed compilation with GCC and Clang
src/v_video.h:56:6: error: ISO C++ forbids forward references to 'enum' types
src/v_video.h:342:17: error: field has incomplete type 'FTextureFormat'
src/v_video.h:344:47: error: variable has incomplete type 'FTextureFormat'
2018-03-24 09:53:55 +02:00
Christoph Oelckers
7301001a3f - made the necessary adjustments to the HW2D interfaces to handle alpha textures properly.
These cannot be done with the regular textures so there needs to be an option to create more than one native texture per FTexture. For completeness' sake there is also the option now to create a paletted version of a texture if the regular one is true color. This fixes a long standing problem that translations were not applied to non-paletted textures.
2018-03-23 23:04:30 +01:00
Christoph Oelckers
4c781a8f65 - finished verification of proper texture generation and fixed a few remaining issues.
Aside from PCX 4 bit, uncompressed PCX and TGA grayscale for which I was unable to obtain test images, all others now produce proper textures in both 8 and 32 bit mode.
2018-03-23 19:52:08 +01:00
Christoph Oelckers
0a07f4c144 - fixed alpha texture generation for OpenGL rendering.
The old logic used a translation table that does not work with color images, it was designed to handle 8 bit grayscale images.
So now, it creates a true color buffer and then turns it into a texture with R,G,B = 255 and the alpha channel set to the grayscale value.

This was also the reason why crosshairs made from 32 bit PNGs did not show correctly.
2018-03-22 23:57:14 +01:00
Christoph Oelckers
5466e2c7c5 - fixed what looks like a wrongly braced 'for' loop in 4 bit PCX.
The code looks wrong, unfortunately I cannot test it due to lack of an image in that format
2018-03-22 23:14:43 +01:00
Christoph Oelckers
6fcf1e0149 - fixed incorrect translation table that was used to process grayscale patch and IMGZ textures.
- fixed: The MD5 check for patches deleted the buffer too early.
2018-03-22 22:49:42 +01:00
Christoph Oelckers
c869df9bf7 - added missing checksum file.
- fixed decoding of uncompressed DDS textures.

Apparently this was never tested and nobody ever used this format as a texture in ZDoom.
2018-03-22 22:30:09 +01:00
Christoph Oelckers
702e948000 Merge remote-tracking branch 'remotes/origin/adlMIDI' into alphatex2 2018-03-22 20:44:32 +01:00
Christoph Oelckers
d586d774cf - adjusted GL renderer to the new rules for alpha textures. This means that the translation fallback is only needed for the legacy renderer now. Modern GL can use the regular texture and will apply a grayscale mapping instead of merely using the red channel. 2018-03-22 20:42:17 +01:00
Christoph Oelckers
1756035594 - fixes in DDS decoder.
- let FPatchTexture use the inline color getters.
2018-03-22 00:54:03 +01:00
Christoph Oelckers
b473838627 - adjustments and fixes for alphatextures:
* Instead of using the red channel it now uses the grayscale value. While slower in a few situations, it is also more precise and makes the feature more useful.
* For paletted textures do not use the index as alpha anymore but the actual grayscaled color. This is again to make the feature more consistent and useful.
* To compensate for the above there is now a list of hashes for known alpha textures in patch format, so that they don't get broken.
* IMGZ is now considered a grayscale format. There's only two known textures that use IMGZ for something else than crosshairs and those are explicitly handled.
* several smaller fixes.
* the actual color conversion functions for paletted output are now consolidated in a small number of inlines so that future changes are easier to do.

Note: This hasn't been tested yet and will need further changes in the hardware rendering code. As it is it is not production-ready.
2018-03-22 00:29:01 +01:00
alexey.lysiuk
568d439c24 Removed deleted virtual functions
This solves linking errors on macOS with missing ___cxa_deleted_virtual symbol
2018-03-20 22:12:43 +02:00
alexey.lysiuk
6f68b6c352 Fixed JPEG errors reporting
GCC/Clang reported these warnings:
src/textures/jpegtexture.cpp:305:29: warning: data argument not used by format string [-Wformat-extra-args]
src/textures/jpegtexture.cpp:388:28: warning: data argument not used by format string [-Wformat-extra-args]
src/textures/jpegtexture.cpp:432:29: warning: data argument not used by format string [-Wformat-extra-args]
src/textures/jpegtexture.cpp:481:28: warning: data argument not used by format string [-Wformat-extra-args]
2018-03-20 10:29:28 +02:00
Christoph Oelckers
cf67883e6a - changed copyright notice. 2018-03-19 21:01:32 +01:00
Christoph Oelckers
16f6a88680 - fixed Build tiles and removed test code. 2018-03-19 20:56:04 +01:00
Christoph Oelckers
bf2003fe6a - fixed pixel address.
Colors still need work.
2018-03-19 20:09:32 +01:00
Christoph Oelckers
04b8a12ca4 - Build texture work. Currently broken. 2018-03-19 20:02:38 +01:00
Christoph Oelckers
f4d9ad1123 - extended FTexture::GetPixels and FTexture::GetColumn by a RenderStyle parameter.
Now it is no longer necessary to provide specially set up textures for rendering shaded decals, they can use any PNG texture now that contains a proper red channel.
Handling of the alPh chunk has been removed as a result as it in no longer needed.
2018-03-18 21:33:44 +01:00
Christoph Oelckers
a399d79f8a - minor reformatting. 2018-03-18 14:18:42 +01:00
Christoph Oelckers
47bfbb5e08 - Make BuildTexture inherit from worldtexture.
- handle WorldTextures that can change their content automatically.
2018-03-18 14:18:19 +01:00
Christoph Oelckers
94eadb1a8c - made it compile again. 2018-03-18 13:47:40 +01:00
Christoph Oelckers
de8db297a6 - made the backdrop texture also inherit from FWorldTexture.
In this case the only benefit is one less piece of GetColumn duplication - this texture is simply not usable in-game, unlike the BarShader.
2018-03-18 13:12:25 +01:00
Christoph Oelckers
494504229f - fixed the BarShader texture.
Even though unlikely, this should work as a regular texture because it can be used as such.
As a result of the above, true color generation needs to be done explicitly now.
2018-03-18 12:54:40 +01:00
Christoph Oelckers
1d59a53cd4 - added worldtexture.cpp 2018-03-18 12:54:14 +01:00
Christoph Oelckers
7e169eb76f - split out the span generation from most texture classes
Until now each subclass of FTexture had to implement the entire span generation itself, presumably so that a few classes can use simpler structures.
This does not work if a texture can have more than one pixel buffer as is needed for alpha textures.
Even though it means that some classes will allocate more data now, it's the only way to do it properly.
In addition this removes a significant amount of mostly redundant code from the texture classes.

- added alpha texture processing to all converted classes

As of now this is not active and not tested.
Note that as part of the conversion even those textures that were working as alphatextures will not look correct until the higher level code gets adjusted.
2018-03-18 12:36:14 +01:00
Christoph Oelckers
b939836846 - renamed FileRdr back to FileReader. 2018-03-11 19:29:37 +01:00
Christoph Oelckers
0be1ed252b - rewrote the operator>> methods of FileReader as normal functions for clarity. 2018-03-11 18:20:49 +01:00
Christoph Oelckers
b14ee50d0d - transition to new FileReader interface complete, but untested. 2018-03-11 12:33:46 +01:00
Christoph Oelckers
b315bc3be0 - added a few more FileRdr replacements
- fixed: The streaming music player must return the file reader if it fails to open, so that the next player can still use it.
- fixed: Timidity++'s Instruments class did not delete the sound font when it was destroyed.

..-
2018-03-10 20:33:49 +01:00
Christoph Oelckers
c4387459bb - use FileRdr in the PNG code, in particular to sanitize the savepic handling. 2018-03-10 19:22:26 +01:00
Christoph Oelckers
5fa63c396d - sound code and most of texture code converted to FileRdr.
This allowed to remove a lot of bad pointer voodoo in the music loader, because the new class does not allow duplication of the reader object
2018-03-10 18:45:11 +01:00
Magnus Norddahl
94fbcacf22 Merge branch 'gzdoom' into materials 2018-02-10 00:08:17 +01:00
Christoph Oelckers
c1d2b54820 - let TexMan.GetName return the actual name for a texture that was created from a full path name. 2018-01-28 11:54:24 +01:00
Magnus Norddahl
7a59bcde4c - move glossiness and specular level to GLDEFS 2018-01-25 19:53:55 +01:00
Magnus Norddahl
f3c55c01c8 Add material definition to GLDEFS 2018-01-20 16:28:24 +01:00
alexey.lysiuk
9b52c18ef6 Improved layout of FMultiPatchTexture::TexPart structure
Removed "gaps" between members (for 64-bit targets) and initialized them in place
2018-01-13 12:44:23 +02:00
alexey.lysiuk
d95ac93376 Fixed crash when resolving multipatches with missing textures
https://forum.zdoom.org/viewtopic.php?t=59088
2018-01-13 12:41:19 +02:00
Christoph Oelckers
20b8c1ef70 - moved buildtexture.cpp from using stdio-based file IO to FileReader. 2017-12-02 11:57:32 +01:00
Rachael Alexanderson
505da5bf4f Merge branch 'master' of https://github.com/coelckers/gzdoom into newtimercode4 2017-11-21 05:23:00 -05:00