NightFrost
Member
So I've been wondering if this is a hardware-related feature or an actual bug within GML. I noticed this first time when creating my 9slice border scripts so I'll use a similar example. Let's assume we have a 5x5 pixel sprite called spr_9slice_box with multiple colors:
So a basic 9slice border sprite. I could have used 3x3 pixels but the issue is easier to see with larger size. We'll throw in an object to room that only runs the following draw:
The code copies the two topmost blue pixels (1x2 pixel area) and stretches it horizontally by a factor of 100. So we get a 100x2 blue stripe. So far so good. But when we change the draw to:
We get a 400x2 blue stripe, but the rightmost pixels are red. They are the pixels immediately to the right of the area designated to be drawn. The issue arises when stretch is set to at least 256, which should have significance to anyone knowing binary and/or hexadecimal. Vertical stretch has the same issue. What I've considered about this, it would make sense if this was a hardware level thing (well, shader thing).
(My GPU is a Radeon, an MSI R9 380 card to be precise.)
Code:
R = Red
B = Blue
G = Green
R R B R R
R R B R R
B B G B B
R R B R R
R R B R R
Code:
draw_sprite_part_ext(spr_9slice_box, 0, 2, 0, 1, 2, x, y, 100, 1, c_white, 1);
Code:
draw_sprite_part_ext(spr_9slice_box, 0, 2, 0, 1, 2, x, y, 400, 1, c_white, 1);
(My GPU is a Radeon, an MSI R9 380 card to be precise.)