Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Sep 25, 2006, 11:28:28 PM (18 years ago)
Author:
bensch
Message:

orxonox/new_class_id: now it should also be possible, to cache the resources, by suppling a LoadString.
This is vital to loading Resources, when you only know the TypeName and a LoadString, but not the c++-type and the LoadParameters as is the case when loading over the internet.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/new_class_id/src/lib/graphics/importer/resource_texture.cc

    r9793 r9823  
    11
    22#include "resource_texture.h"
     3#include "substring.h"
     4#include "multi_type.h"
    35#include "debug.h"
    46
     
    2325}
    2426
     27ResourceTexture ResourceTexture::createFromString(const std::string& loadString)
     28{
     29  SubString loadValues(loadString, ',');
     30  std::string imageName;
     31  GLenum target = GL_TEXTURE_2D;
     32  if (loadValues.size() > 0)
     33    imageName = loadValues[0];
     34  if (loadValues.size() > 1)
     35    target = (GLenum)MultiType(loadValues[2]).getInt();
    2536
    26 Resources::Type ResourceTexture::type("Texture");
     37  return ResourceTexture(imageName, target);
     38}
     39
     40
     41
     42Resources::tType<ResourceTexture> ResourceTexture::type("Texture");
    2743
    2844
Note: See TracChangeset for help on using the changeset viewer.