Bitmap: Make #get_pixel/#set_pixel more accurate
This gets rid of the "batch/flush" semantics for #set_pixel and instead just directly uploads the pixel color to the texture, circumventing the float conversion entirely. Also makes a lot of code simpler in many places as calling 'flush()' is no longer required for bitmaps.
This commit is contained in:
parent
1b0eb2797d
commit
e0a4dfe372
10 changed files with 23 additions and 157 deletions
|
@ -194,7 +194,7 @@ MRB_METHOD(bitmapGetPixel)
|
|||
return mrb_nil_value();
|
||||
)
|
||||
|
||||
Vec4 value;
|
||||
Color value;
|
||||
GUARD_EXC( value = b->getPixel(x, y); )
|
||||
|
||||
Color *color = new Color(value);
|
||||
|
@ -215,7 +215,7 @@ MRB_METHOD(bitmapSetPixel)
|
|||
|
||||
color = getPrivateDataCheck<Color>(mrb, colorObj, ColorType);
|
||||
|
||||
GUARD_EXC( b->setPixel(x, y, color->norm); )
|
||||
GUARD_EXC( b->setPixel(x, y, *color); )
|
||||
|
||||
return mrb_nil_value();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue