Baron of Hell
Register | User Profile | Member List | F.A.Q | Privacy Policy | New Blog | Search Forums | Forums Home
Doomworld Forums : Powered by vBulletin version 2.2.5 Doomworld Forums > Classic Doom > WADs & Mods > Modifying translation table code in Doom
 
Author
All times are GMT. The time now is 01:40. Post New Thread    Post A Reply
Kaiser
Doom64 Guru


Posts: 2859
Registered: 08-00


I've been looking though the prboom/boom source code and I can not find where the translation color is set.

I've inspected this code from v_video.c


code:
/* * V_InitColorTranslation * * Loads the color translation tables from predefined lumps at game start * No return * * Used for translating text colors from the red palette range * to other colors. The first nine entries can be used to dynamically * switch the output of text color thru the HUlib_drawText routine * by embedding ESCn in the text to obtain color n. Symbols for n are * provided in v_video.h. * * cphipps - constness of crdef_t stuff fixed */ typedef struct { const char *name; const byte **map; } crdef_t; // killough 5/2/98: table-driven approach static const crdef_t crdefs[] = { {"CRBRICK", &colrngs[CR_BRICK ]}, {"CRTAN", &colrngs[CR_TAN ]}, {"CRGRAY", &colrngs[CR_GRAY ]}, {"CRGREEN", &colrngs[CR_GREEN ]}, {"CRBROWN", &colrngs[CR_BROWN ]}, {"CRGOLD", &colrngs[CR_GOLD ]}, {"CRRED", &colrngs[CR_RED ]}, {"CRBLUE", &colrngs[CR_BLUE ]}, {"CRORANGE", &colrngs[CR_ORANGE]}, {"CRYELLOW", &colrngs[CR_YELLOW]}, {"CRBLUE2", &colrngs[CR_BLUE2]}, {NULL} }; // killough 5/2/98: tiny engine driven by table above void V_InitColorTranslation(void) { register const crdef_t *p; for (p=crdefs; p->name; p++) *p->map = W_CacheLumpName(p->name); }


however, I can not find where it tells what color index to load for CR_RED etc,

the red table in doom's pallete starts from 176 to 191, but I cannot find where the code defines this.

Also in Boom, the sttnum lumps for the stats bar can be changed colors, with red as the base color to translate to other colors, but I can't figure out where its defined in the code. Same for the player's default green color (changable to other colors)

I appriciate anyone's help.

EDIT: I apologize, I meant to post this in the edit forum...

Old Post 02-08-04 20:11 #
Kaiser is offline Profile || Blog || PM || Email || Homepage || Search || Add Buddy IP || Edit || Quote
Graf Zahl
Why don't I have a custom title by now?!


Posts: 7776
Registered: 01-03



Deathman said:
I've been looking though the prboom/boom source code and I can not find where the translation color is set.

I've inspected this code from v_video.c


code:
/* * V_InitColorTranslation * * Loads the color translation tables from predefined lumps at game start * No return * * Used for translating text colors from the red palette range * to other colors. The first nine entries can be used to dynamically * switch the output of text color thru the HUlib_drawText routine * by embedding ESCn in the text to obtain color n. Symbols for n are * provided in v_video.h. * * cphipps - constness of crdef_t stuff fixed */ typedef struct { const char *name; const byte **map; } crdef_t; // killough 5/2/98: table-driven approach static const crdef_t crdefs[] = { {"CRBRICK", &colrngs[CR_BRICK ]}, {"CRTAN", &colrngs[CR_TAN ]}, {"CRGRAY", &colrngs[CR_GRAY ]}, {"CRGREEN", &colrngs[CR_GREEN ]}, {"CRBROWN", &colrngs[CR_BROWN ]}, {"CRGOLD", &colrngs[CR_GOLD ]}, {"CRRED", &colrngs[CR_RED ]}, {"CRBLUE", &colrngs[CR_BLUE ]}, {"CRORANGE", &colrngs[CR_ORANGE]}, {"CRYELLOW", &colrngs[CR_YELLOW]}, {"CRBLUE2", &colrngs[CR_BLUE2]}, {NULL} }; // killough 5/2/98: tiny engine driven by table above void V_InitColorTranslation(void) { register const crdef_t *p; for (p=crdefs; p->name; p++) *p->map = W_CacheLumpName(p->name); }


