comparison dmutil.cpp @ 21:1404dfcee7b8

More work on scenefile and model loading support. Can now load PLY models and simple scene definition files. Converted dragon mesh to binary PLY format.
author Matti Hamalainen <ccr@tnsp.org>
date Fri, 22 Nov 2019 03:03:52 +0200
parents a329f0216491
children 03b86b9c2f29
comparison
equal deleted inserted replaced
20:294c4c7943b5 21:1404dfcee7b8
71 return result; 71 return result;
72 } 72 }
73 } 73 }
74 74
75 75
76 std::string dmGetPath(const std::string &path)
77 {
78 size_t dirsep = path.find_last_of("/\\");
79 return (dirsep != std::string::npos) ? path.substr(0, dirsep + 1) : "";
80 }
81
82
76 bool dmReadText(const std::string &filename, std::string &buf, const int maxSize) 83 bool dmReadText(const std::string &filename, std::string &buf, const int maxSize)
77 { 84 {
78 std::ifstream in(filename.c_str(), std::fstream::in); 85 std::ifstream in(filename.c_str(), std::fstream::in);
79 86
80 if (!in.is_open()) 87 if (!in.is_open())