19 using std::ostringstream;
30 static SDL_mutex * _rtextSDLMutex()
32 static SDL_mutex *rv = SDL_CreateMutex();
60 #define PIXELTAB (VIRTW/12)
68 std::string::iterator iter = str.begin();
71 TextPlane newTextPlane( foreground, background );
72 newTextPlane.
SetPos( x, y );
74 newTextPlane.
Draw( str );
82 for (vector< cline >::iterator iter = conlines.begin(); iter < conlines.end(); iter++) {
84 refs.push_back( ( *(iter) ).cref );
85 else iter = conlines.end();
92 workIt.append(
"\n" );
94 vector< string >::iterator iter = refs.end();
95 if ( iter == refs.begin() ) breakout =
false;
98 if ( iter == refs.begin() ) breakout =
false;
99 workIt.append( ( *(iter) ) );
100 workIt.append(
"\n" );
103 ostringstream drawCommand;
106 while (shorter.size() > 80)
107 shorter.erase( shorter.begin() );
110 drawCommand<<workIt<<
"#FF1100> "<<
"#FF1100"<<shorter<<
"#00000";
113 Acdraw.append( drawCommand.str() );
121 size_t lastsearch = 0;
122 for (; ( search = sf.find(
"/r" ) ) != string::npos;) {
123 sf.replace( lastsearch, search-lastsearch,
"" );
129 cl.outtime = lastmillis;
132 cl.cref.append(
"\f" );
133 cl.cref.append( sf );
135 cl.cref.append( sf );
137 conlines.insert( conlines.begin(), cl );
150 SDL_mutex *mymutex = _rtextSDLMutex();
151 SDL_LockMutex( mymutex );
154 string::size_type fries = s.size();
156 for (string::size_type burger = 0; burger < fries; burger++) {
157 if (s[burger] ==
'\n' || burger == fries-1) {
158 if (burger == fries-1)
159 if (s[fries-1] !=
'\n' && s[fries-1] !=
'\r')
160 customer += s[burger];
163 }
else if ( customer.size() >=
static_cast<size_t>(WORDWRAP) ) {
164 customer += s[burger];
165 string fliptheburger;
166 while (customer[customer.size()-1] !=
' ') {
167 fliptheburger += customer[customer.size()-1];
168 string::iterator oldfloormeat = customer.end();
170 customer.erase( oldfloormeat );
176 for (
int salt = fliptheburger.size()-1; salt >= 0; salt--)
177 spatchula += fliptheburger[salt];
178 fliptheburger.erase();
179 fliptheburger.append( spatchula );
181 customer.append( fliptheburger );
182 }
else if (s[burger] !=
'\r') {
183 customer += s[burger];
187 SDL_UnlockMutex( mymutex );
193 size_t x = s.find(
"\n" );
195 if (x >= string::npos)
197 string::iterator iter = s.end();
198 if ( iter != s.begin() ) {
200 if (strcmp( &( *(iter) ),
"\n" ) != 0) s.append(
"\n" );
203 while (x < string::npos) {
205 part.append( s.substr( xlast, x-xlast ) );
207 x = s.find(
"\n", x+1 );
225 string::iterator iter = commandbuf.begin();
226 if ( iter < commandbuf.end() ) {
227 iter = commandbuf.end();
229 commandbuf.erase( iter );
240 vector< string >::iterator iter = vhistory.end();
242 if ( iter <= vhistory.begin() && iter >= vhistory.end() ) noSize =
true;
245 if (commandbuf.compare( ( *(iter) ) ) != 0 && !noSize) {
249 vhistory.push_back( commandbuf );
252 vhistory.push_back( commandbuf );
257 if (commandbuf.size() > 0) {
265 if (code > 0 && code < 256) {
266 unsigned char k = (
unsigned char) code;