Merge branch 'master' into umw_dev
This commit is contained in:
@@ -41,6 +41,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
#include <utility>
|
||||
#include "MMDPmxParser.h"
|
||||
#include <assimp/StringUtils.h>
|
||||
#include "../contrib/utf8cpp/source/utf8.h"
|
||||
#include <assimp/Exceptional.h>
|
||||
|
||||
@@ -116,7 +117,7 @@ namespace pmx
|
||||
stream->read((char*) &count, sizeof(uint8_t));
|
||||
if (count < 8)
|
||||
{
|
||||
throw;
|
||||
throw DeadlyImportError("MMD: invalid size");
|
||||
}
|
||||
stream->read((char*) &encoding, sizeof(uint8_t));
|
||||
stream->read((char*) &uv, sizeof(uint8_t));
|
||||
@@ -393,7 +394,7 @@ namespace pmx
|
||||
}
|
||||
break;
|
||||
default:
|
||||
throw;
|
||||
throw DeadlyImportError("MMD: unknown morth type");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -473,8 +474,8 @@ namespace pmx
|
||||
void PmxSoftBody::Read(std::istream * /*stream*/, PmxSetting * /*setting*/)
|
||||
{
|
||||
std::cerr << "Not Implemented Exception" << std::endl;
|
||||
throw;
|
||||
}
|
||||
throw DeadlyImportError("MMD: Not Implemented Exception");
|
||||
}
|
||||
|
||||
void PmxModel::Init()
|
||||
{
|
||||
@@ -512,14 +513,14 @@ namespace pmx
|
||||
if (magic[0] != 0x50 || magic[1] != 0x4d || magic[2] != 0x58 || magic[3] != 0x20)
|
||||
{
|
||||
std::cerr << "invalid magic number." << std::endl;
|
||||
throw;
|
||||
}
|
||||
throw DeadlyImportError("MMD: invalid magic number.");
|
||||
}
|
||||
stream->read((char*) &version, sizeof(float));
|
||||
if (version != 2.0f && version != 2.1f)
|
||||
{
|
||||
std::cerr << "this is not ver2.0 or ver2.1 but " << version << "." << std::endl;
|
||||
throw;
|
||||
}
|
||||
throw DeadlyImportError("MMD: this is not ver2.0 or ver2.1 but " + to_string(version));
|
||||
}
|
||||
this->setting.Read(stream);
|
||||
|
||||
this->model_name = ReadString(stream, setting.encoding);
|
||||
@@ -598,34 +599,5 @@ namespace pmx
|
||||
{
|
||||
this->joints[i].Read(stream, &setting);
|
||||
}
|
||||
|
||||
//if (this->version == 2.1f)
|
||||
//{
|
||||
// stream->read((char*) &this->soft_body_count, sizeof(int));
|
||||
// this->soft_bodies = mmd::make_unique<PmxSoftBody []>(this->soft_body_count);
|
||||
// for (int i = 0; i < this->soft_body_count; i++)
|
||||
// {
|
||||
// this->soft_bodies[i].Read(stream, &setting);
|
||||
// }
|
||||
//}
|
||||
}
|
||||
|
||||
//std::unique_ptr<PmxModel> ReadFromFile(const char *filename)
|
||||
//{
|
||||
// auto stream = std::ifstream(filename, std::ios_base::binary);
|
||||
// auto pmx = PmxModel::ReadFromStream(&stream);
|
||||
// if (!stream.eof())
|
||||
// {
|
||||
// std::cerr << "don't reach the end of file." << std::endl;
|
||||
// }
|
||||
// stream.close();
|
||||
// return pmx;
|
||||
//}
|
||||
|
||||
//std::unique_ptr<PmxModel> ReadFromStream(std::istream *stream)
|
||||
//{
|
||||
// auto pmx = mmd::make_unique<PmxModel>();
|
||||
// pmx->Read(stream);
|
||||
// return pmx;
|
||||
//}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user