=================================================================== RCS file: /home/cvs/OpenXM/src/oxmgraph/graph.c,v retrieving revision 1.1 retrieving revision 1.5 diff -u -p -r1.1 -r1.5 --- OpenXM/src/oxmgraph/graph.c 2009/02/08 04:56:59 1.1 +++ OpenXM/src/oxmgraph/graph.c 2009/03/18 02:35:00 1.5 @@ -5,11 +5,12 @@ License: This software is distributed under the 2-clua (http://en.wikipedia.org/wiki/BSD_licenses) */ -#ifdef MAC_OS_X +#if defined (_MSC_VER) +#include +#endif +#if defined(__APPLE__) #include #else -#include -#include #include #endif @@ -152,19 +153,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