Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/branches/mount_points/src/lib/graphics/importer/oif/resource_oif.cc @ 10053

Last change on this file since 10053 was 10052, checked in by patrick, 18 years ago

integrating loading to we

File size: 1.4 KB
Line 
1
2#include "resource_oif.h"
3
4#include "substring.h"
5#include "multi_type.h"
6#include "debug.h"
7
8
9ResourceOIF::ResourceOIF(const std::string& fileName, const Resources::KeepLevel& keepLevel)
10    : Resource(&ResourceOIF::type)
11{
12  Resources::StorePointer* ptr = this->acquireResource(fileName);
13
14  if (ptr)
15  {
16    PRINTF(0)("FOUND OIF: %s\n", fileName.c_str());
17    //this->acquireData(static_cast<ResourceOIF::OIFResourcePointer*>(ptr)->ptr());
18  }
19  else
20  {
21    PRINTF(0)("NOT FOUND OIF: %s\n", fileName.c_str());
22//     std::string modelFileName = this->Resource::locateFile(modelName);
23//     //std::string skinFileName = this->Resource::locateFile(skinName);
24//     this->MD2Model::load(modelFileName, skinName, scale);
25//     this->Resource::addResource(new ResourceOIF::OIFResourcePointer(loadString(modelName, skinName, scale), keepLevel, this->MD2Model::dataPointer()));
26  }
27
28}
29
30ResourceOIF ResourceOIF::createFromString(const std::string& loadString, const Resources::KeepLevel& keepLevel)
31{
32  SubString loadValues(loadString, ',');
33  std::string fileName;
34  if (loadValues.size() > 0)
35    fileName = loadValues[0];
36
37  return ResourceOIF(fileName);
38}
39
40
41
42Resources::tType<ResourceOIF> ResourceOIF::type("OIF");
43
44
45
46
47
48ResourceOIF::OIFResourcePointer::OIFResourcePointer(const std::string& loadString, const Resources::KeepLevel& keepLevel, const OIFData::Pointer& data)
49    : Resources::StorePointer(loadString, keepLevel) , pointer(data)
50{}
51
52
Note: See TracBrowser for help on using the repository browser.