moved word wrap function from Vertical Scroller into utils.

moved MTG specific functions out of utils.cpp into AllAbilities
added word wrapping to descriptions while viewing deck information.
This commit is contained in:
techdragon.nguyen@gmail.com
2010-11-29 13:38:36 +00:00
parent 4badcc374f
commit 0c9f5cd558
8 changed files with 117 additions and 151 deletions

View File

@@ -5138,4 +5138,12 @@ public:
}
};
// utility functions
void PopulateColorIndexVector( list<int>& colors, const string& colorsString, char delimiter = ',');
void PopulateAbilityIndexVector( list<int>& abilities, const string& abilitiesString, char delimiter = ',');
void PopulateSubtypesIndexVector( list<int>& subtypes, const string& subtypesString, char delimiter = ' ');
#endif

View File

@@ -39,7 +39,6 @@ class VerticalTextScroller:
{
private:
size_t mNbItemsShown;
bool mScrollerInitialized;
float mHeight; // maximum height availble for display
float mMarginX;
float mMarginY; // margin used to allow text to scroll off screen without
@@ -47,9 +46,6 @@ private:
// for at least one line of text ( mY - line height of current font )
float mOriginalY; // mY initially, used to restore scroller to original position after update
protected:
string wordWrap(string sentence, float width);
public:
VerticalTextScroller(int fontId, float x, float y, float width, float height, float scrollSpeed = 30, size_t _minimumItems = 1);
void Render();

View File

@@ -43,12 +43,7 @@ std::string join(vector<string> &v, string delim = " ");
std::vector<std::string> &split(const std::string &s, char delim, std::vector<std::string> &elems);
std::vector<std::string> split(const std::string &s, char delim); //splits a string with "delim" and returns a vector of strings.
std::string wordWrap(std::string s, int width);
void PopulateColorIndexVector( list<int>& colors, const string& colorsString, char delimiter = ',');
void PopulateAbilityIndexVector( list<int>& abilities, const string& abilitiesString, char delimiter = ',');
void PopulateSubtypesIndexVector( list<int>& subtypes, const string& subtypesString, char delimiter = ' ');
std::string wordWrap(std::string s, float width, int fontId);
int loadRandValues(string s);
int filesize(const char * filename);