Make middle click work with photon map

This commit is contained in:
jacksonmj 2011-04-27 22:51:20 +01:00 committed by Simon Robertshaw
parent 9a3836879e
commit 892a2b11c7

View File

@ -2769,10 +2769,12 @@ int main(int argc, char *argv[])
//sample //sample
else if (((sdl_mod & (KMOD_LALT|KMOD_RALT)) && !(sdl_mod & (KMOD_SHIFT))) || b==SDL_BUTTON_MIDDLE) else if (((sdl_mod & (KMOD_LALT|KMOD_RALT)) && !(sdl_mod & (KMOD_SHIFT))) || b==SDL_BUTTON_MIDDLE)
{ {
if (y>0 && y<sdl_scale*YRES && x>0 && x<sdl_scale*XRES) if (y>=0 && y<YRES && x>=0 && x<XRES)
{ {
int cr; int cr;
cr = pmap[y][x]; cr = pmap[y][x];
if ((cr>>8)>=NPART || !cr)
cr = photons[y][x];
if (!((cr>>8)>=NPART || !cr)) if (!((cr>>8)>=NPART || !cr))
{ {
c = sl = cr&0xFF; c = sl = cr&0xFF;