Page 5 of 7

Re: I Love Gameboy

Posted: Wed Apr 18, 2012 1:01 pm
by Nixola
Do you mean

Code: Select all

if (condition) then 
    require 'some file' 
end
?

Re: I Love Gameboy

Posted: Wed Apr 18, 2012 3:25 pm
by Technicolour
I meant as in, if the thing being required exists, else require something else ^^

Re: I Love Gameboy

Posted: Wed Apr 18, 2012 4:36 pm
by bartbes

Code: Select all

if love.filesystem.exists("some/file.lua") then
    require("some.file")
else
    require("other.file")
end

Re: I Love Gameboy

Posted: Wed Apr 18, 2012 7:33 pm
by SiENcE
Technicolour wrote:That's awesome Science, If you don't mind I'll copy over your imagedata sollution over to my most recent version, it seems Canvas is just more trouble than it's worth in this situation.
sure :)

Re: I Love Gameboy

Posted: Wed Apr 18, 2012 7:59 pm
by headchant
SiENcE wrote: i fixed it, by using imagedata.
Nearest neighbour looks better(I like my pixels ...pixely):

Code: Select all

img = love.graphics.newImage(canvas)
img:setFilter("nearest", "nearest")
love.graphics.draw(img, 10, 10, 0, 3, 3)

Re: I Love Gameboy

Posted: Wed Apr 18, 2012 8:17 pm
by SiENcE
headchant wrote:
SiENcE wrote: i fixed it, by using imagedata.
Nearest neighbour looks better(I like my pixels ...pixely):

Code: Select all

img = love.graphics.newImage(canvas)
img:setFilter("nearest", "nearest")
love.graphics.draw(img, 10, 10, 0, 3, 3)
Did i said something about nearest neighbour?

"Wise men talk because they have something to say; fools, because they have to say something."
-- Plato

Re: I Love Gameboy

Posted: Wed Apr 18, 2012 11:25 pm
by Jasoco
I agree. Blurred large antialiased pixels look terrible. The image should be nearest neighbor. It's the only way I can play a pixellated game zoomed in.

Re: I Love Gameboy

Posted: Thu Apr 19, 2012 12:50 am
by Snoopy1611
Hi, I found the Problem that causes the "ghosting" when a canvas is used.
The default PointStyle seems to be "smooth" but for your "draw only pixels that changed" approach ist is important that exact Pixels are drawn to the canvas and not smooth Points.
So if you add

Code: Select all

love.graphics.setPoint( 1, "rough" )
to your love.load() all shold be good.

Note that setPointStyle does not work, there seems to be a bug with that. viewtopic.php?f=4&t=2846&hilit=setPointStyle

I don't know why the ghosting does not happen for everyone my guess is:
a) Different Default values for PointStyle in diffrerent Löve builds? (unlikely)
b) Different SDL Library or opengl implementation?

If this solution works for everyone I would suggest to drop the "imagedata Hack" and go back to canvas besause it's way faster!

And btw. Technicolour: I löve your Emulator! The Z80 code ist pure genius. The "array of functions" to execute the Opcodes is really cool! ;)

Re: I Love Gameboy

Posted: Thu Apr 19, 2012 5:55 am
by Xgoff
Snoopy1611 wrote:Hi, I found the Problem that causes the "ghosting" when a canvas is used.
The default PointStyle seems to be "smooth" but for your "draw only pixels that changed" approach ist is important that exact Pixels are drawn to the canvas and not smooth Points.
So if you add

Code: Select all

love.graphics.setPoint( 1, "rough" )
to your love.load() all shold be good.

Note that setPointStyle does not work, there seems to be a bug with that. viewtopic.php?f=4&t=2846&hilit=setPointStyle

I don't know why the ghosting does not happen for everyone my guess is:
a) Different Default values for PointStyle in diffrerent Löve builds? (unlikely)
b) Different SDL Library or opengl implementation?

If this solution works for everyone I would suggest to drop the "imagedata Hack" and go back to canvas besause it's way faster!

And btw. Technicolour: I löve your Emulator! The Z80 code ist pure genius. The "array of functions" to execute the Opcodes is really cool! ;)
i tried changing point styles myself and it didn't work. of course, as you mentioned, it turns out i used setPointStyle and didn't even think about using setPoint. blah.

setPoint does in fact fix the issue for me

Re: I Love Gameboy

Posted: Thu Apr 19, 2012 8:55 am
by Delibrete
Might I suggest this becomes it's own community forum board?