123456789101112131415161718192021222324252627282930313233343536373839404142434445 |
- #include <Textur.h>
- #include "ModelInfo.h"
- #include "Globals.h"
- using namespace Framework;
- ModelInfo::ModelInfo(Framework::StreamReader* reader)
- {
- char len;
- reader->lese(&len, 1);
- char* path = new char[len + 1];
- reader->lese(path, len);
- path[len] = 0;
- modelPath = path;
- delete[] path;
- short count;
- reader->lese((char*)&count, 2);
- for (int i = 0; i < count; i++)
- {
- reader->lese(&len, 1);
- path = new char[len + 1];
- reader->lese(path, len);
- path[len] = 0;
- texturPaths.add(new Text(path));
- delete[] path;
- }
- }
- Framework::Model3DData* ModelInfo::getModel() const
- {
- return uiFactory.initParam.bildschirm->zGraphicsApi()->getModel(modelPath);
- }
- Framework::Model3DTextur* ModelInfo::getTexture() const
- {
- Model3DTextur* textur = new Model3DTextur();
- int index = 0;
- for (Text* texturPath : texturPaths)
- {
- Textur* tex = uiFactory.initParam.bildschirm->zGraphicsApi()->createOrGetTextur(texturPath->getText(), 0);
- textur->setPolygonTextur(index++, tex);
- }
- return textur;
- }
|