Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 9837 in orxonox.OLD for branches/new_class_id


Ignore:
Timestamp:
Sep 26, 2006, 5:22:12 PM (18 years ago)
Author:
bensch
Message:

added new files, but with the wrong name

Location:
branches/new_class_id/src/lib/graphics/text_engine
Files:
1 edited
2 copied

Legend:

Unmodified
Added
Removed
  • branches/new_class_id/src/lib/graphics/text_engine/font.h

    r9718 r9837  
    5252  void debug() const;
    5353
     54  void acquireData(const FontData::Pointer& data) { this->data = data; };
     55  const FontData::Pointer& dataPointer() const { return data; };
    5456private:
    5557  void init();
  • branches/new_class_id/src/lib/graphics/text_engine/resource_texture.cc

    r9833 r9837  
    11
    2 #include "resource_texture.h"
     2#include "resource_font.h"
    33#include "substring.h"
    44#include "multi_type.h"
     
    66
    77
    8 ResourceTexture::ResourceTexture(const std::string& imageName, GLenum target)
    9     : NewResource(&ResourceTexture::type)
     8ResourceFont::ResourceFont(const std::string& imageName, GLenum target)
     9    : NewResource(&ResourceFont::type)
    1010{
    1111  Resources::StorePointer* ptr = this->acquireResource(imageName + ',' + "TEST");
     
    1313  if (ptr)
    1414  {
    15     PRINTF(5)("FOUND TEXTURE: %s\n", imageName.c_str());
    16     this->acquireData(static_cast<ResourceTexture::TextureResourcePointer*>(ptr)->ptr());
     15    PRINTF(5)("FOUND FONT: %s\n", imageName.c_str());
     16    this->acquireData(static_cast<ResourceFont::FontResourcePointer*>(ptr)->ptr());
    1717  }
    1818  else
    1919  {
    20     PRINTF(5)("NOT FOUND TEXTURE: %s\n", imageName.c_str());
     20    PRINTF(5)("NOT FOUND FONT: %s\n", imageName.c_str());
    2121    std::string fileName = this->NewResource::locateFile(imageName);
    22     this->Texture::loadImage(fileName, target);
    23     this->NewResource::addResource(new ResourceTexture::TextureResourcePointer(imageName + ',' + "TEST", Resources::KeepLevel(0), this->Texture::dataPointer()));
     22    this->Font::loadImage(fileName, target);
     23    this->NewResource::addResource(new ResourceFont::FontResourcePointer(imageName + ',' + "TEST", Resources::KeepLevel(0), this->Font::dataPointer()));
    2424  }
    2525}
    2626
    27 ResourceTexture ResourceTexture::createFromString(const std::string& loadString)
     27ResourceFont ResourceFont::createFromString(const std::string& loadString)
    2828{
    2929  SubString loadValues(loadString, ',');
    3030  std::string imageName;
    31   GLenum target = GL_TEXTURE_2D;
     31  GLenum target = GL_FONT_2D;
    3232  if (loadValues.size() > 0)
    3333    imageName = loadValues[0];
     
    3535    target = (GLenum)MultiType(loadValues[2]).getInt();
    3636
    37   return ResourceTexture(imageName, target);
     37  return ResourceFont(imageName, target);
    3838}
    3939
    4040
    4141
    42 Resources::tType<ResourceTexture> ResourceTexture::type("Texture");
     42Resources::tType<ResourceFont> ResourceFont::type("Font");
    4343
    4444
     
    4646
    4747
    48 ResourceTexture::TextureResourcePointer::TextureResourcePointer(const std::string& loadString, const Resources::KeepLevel& keepLevel, const TextureData::Pointer& data)
     48ResourceFont::FontResourcePointer::FontResourcePointer(const std::string& loadString, const Resources::KeepLevel& keepLevel, const FontData::Pointer& data)
    4949    : Resources::StorePointer(loadString, keepLevel) , pointer(data)
    5050{}
  • branches/new_class_id/src/lib/graphics/text_engine/resource_texture.h

    r9833 r9837  
    11/*!
    2  * @file resource_texture.h
    3  * @brief Contains the ResourceTexture class, that handles the Resource-specific loading part of the Texture.
     2 * @file resource_font.h
     3 * @brief Contains the ResourceFont class, that handles the Resource-specific loading part of the Font.
    44 *
    55 */
    66
    7 #ifndef _RESOURCE_TEXTURE_H
    8 #define _RESOURCE_TEXTURE_H
     7#ifndef _RESOURCE_FONT_H
     8#define _RESOURCE_FONT_H
    99
    1010#include "util/loading/resource.h"
    11 #include "texture.h"
     11#include "font.h"
    1212
    1313
    14 class ResourceTexture : public Texture, public Resources::NewResource
     14class ResourceFont : public Font, public Resources::NewResource
    1515{
    1616public:
    17   ResourceTexture(const std::string& imageName, GLenum target = GL_TEXTURE_2D);
    18   static ResourceTexture createFromString(const std::string& loadString);
     17  ResourceFont(const std::string& imageName, GLenum target = GL_FONT_2D);
     18  static ResourceFont createFromString(const std::string& loadString);
    1919
    2020private:
    21 class TextureResourcePointer : public Resources::StorePointer
     21class FontResourcePointer : public Resources::StorePointer
    2222  {
    2323  public:
    24     TextureResourcePointer(const std::string& loadString, const Resources::KeepLevel& keepLevel, const TextureData::Pointer& data);
    25     inline const TextureData::Pointer& ptr() const { return pointer; }
     24    FontResourcePointer(const std::string& loadString, const Resources::KeepLevel& keepLevel, const FontData::Pointer& data);
     25    inline const FontData::Pointer& ptr() const { return pointer; }
    2626private:
    27     TextureData::Pointer pointer;
     27    FontData::Pointer pointer;
    2828  };
    2929
    3030private:
    31   static Resources::tType<ResourceTexture> type;
     31  static Resources::tType<ResourceFont> type;
    3232};
    3333
    3434
    35 #endif /* _RESOURCE_TEXTURE_H */
     35#endif /* _RESOURCE_FONT_H */
Note: See TracChangeset for help on using the changeset viewer.