vid_hw2d false

Moderators: Rachael, dpJudas

Locked
User avatar
Rachael
Developer
Developer
Posts: 3616
Joined: Sat May 13, 2006 10:30

vid_hw2d false

Post by Rachael » Sat Oct 15, 2016 15:28

There are some font/graphics drawers that still need to be worked on. I plan to take this on myself, later on tonight, if I have extra time available.

When typing the subject command into the console, we get exactly the display that will appear on Linux and Mac.
Screenshot_Doom_20161015_102846.png
Screenshot_Doom_20161015_102846.png (213.11 KiB) Viewed 163 times
Spoiler: Zen Sarcasm

dpJudas
Developer
Developer
Posts: 798
Joined: Sat Jul 23, 2016 7:53

Re: vid_hw2d false

Post by dpJudas » Sat Oct 15, 2016 18:53

I have seen this issue before. It is either due to one of the blend models being wrong, or somehow related to the switch to true color textures for the columns.

User avatar
Rachael
Developer
Developer
Posts: 3616
Joined: Sat May 13, 2006 10:30

Re: vid_hw2d false

Post by Rachael » Sun Oct 16, 2016 0:02

This happened when you got the sprites in true color. The 2D graphics use the same functions as the sprite callers and masked textures do. All I have to do is look up what you did to the sprite callers, apply it to these, and everything should be golden.
Spoiler: Zen Sarcasm

dpJudas
Developer
Developer
Posts: 798
Joined: Sat Jul 23, 2016 7:53

Re: vid_hw2d false

Post by dpJudas » Sun Oct 16, 2016 0:54

If that's the cause it would be great as that'd make it really easy to fix. I fear it one of the blend variants that is not doing the right math. I think at least one of them need to be calling a helper function called calc_blend_bgalpha, but I'm not sure which one. Knowing which blend mode it is using would help a lot with tracking it down.

User avatar
Rachael
Developer
Developer
Posts: 3616
Joined: Sat May 13, 2006 10:30

Re: vid_hw2d false

Post by Rachael » Sun Oct 16, 2016 1:05

It's been a while since I played with this stuff. I remember I successfully at one time got all the menu stuff ported over to the Bgra drawers, except that the Bgra drawers were still reading the input as byte input instead of DWORD input and were outputting blue textures.
Spoiler: Zen Sarcasm

dpJudas
Developer
Developer
Posts: 798
Joined: Sat Jul 23, 2016 7:53

Re: vid_hw2d false

Post by dpJudas » Sun Oct 16, 2016 1:11

It is a good place to start looking, but if all the inputs turn out to be correct, my next look would be at the function I linked. Hopefully it isn't too scary as it is in codegen section. Worst thing that can happen is that it burns down your PC and kills your cat. :)

User avatar
Rachael
Developer
Developer
Posts: 3616
Joined: Sat May 13, 2006 10:30

Re: vid_hw2d false

Post by Rachael » Sun Oct 16, 2016 1:14

Okay, I did it by modifying the drawers themselves. I pretty much stopped all palette drawers from working in Truecolor mode and made them accept only Bgra input - except they wouldn't actually read the Bgra input because despite it being fed to them they still read it byte-by-byte.
dpJudas wrote: Worst thing that can happen is that it burns down your PC and kills your cat. :)
My poor cat. :(
Spoiler: Zen Sarcasm

dpJudas
Developer
Developer
Posts: 798
Joined: Sat Jul 23, 2016 7:53

Re: vid_hw2d false

Post by dpJudas » Sun Oct 16, 2016 1:17

You have an actual cat? Maybe I should stop using this expression then. :p

User avatar
Rachael
Developer
Developer
Posts: 3616
Joined: Sat May 13, 2006 10:30

Re: vid_hw2d false

Post by Rachael » Sun Oct 16, 2016 1:43

I have 2 cats.

Anyway, I've gotten frustrated, I am giving up on this for now. This is where I am:
[spoiler]

Code: Select all

src/v_text.cpp | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/v_text.cpp b/src/v_text.cpp
index 5772b07..dc7ba82 100644
--- a/src/v_text.cpp
+++ b/src/v_text.cpp
@@ -52,6 +52,9 @@
 //
 // Write a single character using the given font
 //
+
+extern bool drawer_needs_pal_input;
+
 void DCanvas::DrawChar (FFont *font, int normalcolor, int x, int y, BYTE character, int tag_first, ...)
 {
 	if (font == NULL)
@@ -75,6 +78,7 @@ void DCanvas::DrawChar (FFont *font, int normalcolor, int x, int y, BYTE charact
 			return;
 		}
 		parms.remap = font->GetColorTranslation((EColorRange)normalcolor);
+		drawer_needs_pal_input = true;
 		DrawTextureParms(pic, parms);
 	}
 }
@@ -160,6 +164,7 @@ void DCanvas::DrawText(FFont *font, int normalcolor, int x, int y, const char *s
 				parms.destwidth = parms.cellx;
 				parms.destheight = parms.celly;
 			}
+			drawer_needs_pal_input = true;
 			DrawTextureParms(pic, parms);
 		}
 		cx += (w + kerning) * parms.scalex;
[/spoiler]

Other things I've tried - going directly into DrawTextureParms and commenting out the Bgra input entirely. That didn't go so well. I'm frustrated, I want to lay down, if you fix this, great, if not, I'll try again tomorrow.

p.s. I've tried drawer_needs_pal_input both true and false.

I haven't touched the LLVM functions. I'm a little intimidated by them.
Spoiler: Zen Sarcasm

dpJudas
Developer
Developer
Posts: 798
Joined: Sat Jul 23, 2016 7:53

Re: vid_hw2d false

Post by dpJudas » Sun Oct 16, 2016 15:19

I've managed to fix this one. Turns out that DrawTextureParms used dc_colormap instead of dc_translation. That was a nasty one to track down. Last time I had this problem I rolled back the entire bgra drawer attempt for sprites because I couldn't figure out what was going on.

User avatar
Rachael
Developer
Developer
Posts: 3616
Joined: Sat May 13, 2006 10:30

Re: vid_hw2d false

Post by Rachael » Sun Oct 16, 2016 23:01

Oh, neat. That means I am almost ready to push 0.1, now.
Spoiler: Zen Sarcasm

Locked

Return to “Closed Bugs”