Make a start on skin support.

I had this lying around for a while since it was more important to get
other things working first.
This commit is contained in:
Bill Currie 2012-01-22 15:48:32 +09:00
parent 76cb60461d
commit 61c127abc0
4 changed files with 82 additions and 36 deletions

View File

@ -15,7 +15,7 @@ shader_gen= \
glsl_src = \
glsl_alias.c glsl_bsp.c glsl_draw.c glsl_lightmap.c glsl_main.c \
glsl_particles.c glsl_screen.c glsl_sprite.c glsl_textures.c
glsl_particles.c glsl_screen.c glsl_skin.c glsl_sprite.c glsl_textures.c
if BUILD_GLSL
noinst_LTLIBRARIES= libglsl.la

View File

@ -42,6 +42,7 @@ static __attribute__ ((used)) const char rcsid[] = "$Id$";
#include <stdlib.h>
#include "QF/render.h"
#include "QF/skin.h"
#include "QF/GLSL/defines.h"
#include "QF/GLSL/funcs.h"
@ -201,7 +202,7 @@ R_DrawAlias (void)
aliashdr_t *hdr;
vec_t norm_mat[9];
mat4_t mvp_mat;
maliasskindesc_t *skin;
int skin_tex;
aliasvrt_t *pose1 = 0; // VBO's are null based
aliasvrt_t *pose2 = 0; // VBO's are null based
@ -225,7 +226,14 @@ R_DrawAlias (void)
Mat4Mult (ent->transform, mvp_mat, mvp_mat);
Mat4Mult (alias_vp, mvp_mat, mvp_mat);
skin = R_AliasGetSkindesc (ent->skinnum, hdr);
if (ent->skin) {
skin_t *skin = ent->skin;
skin_tex = skin->texture;
} else {
maliasskindesc_t *skindesc;
skindesc = R_AliasGetSkindesc (ent->skinnum, hdr);
skin_tex = skindesc->texnum;
}
blend = R_AliasGetLerpedFrames (ent, hdr);
pose1 += ent->pose1 * hdr->poseverts;
@ -234,7 +242,7 @@ R_DrawAlias (void)
skin_size[0] = hdr->mdl.skinwidth;
skin_size[1] = hdr->mdl.skinheight;
qfglBindTexture (GL_TEXTURE_2D, skin->texnum);
qfglBindTexture (GL_TEXTURE_2D, skin_tex);
#ifndef TETRAHEDRON
qfglBindBuffer (GL_ARRAY_BUFFER, hdr->posedata);

View File

@ -44,7 +44,6 @@ static __attribute__ ((used)) const char rcsid[] = "$Id$";
#include "QF/image.h"
#include "QF/render.h"
#include "QF/screen.h"
#include "QF/skin.h"
#include "QF/sys.h"
#include "QF/GLSL/defines.h"
@ -259,37 +258,6 @@ Fog_ParseWorldspawn (struct plitem_s *worldspawn)
{
}
VISIBLE void
Skin_Player_Model (model_t *model)
{
}
VISIBLE void
Skin_Set_Translate (int top, int bottom, void *_dest)
{
}
VISIBLE void
Skin_Do_Translation (skin_t *player_skin, int slot, skin_t *skin)
{
}
VISIBLE void
Skin_Do_Translation_Model (struct model_s *model, int skinnum, int slot,
skin_t *skin)
{
}
VISIBLE void
Skin_Process (skin_t *skin, struct tex_s * tex)
{
}
VISIBLE void
Skin_Init_Translation (void)
{
}
VISIBLE void
R_LineGraph (int x, int y, int *h_vals, int count)
{

View File

@ -0,0 +1,70 @@
/*
glsl_skin.c
GLSL rendering
Copyright (C) 2012 Bill Currie <bill@taniwha.org>
Author: Bill Currie <bill@taniwha.org>
Date: 2012/1/13
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to:
Free Software Foundation, Inc.
59 Temple Place - Suite 330
Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
static __attribute__ ((used)) const char rcsid[] = "$Id$";
#include "QF/image.h"
#include "QF/model.h"
#include "QF/skin.h"
VISIBLE void
Skin_Player_Model (model_t *model)
{
}
VISIBLE void
Skin_Set_Translate (int top, int bottom, void *_dest)
{
}
VISIBLE void
Skin_Do_Translation (skin_t *player_skin, int slot, skin_t *skin)
{
}
VISIBLE void
Skin_Do_Translation_Model (model_t *model, int skinnum, int slot,
skin_t *skin)
{
}
VISIBLE void
Skin_Process (skin_t *skin, tex_t *tex)
{
}
VISIBLE void
Skin_Init_Translation (void)
{
}