diff options
author | Robert Vollmert <rvollmert@gmx.net> | 2010-03-11 10:55:46 +0100 |
---|---|---|
committer | Robert Vollmert <rvollmert@gmx.net> | 2010-03-11 11:09:40 +0100 |
commit | 1e8095ba07af3c46fbbc903ad31ce12312ca447d (patch) | |
tree | cbd6a68b87700383650aac1d31595e69ed40b930 /crawl-ref/source/format.cc | |
parent | 080c5b0c3efc80fe7da445cd6f9561844ccd8a0a (diff) | |
download | crawl-ref-1e8095ba07af3c46fbbc903ad31ce12312ca447d.tar.gz crawl-ref-1e8095ba07af3c46fbbc903ad31ce12312ca447d.zip |
Remove FSOP_CURSOR and formatted_string::cgotoxy.
It's not used anymore, and a lot of code doesn't even deal with it
properly.
Also fix what seemed to be a bug in FSOP_COLOUR handling in
formatted_string::substr.
Diffstat (limited to 'crawl-ref/source/format.cc')
-rw-r--r-- | crawl-ref/source/format.cc | 33 |
1 files changed, 1 insertions, 32 deletions
diff --git a/crawl-ref/source/format.cc b/crawl-ref/source/format.cc index 9ddf082dda..73831576ae 100644 --- a/crawl-ref/source/format.cc +++ b/crawl-ref/source/format.cc @@ -266,9 +266,6 @@ std::string formatted_string::html_dump() const s += colour_to_str(ops[i].x); s += ">"; break; - case FSOP_CURSOR: - // FIXME error handling? - break; } } return s; @@ -389,11 +386,6 @@ void formatted_string::display(int s, int e) const ops[i].display(); } -void formatted_string::cgotoxy(int x, int y) -{ - ops.push_back( fs_op(x, y) ); -} - int formatted_string::find_last_colour() const { if (!ops.empty()) @@ -409,7 +401,6 @@ formatted_string formatted_string::substr(size_t start, size_t substr_length) co { const unsigned int NONE = UINT_MAX; // from limits.h unsigned int last_FSOP_COLOUR = NONE; - unsigned int last_FSOP_CURSOR = NONE; // Find the first string to copy unsigned int i; @@ -417,9 +408,7 @@ formatted_string formatted_string::substr(size_t start, size_t substr_length) co { const fs_op& op = ops[i]; if (op.type == FSOP_COLOUR) - last_FSOP_CURSOR = i; - else if (op.type == FSOP_CURSOR) - last_FSOP_CURSOR = i; + last_FSOP_COLOUR = i; else if (op.type == FSOP_TEXT) { if (op.text.length() > start) @@ -436,8 +425,6 @@ formatted_string formatted_string::substr(size_t start, size_t substr_length) co // set up the state if (last_FSOP_COLOUR != NONE) result.ops.push_back(ops[last_FSOP_COLOUR]); - if (last_FSOP_CURSOR != NONE) - result.ops.push_back(ops[last_FSOP_CURSOR]); // Copy the text for ( ; i<ops.size(); i++) @@ -506,24 +493,6 @@ void formatted_string::fs_op::display() const { switch (type) { - case FSOP_CURSOR: - { - int cx = x, cy = y; - if (relative) - { - cx += wherex(); - cy += wherey(); - } - else - { - if (cx == -1) - cx = wherex(); - if (cy == -1) - cy = wherey(); - } - ::cgotoxy(cx, cy); - break; - } case FSOP_COLOUR: ::textattr(x); break; |