comparison gui/ui/render.c @ 36995:efec4d517450

Activate the #else part of the conditional directive. This code should be faster.
author ib
date Thu, 27 Mar 2014 13:43:19 +0000
parents 167442bc79d0
children 9402cbe067c8
comparison
equal deleted inserted replaced
36994:167442bc79d0 36995:efec4d517450
359 359
360 static void PutImage(guiImage *img, int x, int y, int parts, int index) 360 static void PutImage(guiImage *img, int x, int y, int parts, int index)
361 { 361 {
362 int i, ix, iy; 362 int i, ix, iy;
363 uint32_t *pixels, *drawbuf; 363 uint32_t *pixels, *drawbuf;
364 register uint32_t pixel; 364 register uint32_t yc, pixel;
365
366 /* register uint32_t yc; */
367 365
368 if (!img || (img->Image == NULL)) 366 if (!img || (img->Image == NULL))
369 return; 367 return;
370 368
371 i = img->Width * (img->Height / parts) * index; 369 i = img->Width * (img->Height / parts) * index;
372 drawbuf = (uint32_t *)image_buffer; 370 drawbuf = (uint32_t *)image_buffer;
373 pixels = (uint32_t *)img->Image; 371 pixels = (uint32_t *)img->Image;
374 372
375 #if 1
376 for (iy = y; iy < (int)(y + img->Height / parts); iy++)
377 for (ix = x; ix < (int)(x + img->Width); ix++) {
378 pixel = pixels[i++];
379
380 if (!IS_TRANSPARENT(pixel))
381 drawbuf[iy * drawbuf_width + ix] = pixel;
382 }
383 #else
384 yc = y * drawbuf_width; 373 yc = y * drawbuf_width;
385 374
386 for (iy = y; iy < (int)(y + img->Height / parts); iy++) { 375 for (iy = y; iy < (int)(y + img->Height / parts); iy++) {
387 for (ix = x; ix < (int)(x + img->Width); ix++) { 376 for (ix = x; ix < (int)(x + img->Width); ix++) {
388 pixel = pixels[i++]; 377 pixel = pixels[i++];
391 drawbuf[yc + ix] = pixel; 380 drawbuf[yc + ix] = pixel;
392 } 381 }
393 382
394 yc += drawbuf_width; 383 yc += drawbuf_width;
395 } 384 }
396 #endif
397 } 385 }
398 386
399 static void SinglePhasePutImage(guiImage *bf, int x, int y, float frac) 387 static void SinglePhasePutImage(guiImage *bf, int x, int y, float frac)
400 { 388 {
401 int i = 0, w, r, ix, iy; 389 int i = 0, w, r, ix, iy;