This commit is contained in:
Henrik Rydgard committed 2012-03-31 22:07:33 +02:00
1 parent af2245c612
commit a893d5cdc2
3 files changed
+18 -1

No files matched your search

+13
View File
@@ -124,3 +124,16 @@ void deleteFile(const char *file)
#endif
}
#endif
std::string getDir(const std::string &path)
{
int n = path.size() - 1;
while (n >= 0 && path[n] != '\\' && path[n] != '/')
n--;
std::string cutpath = path.substr(0, n);
for (int i = 0; i < cutpath.size(); i++)
{
if (cutpath[i] == '\\') cutpath[i] = '/';
}
return cutpath;
}
+2
View File
@@ -10,3 +10,5 @@ bool readFileToString(bool text_file, const char *filename, std::string &str);
// Beginnings of a directory utility system. TODO: Improve.
size_t getFilesInDir(const char *directory, std::vector<std::string> *files);
void deleteFile(const char *file);
std::string getDir(const std::string &path);
+3 -1
View File
@@ -37,7 +37,9 @@ bool CompileShader(const char *source, GLuint shader, const char *filename) {
ELOG("Error in shader compilation of %s!\n", filename);
ELOG("Info log: %s\n", infoLog);
ELOG("Shader source:\n%s\n", (const char *)source);
exit(1);
#ifdef ANDROID
exit(1);
#endif
return false;
}
return true;