however, I can not find where it tells what color index to load for CR_RED etc,

the red table in doom's pallete starts from 176 to 191, but I cannot find where the code defines this.

Also in Boom, the sttnum lumps for the stats bar can be changed colors, with red as the base color to translate to other colors, but I can't figure out where its defined in the code. Same for the player's default green color (changable to other colors)

I appriciate anyone's help.

EDIT: I apologize, I meant to post this in the edit forum...




The CR_* lumps are for changing the font in the menu and the HUD. They are 256 bytes long and represent a complete palette remapping. That's how the STTNUM stuff is recolorized.
The function doing the remapping is V_DrawNumPatch and can be found in inl/v_video.inl (that's PrBoom v 2.3.0)

Old Post 02-08-04 20:45 #
Graf Zahl is online now Profile || Blog || PM || Email || Search || Add Buddy IP || Edit || Quote
Kaiser
Doom64 Guru


Posts: 2859
Registered: 08-00



Graf Zahl said:



The CR_* lumps are for changing the font in the menu and the HUD. They are 256 bytes long and represent a complete palette remapping. That's how the STTNUM stuff is recolorized.
The function doing the remapping is V_DrawNumPatch and can be found in inl/v_video.inl (that's PrBoom v 2.3.0)



yes, and the engine reconizes the red table as the color to translate.

Palette index 176-191 is all red and thats the color thats translated, but I want to see where the code tells prboom to use the red table as the color to translate. I want to modify this because the STTNUM/STCFN lumps from Strife uses different colors (gold color) and since they do not contain any red, they are not effected by any translation.

Last edited by Kaiser on 02-08-04 at 21:46

Old Post 02-08-04 20:54 #
Kaiser is offline Profile || Blog || PM || Email || Homepage || Search || Add Buddy IP || Edit || Quote
Graf Zahl
Why don't I have a custom title by now?!


Posts: 7776
Registered: 01-03



Deathman said:


yes, and the engine reconizes the red table as the color to translate.

Palette index 176-191 is all red and thats the color thats translated, but I want to see where the code tells prboom to use the red table as the color to translate. I want to modify this because the STTNUM/STCFN lumps from Strife uses different colors (gold color) and since they do not contain any red, they are not effected by any translation.




The code doesn't tell anywhere that only the red range has to be translated. The CR_* files contain a complete palette translation but only the indices 176-191 don't map to themselves. If you want to translate the Strife fonts you have to replace these tables with your own ones that translate the colors you need.

Old Post 02-08-04 23:40 #
Graf Zahl is online now Profile || Blog || PM || Email || Search || Add Buddy IP || Edit || Quote
Kaiser
Doom64 Guru


Posts: 2859
Registered: 08-00


OH, the CR_ files are a lump on its own (looks at prboom.wad)


now I really feel like a newbie...

Old Post 02-09-04 00:17 #
Kaiser is offline Profile || Blog || PM || Email || Homepage || Search || Add Buddy IP || Edit || Quote
All times are GMT. The time now is 01:40. Post New Thread    Post A Reply
 
Doomworld Forums : Powered by vBulletin version 2.2.5 Doomworld Forums > Classic Doom > WADs & Mods > Modifying translation table code in Doom

Show Printable Version | Email this Page | Subscribe to this Thread

 

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are OFF
[IMG] code is ON
 

< Contact Us - Doomworld >

Powered by: vBulletin Version 2.2.5
Copyright ©2000, 2001, Jelsoft Enterprises Limited.