Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 8324 in orxonox.OLD for trunk/src/lib/graphics/importer


Ignore:
Timestamp:
Jun 12, 2006, 12:40:57 AM (18 years ago)
Author:
bensch
Message:

trunk: Texture-Sequence is initialized smoothly now in the GLGuiCursor

Location:
trunk/src/lib/graphics/importer
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/lib/graphics/importer/texture_sequence.cc

    r8311 r8324  
    128128/**
    129129 * @brief Loads an Image-Series into the TextureSequence.
    130  * @param imagePrefix The Prefix of the Image
     130 * @param imageNameSubstitue The Prefix of the Image
    131131 * @param from From which image
    132132 * @param to To which image
     
    137137 * @note important is, that the count of ###'s is correct.
    138138 */
    139 bool TextureSequence::loadImageSeries(const std::string& imagePrefix, unsigned int from, unsigned int to)
     139bool TextureSequence::loadImageSeries(const std::string& imageNameSubstitue, unsigned int from, unsigned int to)
    140140{
    141141  unsigned int index = 0;
    142142  unsigned int frameSize = 0;
    143143  // search for the special character # in the LoadParam
    144   if ((index = imagePrefix.find("_#")) != std::string::npos)
    145   {
    146     std::string _imagePrefix = imagePrefix;
     144  if ((index = imageNameSubstitue.find("_#")) != std::string::npos)
     145  {
     146    std::string _imageNameSubstitue = imageNameSubstitue;
    147147    index++; // start at #
    148     while(imagePrefix[index+frameSize] == '#')
     148    while(imageNameSubstitue[index+frameSize] == '#')
    149149    {
    150       _imagePrefix[index+frameSize] = '0';
     150      _imageNameSubstitue[index+frameSize] = '0';
    151151      frameSize++;
    152152    }
    153153
    154     PRINTF(4)("Found %d '#'s in %s... searching for LOD's\n", frameSize, imagePrefix.c_str());
     154    PRINTF(4)("Found %d '#'s in %s... searching for LOD's\n", frameSize, imageNameSubstitue.c_str());
    155155    char tmpString[32];
    156156    for (unsigned int i = from; i < to; i++)
    157157    {
    158158      sprintf(tmpString, "%d", i);
    159       _imagePrefix.replace(index+frameSize -strlen(tmpString), strlen(tmpString), tmpString);
    160       this->addFrame(_imagePrefix);
     159      _imageNameSubstitue.replace(index+frameSize -strlen(tmpString), strlen(tmpString), tmpString);
     160      this->addFrame(_imageNameSubstitue);
    161161    }
    162162    return true;
  • trunk/src/lib/graphics/importer/texture_sequence.h

    r8310 r8324  
    2323    bool loadImageSeries(unsigned int count, ...);
    2424    bool loadImageSeries(const std::vector<std::string>& textureNames, const std::string& prependFolder = "");
    25     bool loadImageSeries(const std::string& imagePrefix, unsigned int from, unsigned int to);
     25    bool loadImageSeries(const std::string& imageNameSubstitue, unsigned int from, unsigned int to);
    2626    bool addFrame(const std::string& image);
    2727    bool addFrame(SDL_Surface* surface);
     
    3434    /** @returns the count of frames in this sequence */
    3535    inline unsigned int getFrameCount() const { return this->textures.size(); };
     36    /** @returns true if no Textures are stored inside of this TextureSequence */
     37    inline bool empty() const { return textures.empty(); };
    3638
    3739    //void gotoFrame(unsigned int frameNumber);
Note: See TracChangeset for help on using the changeset viewer.