bolrog / d2dx

D2DX is a complete solution to make Diablo II run well on modern PCs, with high fps and better resolutions.
GNU General Public License v3.0
399 stars 47 forks source link

Support "bold" white color codes (was [Bug][1.14d] Color text bug) #74

Open tytannial opened 3 years ago

tytannial commented 3 years ago

White text is rendered to black text.

org. 20210517214825

d2dx 20210517214802

bolrog commented 3 years ago

Hmm is this new? Haven't seen it before.

tytannial commented 3 years ago

Hmm is this new? Haven't seen it before.

https://www.moddb.com/mods/median-xl/downloads/median-xl-2012-v005

Humm. Legacy version.

bolrog commented 3 years ago

Does it happen in vanilla D2/LoD too?

Yh793 commented 3 years ago

Does it happen in vanilla D2/LoD too? T1

1.13d

tytannial commented 3 years ago

Only the text color with the white mark is broken. Normal color of text is different with white. With a white mark in tbl file, the text has a glow board.... but it becomes black in d2dx mode.

bolrog commented 3 years ago

Thanks, I understand what you mean now. I'll investigate.

tytannial commented 3 years ago

These are color codes ÿc0 – white ÿc1 – red ÿc2 – "set" green ÿc3 – "magic" blue ÿc4 – "unique" gold ÿc5 – gray ÿc6 – black (barely visible in the profile) ÿc7 – same as 4 ÿc8 – "crafted" amber ÿc9 – "rare" yellow

In tbl, text start with ÿc0

bolrog commented 3 years ago

Is there a simple mod I could load to see this?

tytannial commented 3 years ago

Is there a simple mod I could load to see this?

see the link i have post at 3rd reply

bolrog commented 3 years ago

I see white here, but is that the same color code you mean? image

tytannial commented 3 years ago

I see white here, but is that the same color code you mean? image

YES 20210522090044

I use version 521.

bolrog commented 3 years ago

This is truly weird. I wonder what the difference is... I used MXL 2012 with 1.13d. No other mods loaded.

tytannial commented 3 years ago

This is truly weird. I wonder what the difference is... I used MXL 2012 with 1.13d. No other mods loaded.

maybe it is broken in the 1.14d?

updawg commented 3 years ago

What language installer are you using? Could that be the difference?

On Sat, May 22, 2021 at 10:52 AM Tytannial @.***> wrote:

This is truly weird. I wonder what the difference is... I used MXL 2012 with 1.13d. No other mods loaded.

maybe it is broken in the 1.14d?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/bolrog/d2dx/issues/74#issuecomment-846418995, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACMSYAFDF23QPE7M6MW3MTDTO7AJJANCNFSM45AQC75Q .

tytannial commented 3 years ago

What language installer are you using? Could that be the difference? On Sat, May 22, 2021 at 10:52 AM Tytannial @.***> wrote: This is truly weird. I wonder what the difference is... I used MXL 2012 with 1.13d. No other mods loaded. maybe it is broken in the 1.14d? — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub <#74 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACMSYAFDF23QPE7M6MW3MTDTO7AJJANCNFSM45AQC75Q .

Confirmed, I test game in hyper-V VM. When I update game to 1.14d, white text become black. Text color works correctly in 1.13c and 1.13d.

bolrog commented 3 years ago

The problematic color code is "ÿc/" whatever that means!

"ÿc/passive - regenerates life when you kill an enemy in treewarden form"

It's strange because the color codes are supposed to start at '0', but going by the ASCII table, '/' is one step before 0 (0x2F). I wonder why it's a problem only in 1.14 though.

tytannial commented 3 years ago

The problematic color code is "ÿc/" whatever that means!

"ÿc/passive - regenerates life when you kill an enemy in treewarden form"

It's strange because the color codes are supposed to start at '0', but going by the ASCII table, '/' is one step before 0 (0x2F). I wonder why it's a problem only in 1.14 though.

You are right.

As you can see, this bug is in the nGlide too. It is a 1.14d bug. 20210524123734

and....GLIDE3-to-OpenGL-Wrapper 20210524124502

tytannial commented 3 years ago

Finally I found this in PlugY readme. Goddamn Blizzard.🤣

* Color list values (color code greater than 12 is black in 1.14d fullscreen): - Invisible: 6 - Dark gray: 5 - Gray: 16 - Light gray: 15 - White: 0, - Bright white: 18 - Gold: 4 - Dark yellow: 7 - Yellow: 9 - Orange: 8 - Darkest green: 10 - Dark green: 12 - Green: 2 - Blue: 3 - Purple: 11 - Red: 1 - Crystal red: 19
bolrog commented 3 years ago

