tabularelf / Canvas

A non-volatile solution for surfaces in GameMaker Studio 2
MIT License
13 stars 0 forks source link

Incorrect call to __CanvasSurfaceCreate in Canvas.gml #7

Closed Grisgram closed 6 months ago

Grisgram commented 10 months ago

Hey!

Just saw line#494 in Canvas.gml:

var _surf = __CanvasSurfaceCreate(__width, __height);

but the function __CanvasSurfaceCreate requires 3 arguments, the _format being the third.

function __CanvasSurfaceCreate(_width, _height, _format) {

Take a look, what you wanted to achieve with this line, as it would crash if we ever reach it.

Cheers, Gris

tabularelf commented 10 months ago

Hey!

Just saw line#494 in Canvas.gml:

var _surf = __CanvasSurfaceCreate(__width, __height);

but the function __CanvasSurfaceCreate requires 3 arguments, the _format being the third.

function __CanvasSurfaceCreate(_width, _height, _format) {

Take a look, what you wanted to achieve with this line, as it would crash if we ever reach it.

Cheers, Gris

If you look at how __CanvasSurfaceCreate works, no, you would never crash. It comes down to if that specific version of GameMaker supports formats or not. (Though how that's detected will have to change for new runtime)

_format is at most optional, but it wouldn't default to one of the constants, since that conflicts with LTS.

Grisgram commented 10 months ago

Just saw the error in the "Syntax Errors" tab and thought, I take a closer look as I always try to have this tab clean. Any chance to avoid triggering the error message?

tabularelf commented 10 months ago

I'll see what I can do to remedy that

tabularelf commented 10 months ago

Wanted to let you know @Grisgram that I've made a few changes, one involving moving some syntax around to hopefully not have feather complain. Currently in dev branch! Haven't tested it yet, as I've been putting some focus on some other areas. 👌