adekto / maid64

low resolution scaler for love2D

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Setup function requires x as an argument instead of being optional.

wistpotion opened this issue · comments

I noticed this piece of code:

function maid64.setup(x,y,overscan)
    maid64.overscan = overscan or false
    maid64.sizeX = x or 64
    maid64.sizeY = y or maid64.sizeX
    if x < (y or 0) then 
        maid64.scaler = love.graphics.getHeight() / maid64.sizeY
    else
        maid64.scaler = love.graphics.getWidth() / maid64.sizeX
    end

It results in an error if x isn't passed in as an argument, and as I see it all arguments should be optional.
Therefore I think something like this would be an improvement:

function maid64.setup(x,y,overscan)
    maid64.overscan = overscan or false
    maid64.sizeX = x or 64
    maid64.sizeY = y or maid64.sizeX
    if maid64.sizeX < maid64.sizeY then --edited this lil line to support all arguments as optional
        maid64.scaler = love.graphics.getHeight() / maid64.sizeY
    else
        maid64.scaler = love.graphics.getWidth() / maid64.sizeX
    end

Note: it's not the full functions, just the part of it I thought mattered the most.