That explains it! Nice detective work. :)

bolrog commented 3 years ago

Do you know if any of the other colors would be used in MXL?

bolrog commented 3 years ago

For the upcoming release, I have added a simple remapping so that the black text in this case ("ÿc/") will appear white. This is only done for game version 1.14d.

tytannial commented 3 years ago

For the upcoming release, I have added a simple remapping so that the black text in this case ("ÿc/") will appear white. This is only done for game version 1.14d.

https://github.com/kambala-decapitator/QTblEditor/blob/a457953bb30fba84830ef24b9f33498ca646eeba/colors.cpp

I think there are all common color codes in most of the d2mods. I will do a test. 😉

tytannial commented 3 years ago

Test in 1.14d, version 521

DefaultMode DefaultMode

GlideMode GlideMode

Humm.....Maybe this bug caused by blizzard's display fix, I think.

Test case

ÿc!A ÿc"B ÿc#C ÿc$D ÿc%E ÿc&F ÿc'G ÿc(H ÿc)I ÿc*J ÿc+K ÿc,L ÿc-M ÿc.N ÿc/O ÿc0P ÿc1Q ÿc2R ÿc3S ÿc4T ÿc5U ÿc6V ÿc7W ÿc8X ÿc9Y ÿc:Z ÿc;A ÿc<B

ÿc!Aÿc"Bÿc#Cÿc$Dÿc%Eÿc&Fÿc'Gÿc(Hÿc)Iÿc*Jÿc+Kÿc,Lÿc-Mÿc.Nÿc/Oÿc0Pÿc1Qÿc2Rÿc3Sÿc4Tÿc5Uÿc6Vÿc7Wÿc8Xÿc9Yÿc:Zÿc;Aÿc<B

tytannial commented 3 years ago

Test in 1.13c, version 521

GlideMode 1 13c GlideMode

DefualtMode 1 13c DefualtMode

bolrog commented 3 years ago

Thanks for the screenshots! It looks like those extra color codes were meant for "bold" white text in different strengths. I don't think the Glide screenshots are the look they intended. It might be worth a shot to emulate the "default" ones in D2DX.

bolrog commented 3 years ago

Meanwhile, I have added a basic fix to release 525. It turns the '/' color to '0'.

qqkookie commented 1 year ago

I hope that it to be implemented correctly. There is quite limited selection in text color. To use D2 mods like loot filter effectively, we need wider selection of colors. Currently in directdraw mode only 12 colors are possible. in glide mode , 4 more text colors are possible. There is some more text color. I hope that these four glide-only colors will be implemented in D2DX.

#define TEXT_WHITE L"\xff" "c0"
#define TEXT_RED L"\xff" "c1"
#define TEXT_GREEN L"\xff" "c2"
#define TEXT_BLUE L"\xff" "c3"
#define TEXT_GOLD L"\xff" "c4"
#define TEXT_GRAY L"\xff" "c5"
#define TEXT_BLACK L"\xff" "c6"
#define TEXT_TAN L"\xff" "c7"
#define TEXT_ORANGE L"\xff" "c8"
#define TEXT_YELLOW L"\xff" "c9"
#define TEXT_PURPLE L"\xff" "c;"
#define TEXT_DARK_GREEN L"\xff" "c:"

// Glide only colors. In ddraw, opengl, and d2dx( -3dfx) mode, 
// these texts are displayed as "black" text  in D2 v1.14d  as pictures above. 

#define TEXT_CORAL L"\xff" "c\x06"             // pallet color 0x66
#define TEXT_SAGE L"\xff" "c\x07"              // pallet color 0x82
#define TEXT_TEAL L"\xff" "c\x09"                // pallet color 0xC8 
#define TEXT_LIGHT_GRAY L"\xff" "c\x0C"        // pallet color  0xD6

// OK color text on ddraw and d2dx. 

#define TEXT_MEDIUM_RED L"\xff" "c*"
#define TEXT_MEDIUM_GREEN L"\xff" "c<"
#define TEXT_MEDIUM_YELLOW L"\xff" "c+"
#define TEXT_BLUE_GREEN L"\xff" "c$"
#define TEXT_DARK_BLUE L"\xff" "c!"
#define TEXT_COLORS L"\xff" "c"

I hope that these glide only 4 colors implemented sooner in d2dx.