View Single Post
Re: BSP and RBN utilities
Old
  (#10)
Whistler
Summoner
 
Whistler's Avatar
 
Status: Offline
Posts: 1,499
Join Date: Feb 2004
Location: Mist Village
Default Re: BSP and RBN utilities - 21-07-2004

a small change to the bsp2rbn to make it put the generated files to current directory, which is supposed to (and not data\cstrike\exp folder):

// Need to implement the basename & dirname functions under Windows...
#ifndef __linux__
char * basename(char * s)
{
char * fs ;

if ((s == NULL) || (*s == 0)) return "." ;
if (strcmp(s,"\\") == 0) return s ;
fs = strrchr(s,'\\') ;
if (fs == NULL) fs = strrchr(s,'/') ;
if (fs == NULL) return s ;
return fs + 1 ;
}

char * dirname(char * s)
{
char * fs ;

if ((s == NULL) || (*s == 0)) return "." ;
if (strcmp(s,"\\") == 0) return s ;
fs = strrchr(s,'\\') ;
if (fs == NULL) fs = strrchr(s,'/') ;
if (fs == NULL) return "." ;
* fs = 0 ;
return s ;
}
#endif

Note: the nodemachine.cpp uses "/" as separater when it calls UTIL_BuildFileNameRB().
  
Reply With Quote