fix shader editor text length and offset in linux
This commit is contained in:
parent
b9d846ac32
commit
bad1a965c0
|
|
@ -91,12 +91,14 @@ void ViewShader( const char *pFile, const char *pName, bool external_editor ){
|
||||||
else{
|
else{
|
||||||
//globalErrorStream() << "Validated successfully" << "\n";
|
//globalErrorStream() << "Validated successfully" << "\n";
|
||||||
nOffset = nStart;
|
nOffset = nStart;
|
||||||
|
#ifdef WIN32
|
||||||
//fix cr+lf
|
//fix cr+lf
|
||||||
for ( const char* i = strLook.c_str(); i < substr ; i++ ){
|
for ( const char* i = strLook.c_str(); i < substr ; i++ ){
|
||||||
if ( (strncmp( i, "\r\n", 2 ) == 0) ){
|
if ( (strncmp( i, "\r\n", 2 ) == 0) ){
|
||||||
nOffset--;
|
nOffset--;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
/*// we have found something, maybe it's a commented out shader name?
|
/*// we have found something, maybe it's a commented out shader name?
|
||||||
char *strCheck = new char[string_length( strLook.c_str() ) + 1];
|
char *strCheck = new char[string_length( strLook.c_str() ) + 1];
|
||||||
|
|
@ -113,6 +115,7 @@ void ViewShader( const char *pFile, const char *pName, bool external_editor ){
|
||||||
nOffset = nStart;
|
nOffset = nStart;
|
||||||
break;*/
|
break;*/
|
||||||
}
|
}
|
||||||
|
#ifdef WIN32
|
||||||
//fix up length
|
//fix up length
|
||||||
const char* b = strLook.c_str() + strlen( strLook.c_str() ) - 1;
|
const char* b = strLook.c_str() + strlen( strLook.c_str() ) - 1;
|
||||||
for ( const char* i = strLook.c_str(); i < b; i++ ){
|
for ( const char* i = strLook.c_str(); i < b; i++ ){
|
||||||
|
|
@ -120,6 +123,7 @@ void ViewShader( const char *pFile, const char *pName, bool external_editor ){
|
||||||
length--;
|
length--;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
// now close the file
|
// now close the file
|
||||||
vfsFreeFile( pBuff );
|
vfsFreeFile( pBuff );
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user