mirror of
https://git.code.sf.net/p/quake/newtree
synced 2025-06-02 01:51:37 +00:00
fullbrights on player skins now work properly instead of using the fb skin
of the player model.
This commit is contained in:
parent
92f357a2ad
commit
1444bac78d
7 changed files with 111 additions and 75 deletions
|
@ -40,41 +40,39 @@
|
|||
#include "r_local.h"
|
||||
#include "sys.h"
|
||||
|
||||
int
|
||||
Mod_CalcFullbright (byte *in, byte *out, int pixels)
|
||||
{
|
||||
int fb = 0;
|
||||
|
||||
while (pixels--) {
|
||||
if (*in >= 256 - 32) {
|
||||
fb = 1;
|
||||
*out++ = *in++;
|
||||
} else {
|
||||
*out++ = 255;
|
||||
in++;
|
||||
}
|
||||
}
|
||||
return fb;
|
||||
}
|
||||
|
||||
int
|
||||
Mod_Fullbright (byte * skin, int width, int height, char *name)
|
||||
{
|
||||
int j;
|
||||
int pixels;
|
||||
qboolean hasfullbrights = false;
|
||||
int texnum;
|
||||
int texnum = 0;
|
||||
byte *ptexels;
|
||||
|
||||
// Check for fullbright pixels..
|
||||
pixels = width * height;
|
||||
|
||||
for (j = 0; j < pixels; j++) {
|
||||
if (skin[j] >= 256 - 32) {
|
||||
hasfullbrights = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (hasfullbrights) {
|
||||
byte *ptexels;
|
||||
|
||||
// ptexels = Hunk_Alloc(s);
|
||||
ptexels = malloc (pixels);
|
||||
|
||||
// ptexels = Hunk_Alloc(s);
|
||||
ptexels = malloc (pixels);
|
||||
if (Mod_CalcFullbright (skin, ptexels, pixels)) {
|
||||
Con_DPrintf ("FB Model ID: '%s'\n", name);
|
||||
for (j = 0; j < pixels; j++) {
|
||||
if (skin[j] >= 256 - 32) {
|
||||
ptexels[j] = skin[j];
|
||||
} else {
|
||||
ptexels[j] = 255;
|
||||
}
|
||||
}
|
||||
texnum = GL_LoadTexture (name, width, height, ptexels, true, true, 1);
|
||||
free (ptexels);
|
||||
return texnum;
|
||||
}
|
||||
return 0;
|
||||
free (ptexels);
|
||||
return texnum;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue