=================================================================== RCS file: /home/cvs/OpenXM/src/oxmgraph/graph.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -p -r1.1 -r1.2 --- OpenXM/src/oxmgraph/graph.c 2009/02/08 04:56:59 1.1 +++ OpenXM/src/oxmgraph/graph.c 2009/02/22 02:14:44 1.2 @@ -158,12 +158,22 @@ 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