[quake2] Retexturing Quake 2: New textures for new clients

Karen Pouelle hockeyvixen at yahoo.ca
Fri Jul 11 20:34:38 EDT 2003

I've a good start into retexturing with about 5 consistant people making
submissions.  The new textures are popping up in the Id Software maps and
everywhere else they are used, including the commercial mission paks and
custom maps that use Id Software's original baseq2 textures.

Textures are submitted via cvs, forum post, or emailed to me, then placed
into a cvs where they can be obtained by a public cvs account, via web, and
also by downloading pak files.

I am not a programer, so I've not looked at the icculus.org sources to
determine if someone had submitted the autoscaling code.  Having the walls
retextured but unscaled looks quite interesting - as if you've fallen down a
rabbit hole and everything around you is four times larger than normal.

Because I'm not sure how to check out the code and do a diff and send it,
I'll just post this - but be aware that you'll want to verify it.  Look it
over before blindly compiling it in - I'm a nurse, not a programer.  Better
yet, just wait out the weekend and let Brendan make sure this is suitable

Open gl_image.c and look for GL_LoadPic function.

Add these to beging of the function:
	miptex_t *mt;
	int len;
	char s[128];

Then after:
	image->width = width;
	image->height = height;
	image->type = type;

Add this litle code there:

	len = strlen(name);

	if (!strcmp(s+len-4, ".tga") || !strcmp(s+len-4, ".jpg") || !strcmp(s+len-4,
		s[len-3] = 'w';	s[len-2] = 'a';	s[len-1] = 'l';
		ri.FS_LoadFile (s, (void **)&mt);	//load .wal file

		if (mt) {
			image->width = LittleLong (mt->width);
			image->height = LittleLong (mt->height);
			ri.FS_FreeFile ((void *)mt);

Thats it!
This code checks every .tga, .jpg and .png. If one of these formats exist and
is replacing a .wal, then this code scales the texture to the original .wal's
size, effectively increasing the resolution of the texture on the surface it
was mapped to originally.



Post your free ad now! http://personals.yahoo.ca

More information about the quake2 mailing list