Starglider 4
2010-02-07 00:51:23 UTC
I have the following code:
void GLTexture::Load(char *name)
{
// make the texture name all lower case
texturename = _strlwr(_strdup(name));
// strip "'s
if (strstr(texturename, "\""))
texturename = strtok(texturename, "\"");
//> At ths location I want to add "3ds models/" to the filename..
//And I want to have "'s around the complete filename..
// check the file extension to see what type of texture
if(strstr(texturename, ".bmp"))
LoadBMP(texturename);
}
If the char* name would be tex1.bmp, I would want a reslut like "3ds
models/tex1.bmp",
including the "".
I tried several things, like strcat_s() etc. But I coudn't figure it out/
Please help me out.
Thanks,
MK
void GLTexture::Load(char *name)
{
// make the texture name all lower case
texturename = _strlwr(_strdup(name));
// strip "'s
if (strstr(texturename, "\""))
texturename = strtok(texturename, "\"");
//> At ths location I want to add "3ds models/" to the filename..
//And I want to have "'s around the complete filename..
// check the file extension to see what type of texture
if(strstr(texturename, ".bmp"))
LoadBMP(texturename);
}
If the char* name would be tex1.bmp, I would want a reslut like "3ds
models/tex1.bmp",
including the "".
I tried several things, like strcat_s() etc. But I coudn't figure it out/
Please help me out.
Thanks,
MK