Ignore:
Timestamp:
Apr 20, 2011, 12:39:27 AM (7 years ago)
Author:
Sam Hocevar
Message:

imlib: use vec2i for image::size and unroll all necessary changes
everywhere else in the code.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • abuse/trunk/src/light.cpp

    r494 r512  
    1212
    1313#include <stdlib.h>
     14
     15#include "common.h"
    1416
    1517#include "light.h"
     
    793795  screen->lock();
    794796
    795   int scr_w=screen->width();
     797  int scr_w=screen->Size().x;
    796798  uint8_t *screen_line=screen->scan_line(cy1)+cx1;
    797799
     
    899901             image *out, int32_t out_x, int32_t out_y)
    900902{
    901   if (sc->width()*2+out_x>out->width() ||
    902       sc->height()*2+out_y>out->height())
     903  if (sc->Size().x*2+out_x>out->Size().x ||
     904      sc->Size().y*2+out_y>out->Size().y)
    903905    return ;   // screen was resized and small_render has not changed size yet
    904906
     
    930932    uint8_t *src=sc->scan_line(0);
    931933    uint8_t *dst=out->scan_line(out_y+cy1*2)+cx1*2+out_x;
    932     int d_skip=out->width()-sc->width()*2;
     934    int d_skip=out->Size().x-sc->Size().x*2;
    933935    int x,y;
    934936    uint16_t v;
    935     for (y=sc->height(); y; y--)
    936     {
    937       for (x=sc->width(); x; x--)
     937    for (y=sc->Size().y; y; y--)
     938    {
     939      for (x=sc->Size().x; x; x--)
    938940      {
    939941    v=*(src++);
     
    942944      }
    943945      dst=dst+d_skip;
    944       memcpy(dst,dst-out->width(),sc->width()*2);
    945       dst+=out->width();
     946      memcpy(dst,dst-out->Size().x,sc->Size().x*2);
     947      dst+=out->Size().x;
    946948    }
    947949
     
    951953  light_patch *first=make_patch_list(cx2-cx1+1,cy2-cy1+1,screenx,screeny);
    952954
    953   int scr_w=sc->width();
    954   int dscr_w=out->width();
     955  int scr_w=sc->Size().x;
     956  int dscr_w=out->Size().x;
    955957
    956958  int prefix_x=(screenx&7);
Note: See TracChangeset for help on using the changeset viewer.