*** empty log message ***

git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@1277 e016b1c5-ed68-44aa-a2f7-31cac88cffde
This commit is contained in:
Lee Salzman
2007-08-30 05:31:24 +00:00
parent 5114b659c8
commit b57d3cf723
9 changed files with 22 additions and 18 deletions
+1
View File
@@ -328,6 +328,7 @@ void writecfg()
if(!f) return;
fprintf(f, "// automatically written on exit, DO NOT MODIFY\n// delete this file to have defaults.cfg overwrite these settings\n// modify settings in game, or put settings in autoexec.cfg to override anything\n\n");
fprintf(f, "name %s\nteam %s\nskin %d\n", player1->name, player1->team, player1->nextskin);
extern Texture *crosshair;
fprintf(f, "loadcrosshair %s\n", crosshair->name+strlen("packages/misc/crosshairs/"));
extern int lowfps, highfps;
fprintf(f, "fpsrange %d %d\n", lowfps, highfps);
+2 -10
View File
@@ -325,8 +325,8 @@ int main(int argc, char **argv)
initlog("gl");
gl_init(scr_w, scr_h, colorbits, depthbits, fsaa);
crosshair = textureload("packages/misc/crosshairs/default.png");
if(!crosshair) fatal("could not find core textures (hint: run AssaultCube from the parent of the bin directory)");
notexture = textureload("packages/misc/notexture.png");
if(!notexture) fatal("could not find core textures (hint: run AssaultCube from the parent of the bin directory)");
initlog("console");
if(!execfile("config/font.cfg")) fatal("cannot find font definitions");
@@ -489,13 +489,5 @@ int main(int argc, char **argv)
return EXIT_SUCCESS;
}
void loadcrosshair(char *c)
{
s_sprintfd(p)("packages/misc/crosshairs/%s", c);
crosshair = textureload(p);
}
COMMAND(loadcrosshair, ARG_1STR);
VAR(version, 1, AC_VERSION, 0);
+1 -1
View File
@@ -226,7 +226,7 @@ struct md2 : vertmodel
Texture *skin;
loadskin(loadname, pname, skin);
loopv(mdl.meshes) mdl.meshes[i]->skin = skin;
if(skin==crosshair) conoutf("could not load model skin for %s", name1);
if(skin==notexture) conoutf("could not load model skin for %s", name1);
loadingmd2 = this;
s_sprintfd(name2)("packages/models/%s/md2.cfg", loadname);
if(!execfile(name2))
+1 -1
View File
@@ -215,7 +215,7 @@ struct md3 : vertmodel
Texture *skin;
loadskin(loadname, pname, skin);
loopv(mdl.meshes) mdl.meshes[i]->skin = skin;
if(skin==crosshair) conoutf("could not load model skin for %s", name1);
if(skin==notexture) conoutf("could not load model skin for %s", name1);
}
loopv(parts) parts[i]->scaleverts(scale/16.0f, vec(translate.x, -translate.y, translate.z));
+1 -1
View File
@@ -76,7 +76,7 @@ struct Texture
int xs, ys;
GLuint id;
};
extern Texture *crosshair;
extern Texture *notexture;
extern void createtexture(int tnum, int w, int h, void *pixels, int clamp, bool mipmap, GLenum format);
extern Texture *textureload(const char *name, int clamp = 0);
+11
View File
@@ -69,11 +69,22 @@ void drawscope()
glEnd();
}
Texture *crosshair = NULL;
void loadcrosshair(char *c)
{
s_sprintfd(p)("packages/misc/crosshairs/%s", c);
crosshair = textureload(p);
}
COMMAND(loadcrosshair, ARG_1STR);
void drawcrosshair(bool showteamwarning)
{
glBlendFunc(GL_ONE, GL_ONE);
static Texture *teammatetex = NULL;
if(!teammatetex) teammatetex = textureload("packages/misc/teammate.png");
if(!crosshair) crosshair = textureload("packages/misc/crosshairs/default.png");
glBindTexture(GL_TEXTURE_2D, showteamwarning ? teammatetex->id : crosshair->id);
glBegin(GL_QUADS);
glColor3ub(255,255,255);
+1 -1
View File
@@ -271,7 +271,7 @@ int findanim(const char *name)
void loadskin(const char *dir, const char *altdir, Texture *&skin) // model skin sharing
{
#define ifnoload if((skin = textureload(path))==crosshair)
#define ifnoload if((skin = textureload(path))==notexture)
s_sprintfd(path)("packages/models/%s/skin.jpg", dir);
ifnoload
{
+3 -3
View File
@@ -2,7 +2,7 @@
#include "cube.h"
Texture *crosshair = NULL;
Texture *notexture = NULL;
hashtable<char *, Texture> textures;
VAR(hwtexsize, 1, 0, 0);
@@ -88,7 +88,7 @@ Texture *textureload(const char *name, int clamp)
if(t) return t;
int xs, ys;
GLuint id = loadsurface(pname, xs, ys, clamp);
if(!id) return crosshair;
if(!id) return notexture;
char *key = newstring(pname);
t = &textures[key];
t->name = key;
@@ -123,7 +123,7 @@ COMMAND(texture, ARG_2STR);
Texture *lookuptexture(int tex)
{
Texture *t = crosshair;
Texture *t = notexture;
if(slots.inrange(tex))
{
Slot &s = slots[tex];
+1 -1
View File
@@ -58,7 +58,7 @@ struct vertmodel : model
GLuint statlist;
int statlen;
mesh() : name(0), verts(0), tcverts(0), tris(0), skin(crosshair), tex(0), dynbuf(0), dynidx(0), statlist(0)
mesh() : name(0), verts(0), tcverts(0), tris(0), skin(notexture), tex(0), dynbuf(0), dynidx(0), statlist(0)
{
dyncur.fr1 = dynprev.fr1 = -1;
}