mirror of
https://github.com/ENSL/NS.git
synced 2024-12-01 00:32:05 +00:00
43 lines
1.2 KiB
C++
43 lines
1.2 KiB
C++
|
#include "AvHConstants.h"
|
||
|
#include <cstring>
|
||
|
|
||
|
const int slashchr = '\\';
|
||
|
#define kAvHModDir ((const char*)("ns"))
|
||
|
|
||
|
const char* getModDirectory(void)
|
||
|
{
|
||
|
//#ifdef __linux__
|
||
|
// return kAvHModDir;
|
||
|
//#else
|
||
|
// static char theModDirectory[512];
|
||
|
// static bool theIsComputed = false;
|
||
|
// #define thisFileString __FILE__
|
||
|
|
||
|
// if(!theIsComputed)
|
||
|
// {
|
||
|
// const char* thisFileName = thisFileString;
|
||
|
// strcpy(theModDirectory,thisFileName);
|
||
|
// //theModDirectory = <blah>/[mod_directory]/source/mod/AvHConstants.cpp
|
||
|
// char* pos = strrchr(theModDirectory,slashchr);
|
||
|
// for(int counter = 0; counter < 3; ++counter) //remove three slahses and everything that comes after
|
||
|
// {
|
||
|
// *pos = '\0';
|
||
|
// pos = strrchr(theModDirectory,slashchr); //point to next slash
|
||
|
// }
|
||
|
//theModDirectory = <blah>/[mod_directory]
|
||
|
//pos+1 = [mod_directory]
|
||
|
// char temp[512];
|
||
|
// strcpy(temp,pos+1); //use temp so we don't overwrite ourselves on copy.
|
||
|
// strcpy(theModDirectory,temp); //theModDirectory now holds the correct directory name
|
||
|
// theIsComputed = true; //don't compute this again
|
||
|
// }
|
||
|
// return theModDirectory;
|
||
|
//#endif
|
||
|
return "ns";
|
||
|
}
|
||
|
|
||
|
const char* getModName(void)
|
||
|
{
|
||
|
return kAvHGameName;
|
||
|
}
|