Commit Graph

147 Commits

Author SHA1 Message Date
Christoph Oelckers e6e4f0f305 - disabled redirection to the original patch for FSpecialFont.
Using the same code as for the standard font does not work as intended, the reason still needs to be investigated.
2018-12-15 19:15:05 +01:00
Christoph Oelckers d1ca2a91f3 - fixed: ThePatchRemap table was only initialized in one of FFont's constructors. 2018-12-15 17:49:12 +01:00
Christoph Oelckers 056b2c3a80 - handle CR_UNTRANSLATED so that it doesn't force CR_UNTRANSLATED to the palette.
Since the entire font setup is very much incapable of handling this during rendering, short of a complete rewrite, it was necessary to put the relevant code into the places which process the characters for drawing so that it can disable the translation table (which needs to be passed as raw data to the draw functions) and keep track of both the translatable and the original variant of the character graphics.
2018-12-15 14:51:03 +01:00
Christoph Oelckers 48d87e3dcf - use TArrays for most buffers being used in the font class. 2018-12-15 11:55:21 +01:00
Christoph Oelckers 8fcc170e8f - add font characters to the texture manager for easier management
These were the only non-transient textures not being handled by the texture manager which complicarted operations that require itrer
2018-12-12 01:25:25 +01:00
Christoph Oelckers 34884e2756 - base FFontChar1 and FFontChar2 on FImageSource as well.
Now the only textures not being backed by an image source that are actually getting used during normal rendering are the canvas textures.
2018-12-09 16:00:27 +01:00
Christoph Oelckers 82bd742ea3 - reworked how the software renderer manages its textures.
* it's no longer the main texture objects managing the pixel buffer but FSoftwareTexture.
* create proper spans for true color textures. The paletted spans only match if the image does not have any translucent pixels.
* create proper warp textures instead of working off the paletted variants.

As a side effect, caching of pixel buffers for texture composition is temporarily disabled, as it management of texture redirections. These things will be reimplemented once things progress further. The existing methods here had their share of serious issues that should be fixed.
2018-12-08 12:42:35 +01:00
Christoph Oelckers 69cc1f831c Renamed FTexture::GetPixels
This was needed to allow refactoring without letting all the other GetPixels get in the way.
2018-12-07 03:35:10 +01:00
Christoph Oelckers 9409843931 - replaced the last access operator, too
Now everything uses a function.
This really wasn't what operators are supposef to be used for.
2018-12-07 03:01:40 +01:00
Christoph Oelckers 79a0f76801 - replaced TexMan.operator() with two functions.
This was done to make reviewing easier, again because it is virtually impossible to search for the operators in the code.

Going through this revealed quite a few places where texture animations were on but shouldn't and even more places that did not check PASLVERS, although they were preparing some paletted rendering.
2018-12-07 02:53:18 +01:00
Christoph Oelckers bde3558dc2 - moved the bit size variables to FSoftwareTexture
They are only needed by the software rasterizer.
2018-12-07 02:13:11 +01:00
Christoph Oelckers 4c67785c40 - moved the span and swtruecolor creation code into FSoftwareTexture. 2018-12-07 00:04:39 +01:00
Christoph Oelckers a4d61e6fb1 - everything compiles again.
As a bonus this already fixes several bugs caused by the botched texture scaling implementation the original texture manager came with.
System cursors are currently disabled because they rely on functionality that needs to be moved to different classes.
2018-12-06 20:12:15 +01:00
Christoph Oelckers 6eab4a882c - narrowing down the public interface of the texture class
Cannot refactor if the entire class is this wide open to everything.
Not complete yet, doesn't fully compile!
2018-12-06 01:11:04 +01:00
Christoph Oelckers a7e472b4b3 - moved all exports from class Font to vmthunks.cpp and gave them direct native entrypoints.
- changed PARAM_STRING to use the passed string by reference instead of by value. The 3 instances where passing by value was needed now use PARAM_STRING_VAL.
2018-12-01 10:30:50 +01:00
Christoph Oelckers 25ad71a113 - Changed a few allocations into usin TArrays
S_SoundCurve in particular looked like a candidate for leaking memory.
2018-11-30 17:07:42 +01:00
Christoph Oelckers 0d54d335c4 - use a saner data structure to store the BrokenLines.
Calling the old method with a pointer to an array of unspecified length 'dirty' would be an understatement.
Now it uses a TArray to store the single elements
2018-10-31 19:13:54 +01:00
alexey.lysiuk 050d72724f - fixed: always initialize active colors in special font
https://forum.zdoom.org/viewtopic.php?t=61859
2018-08-31 10:42:53 +03:00
alexey.lysiuk 2ae8d39441 Removed all superfluous #include's
Automatically optimized by CLion IDE with manual corrections
2018-04-24 14:30:35 +03:00
Christoph Oelckers 6d6196388e - made SPROFS a more usable feature.
This was originally invented to fix the sprite offsets for the hardware renderer.
Changed it so that it doesn't override the original offsets but acts as a second set.
A new CVAR has been added to allow controlling the behavior per renderer.
2018-03-31 10:37:46 +02:00
Christoph Oelckers a001a5304d - removed the old software renderer framebuffers for Windows
This cannot be refactored with the old code still present and done properly both renderers should share what they can.
2018-03-30 23:18:25 +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
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 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 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 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
Christoph Oelckers cc54db6e6d - let the 3 relevant text functions handle UTF-8 strings
These functions are: DCanvas::DrawTextCommon, V_BreakLines and FFont::StringWidth.
This will allow strings from UTF-8 encoded assets to display properly, but also handle the OpenAL device name on international systems, as this will be returned as an UTF-8 string.

