
Replacing All
Game Textures with TGAs
|
Copyright
info |
|
All
code in this tutorial is protected by the [GPL License]. |
|
Tutorial
by: Convulsion-X |
||||||||||||||||||||||
|
Mailto: nuggets_99@yahoo.com Hi there, I’m
Convulsion-X and this is the first tutorial I’ve ever written so please don’t
scream at me if you don’t understand it. You can instead e-mail me at nuggets_99@yahoo.com and I will try to
fix it. Anyway, I plan on teaching you how to get the Quake II engine to load
32-bit targas instead of those crappy 8-bit PCX files. It’s only a few lines
of code and really makes a difference in the way the game looks. First we will
get the engine to load TGA’s instead of Wals. (Note: This is really just MR.
G’s tutorial. I included it in here just to make things complete rather than
having additional HTML files or whatever) Open up the
QII src and go into the ref_gl part. Open up GL_Model.c and go down to
Mod_LoadTexInfo. This contains all of the information for loading textures
onto a BSP surface. Find this line:
Now change it
to this:
This will
check to see if there is a targa in the textures folder for the .wal assigned
to it. If not then it just loads the wal. Now onto
models. This is from a tutorial by Korax. Again, just figured it’d be easier
for you if all the information was in one spot. Anyway you
should still have gl_model.c open. Go down to R_RegisterModel. Underneath
Add:
Then find:
And change it
to:
Once again,
this will search for the targa by the name of the PCX assigned to it by the
model. If it doesn’t find it, it will load the PCX. Now to load
TGAs instead of menu items and statusbar crap Go to
gl_draw.c and find the function: image_t *Draw_FindPic (char name) Find the line
that reads:
And change it
to:
Now anytime
the Draw_FindPic function is called it will check for a TGA before loading
the PCX. Now, getting
the sprites to load TGAs instead of PCXs. Open
gl_model.c again and go back to R_RegisterModel, under where you wrote char
md2skin[MAX_PATH] before write:
change:
to:
And that
should be about it. I was going to add how to change the particle system to a
targa too, but it sort of slows down the engine and it’s a lot more code.
Maybe if I get enough e-mails asking how to do it or something I will. For
those that want to try on their own you have to get the engine to draw a
square instead of a triangle and change the texture coordinates so that it
covers the whole thing square instead of a little section of it. Then in
GL_Part.c at the gl_findimage part replace the call for the dot drawn above
with the texture of your choice. |
Tutorial Originally found at: