Changeset 369
- Timestamp:
- Oct 31, 2004, 8:26:05 PM (18 years ago)
- Location:
- libcaca/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
libcaca/trunk/THANKS
r357 r369 10 10 Thomas Klausner <wiz@NetBSD.org> - NetBSD port maintainer 11 11 Vincent Tantardini <vinc@FreeBSD-fr.org> - FreeBSD port maintainer 12 Jari Komppa <jari.komppa at gmail> - win32 speed improvements 12 13 -
libcaca/trunk/src/graphics.c
r368 r369 1217 1217 COORD size, pos; 1218 1218 SMALL_RECT rect; 1219 DWORD dummy; 1220 unsigned int x, y, len; 1219 unsigned int i; 1221 1220 1222 1221 /* Render everything to our back buffer */ 1223 for(y = 0; y < _caca_height; y++) 1224 { 1225 pos.X = 0; 1226 pos.Y = y; 1227 SetConsoleCursorPosition(win32_back, pos); 1228 1229 for(x = 0; x < _caca_width; x += len) 1230 { 1231 unsigned char *attr = win32_attr + x + y * _caca_width; 1232 1233 len = 1; 1234 while(x + len < _caca_width && attr[len] == attr[0]) 1235 len++; 1236 1237 SetConsoleTextAttribute(win32_back, 1238 win32_fg_palette[attr[0] & 0xf] 1239 | win32_bg_palette[attr[0] >> 4]); 1240 1241 WriteConsole(win32_back, win32_char + x + y * _caca_width, 1242 len, &dummy, NULL); 1243 } 1222 for(i = 0; i < _caca_width * _caca_height; i++) 1223 { 1224 win32_buffer[i].Char.AsciiChar = win32_char[i]; 1225 win32_buffer[i].Attributes = win32_fg_palette[win32_attr[i] & 0xf] 1226 | win32_bg_palette[win32_attr[i] >> 4]; 1244 1227 } 1245 1228 … … 1251 1234 rect.Right = _caca_width - 1; 1252 1235 rect.Bottom = _caca_height - 1; 1253 ReadConsoleOutput(win32_back, win32_buffer, size, pos, &rect);1254 1236 WriteConsoleOutput(win32_front, win32_buffer, size, pos, &rect); 1255 1237 }
Note: See TracChangeset
for help on using the changeset viewer.