vid_hw2d false
- Rachael
- Developer
- Posts: 3646
- Joined: Sat May 13, 2006 10:30
vid_hw2d false
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.
When typing the subject command into the console, we get exactly the display that will appear on Linux and Mac.
-
- Developer
- Posts: 798
- Joined: Sat Jul 23, 2016 7:53
Re: vid_hw2d false
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.
- Rachael
- Developer
- Posts: 3646
- Joined: Sat May 13, 2006 10:30
Re: vid_hw2d false
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.
-
- Developer
- Posts: 798
- Joined: Sat Jul 23, 2016 7:53
Re: vid_hw2d false
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.
- Rachael
- Developer
- Posts: 3646
- Joined: Sat May 13, 2006 10:30
Re: vid_hw2d false
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.
-
- Developer
- Posts: 798
- Joined: Sat Jul 23, 2016 7:53
Re: vid_hw2d false
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.
- Rachael
- Developer
- Posts: 3646
- Joined: Sat May 13, 2006 10:30
Re: vid_hw2d false
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.
My poor cat.dpJudas wrote: Worst thing that can happen is that it burns down your PC and kills your cat.
-
- Developer
- Posts: 798
- Joined: Sat Jul 23, 2016 7:53
Re: vid_hw2d false
You have an actual cat? Maybe I should stop using this expression then. :p
- Rachael
- Developer
- Posts: 3646
- Joined: Sat May 13, 2006 10:30
Re: vid_hw2d false
I have 2 cats.
Anyway, I've gotten frustrated, I am giving up on this for now. This is where I am:
[spoiler][/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.
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;
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.
-
- Developer
- Posts: 798
- Joined: Sat Jul 23, 2016 7:53
Re: vid_hw2d false
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.
- Rachael
- Developer
- Posts: 3646
- Joined: Sat May 13, 2006 10:30
Re: vid_hw2d false
Oh, neat. That means I am almost ready to push 0.1, now.