Fixed bug in SDL_UpdateRect when drawing cursor.

This commit is contained in:
Rob Pearce 2009-07-28 02:27:59 +00:00
parent 96981d8325
commit 7bde100972
1 changed files with 26 additions and 10 deletions

View File

@ -4964,13 +4964,31 @@ char *fixforhtml(char *oldtext, char *newtext) {
char *p, *p2;
p2 = newtext;
for (p = oldtext ; *p ; p++) {
if (*p == '&') {
*p2 = '\0';
strcat(p2, "&");
p2 += strlen("&");
} else {
*p2 = *p;
p2++;
switch (*p) {
case '&':
*p2 = '\0';
strcat(p2, "&");
p2 += strlen("&");
break;
case '"':
*p2 = '\0';
strcat(p2, """);
p2 += strlen(""");
break;
case '<':
*p2 = '\0';
strcat(p2, "&lt;");
p2 += strlen("&lt;");
break;
case '>':
*p2 = '\0';
strcat(p2, "&gt;");
p2 += strlen("&gt;");
break;
default:
*p2 = *p;
p2++;
break;
}
}
@ -9116,8 +9134,6 @@ int updatetextcursor(void) {
tempbuf[1] = '\0';
TTF_SizeText(font[updateheight], tempbuf, &cwid, &dummy);
}
// oooooooooooooooooooooo
/* draw cursor (a solid block) */
for (y = starty ; y < (starty + sh); y++ ) {
@ -9132,7 +9148,7 @@ int updatetextcursor(void) {
// update screen
SDL_UpdateRect(screen, startx - screenx, starty - screeny,
startx - screenx + tw + cwid + 3 , th);
tw + cwid + 3 , th);
//SDL_Flip(screen);