Mercurial > fife-parpg
comparison engine/core/view/camera.cpp @ 34:d66538926e78
fix getPixelRGBA - it should return r g b and not r b g...
why did everyone use the wrong order instead of fixing the reason? :)
author | spq@33b003aa-7bff-0310-803a-e67f0ece8222 |
---|---|
date | Sat, 12 Jul 2008 00:20:26 +0000 |
parents | 1e3b68c260a6 |
children | 90005975cdbb |
comparison
equal
deleted
inserted
replaced
33:112fc4af772d | 34:d66538926e78 |
---|---|
312 double fsw = static_cast<double>(vc.dimensions.w); | 312 double fsw = static_cast<double>(vc.dimensions.w); |
313 double fsh = static_cast<double>(vc.dimensions.h); | 313 double fsh = static_cast<double>(vc.dimensions.h); |
314 x = static_cast<int>(round(fx / fsw * fow)); | 314 x = static_cast<int>(round(fx / fsw * fow)); |
315 y = static_cast<int>(round(fy / fsh * foh)); | 315 y = static_cast<int>(round(fy / fsh * foh)); |
316 } | 316 } |
317 vc.image->getPixelRGBA(x, y, &r, &b, &g, &a); | 317 vc.image->getPixelRGBA(x, y, &r, &g, &b, &a); |
318 // instance is hit with mouse if not totally transparent | 318 // instance is hit with mouse if not totally transparent |
319 if (a != 0) { | 319 if (a != 0) { |
320 instances.push_back(i); | 320 instances.push_back(i); |
321 } | 321 } |
322 } | 322 } |
347 double fsw = static_cast<double>(vc.dimensions.w); | 347 double fsw = static_cast<double>(vc.dimensions.w); |
348 double fsh = static_cast<double>(vc.dimensions.h); | 348 double fsh = static_cast<double>(vc.dimensions.h); |
349 x = static_cast<int>(round(fx / fsw * fow)); | 349 x = static_cast<int>(round(fx / fsw * fow)); |
350 y = static_cast<int>(round(fy / fsh * foh)); | 350 y = static_cast<int>(round(fy / fsh * foh)); |
351 } | 351 } |
352 vc.image->getPixelRGBA(x, y, &r, &b, &g, &a); | 352 vc.image->getPixelRGBA(x, y, &r, &g, &b, &a); |
353 // instance is hit with mouse if not totally transparent | 353 // instance is hit with mouse if not totally transparent |
354 if (a != 0) { | 354 if (a != 0) { |
355 instances.push_back(i); | 355 instances.push_back(i); |
356 goto found_non_transparent_pixel; | 356 goto found_non_transparent_pixel; |
357 } | 357 } |