=================================================================== RCS file: /home/cvs/OpenXM/src/oxmgraph/graph.c,v retrieving revision 1.1 retrieving revision 1.3 diff -u -p -r1.1 -r1.3 --- OpenXM/src/oxmgraph/graph.c 2009/02/08 04:56:59 1.1 +++ OpenXM/src/oxmgraph/graph.c 2009/03/06 05:34:26 1.3 @@ -152,19 +152,26 @@ GLboolean lightSwitch = GL_FALSE; GLboolean textureSwitch = GL_FALSE; GLboolean blendSwitch = GL_FALSE; -/* for bitfont */ -int str_position = 500; - void makeTexture(void) { FILE *fp; - int x, z; + int x, z; + char *oxhome; + char fname[1024]; /* texture file open (file name is "inobuta.tga")*/ - if((fp=fopen("inobuta.tga", "rb"))==NULL){ - fprintf(stderr, "texture file cannot be open\n"); - return; + oxhome = getenv("OpenXM_HOME"); + if (oxhome != NULL) { + sprintf(fname,"%s/share/oxmgraph/inobuta.tga",oxhome); + }else{ + sprintf(fname,"/usr/local/share/oxmgraph/inobuta.tgz"); } + if((fp=fopen(fname, "rb"))==NULL){ + if ((fp = fopen("inobuta.tgz","rb")) == NULL) { + fprintf(stderr, "texture file cannot be open\n"); + return; + } + } fseek(fp, 18, SEEK_SET); for (x=0; x