|Logged in as: Anonymous (Viewer)||2018-01-23 02:13 GMT|
|My View | View Issues | Roadmap | Logout|
|View Issue Details|
|ID||Project||Category||View Status||Date Submitted||Last Update|
|0028628||Runner||Functions||Public||2018-01-05 12:02||2018-01-08 13:45|
|Assigned To||Mike Dailly|
|Priority||Low||Severity||C - General||Reproducibility||100%|
|Summary||0028628: Functions: matrix_view is corrupted after calling surface_reset_target|
|Description||In GMS2 the surface_set_target function sets matrix_view to surface's local coordinates so if I call draw_point(0, 0) it will be drawn in the top-left corner of the surface and it doesn't matter what the current view coordinates are but it's possible to save the matrix_view in the beginning of Draw Event, and set it after the surface_set_target then call draw_point(0,0) and it will set a point it the top-left corner of the current view on the selected surface which seems to be fine.|
However surface_reset_target corrupts the view matrix and all the other draw_* calls in Draw Events of any object are incorrect, all the elements are drawn in wrong places. I guess, surface_reset_target function should just reset the view matrix to the state before surface_set_target was called.
|Steps To Reproduce||1) Run the attached sample|
2) Press + or - to rotate
3) See that your sprites rotate in different directions even though you're only rotating the camera
4) Within the Draw event uncomment the line specified
5) Run it again and rotate
6) See that this has fixed it
|2.x Runtime Version||126.96.36.199|
|2.x Runtime Version Verified In||188.8.131.52|
|Attached Files||view-surface-bug.yyz [^] (24,201 bytes) 2018-01-05 12:02|
Mike Dailly (Manager)
This is by design. Setting a surface sets the model, view and project matrix, and when popping will restore the current camera one.
We do not store what was "there" as this could easily lead to errors if the camera has changed in anyway. The camera must be restored. This is also true for pushing multiple surfaces, we need to restore the last one to keep consistency.
If you use a custom matrix you will need to reset this yourself after popping off a surface from the stack.
|Copyright © 2000 - 2018 MantisBT Team mail.yoyogames.com|