Due to backwards compatibility needs the decoding function is rather lax to allow both UTF-8 and ISO 8859-1 to pass through correctly - and this also implies that it will allow mixed encodings which may happen if strings from different sources get concatenated.
2017-12-02 21:21:57 +01:00
alexey.lysiuk 724d711d1f Fixed a few cases when IWAD was checked by hardcoded index 2017-10-21 11:10:36 +03:00
alexey.lysiuk f174111128 Fixed read beyond buffer boundary during font color parsing
Printing of string that ends with '\c' led to undefined behavior
Example: 'echo \c' in console
2017-09-23 11:57:06 +03:00
Rachael Alexanderson 765646ee1c - fixed: Changed IWAD_FILENUM to a dynamic lookup. 2017-09-13 04:19:03 -04:00
Christoph Oelckers aa8424982c - fixed: The color for untranslated font was missing its alpha channel. 2017-08-12 12:04:40 +02:00
alexey.lysiuk f4672d67bc Fixed crash when drawing untranslated font
https://forum.zdoom.org/viewtopic.php?t=57268
2017-07-19 13:24:19 +03:00
Christoph Oelckers 6599e2c425 - moved the VM types into their own file and only include it where really needed. 2017-04-13 01:12:04 +02:00
Christoph Oelckers 01b095c911 - added colorization for untranslated fonts. This uses the light color of the vertices. The software rendered 2D code will ignore this infomation.
- added a virtual OnRetrun method to menus.
2017-03-29 21:22:05 +02:00
Christoph Oelckers 622b4a6457 - switched over to the scripted intermission screens. 2017-03-18 21:19:32 +01:00
Christoph Oelckers c008ddaf66 - replaced homegrown SWORD, SBYTE and uint32_t types. 2017-03-09 19:31:45 +01:00
Rachael Alexanderson cc9a2e5121 Merge https://github.com/coelckers/gzdoom 2017-03-08 21:25:24 -05:00
Christoph Oelckers 8ab562ef13 - the fourth. 2017-03-08 18:55:54 +01:00
Rachael Alexanderson 7a5df2bc28 Merge commit 'b0eb19b' 2017-02-26 13:41:02 -05:00
Christoph Oelckers b0eb19bbc8 - added an option to define untranslated fonts through FONTDEFS. Note that due to how the fonts work they cannot be colorized AT ALL! 2017-02-26 19:29:27 +01:00
Rachael Alexanderson 8c176575c8 Merge https://github.com/coelckers/gzdoom 2017-02-12 21:39:20 -05:00
Christoph Oelckers 947b625c50 - all menu items scriptified, but not yet active. 2017-02-11 16:11:48 +01:00
Rachael Alexanderson a52f79055d Merge https://github.com/coelckers/gzdoom
# Conflicts:
#	src/menu/playerdisplay.cpp
2017-02-11 05:05:24 -05:00
Christoph Oelckers be9b2b38fc - ColorpickerMenu.MouseEvent exported. 2017-02-10 11:44:46 +01:00
Rachael Alexanderson 942f90a759 Merge remote-tracking branch 'gzdoom/master' 2017-02-05 16:07:48 -05:00
Christoph Oelckers d8a1ce88b0 - a few more exports from FFont. 2017-02-05 13:55:38 +01:00
Christoph Oelckers b570d0819b - streamlined font handling for scripts a bit.
- moved the two 'you raised the alarm' messages for Strife to the string table
2017-02-05 13:14:22 +01:00
Rachael Alexanderson 59f32d497d Merge https://github.com/coelckers/gzdoom
# Conflicts:
#	src/r_things.cpp
#	src/v_draw.cpp
2017-02-05 00:08:01 -05:00