I Love Gameboy

Showcase your libraries, tools and other projects that help your fellow love users.
User avatar
Nixola
Inner party member
Posts: 1949
Joined: Tue Dec 06, 2011 7:11 pm
Location: Italy

Re: I Love Gameboy

Post by Nixola »

Do you mean

Code: Select all

if (condition) then 
    require 'some file' 
end
?
lf = love.filesystem
ls = love.sound
la = love.audio
lp = love.physics
lt = love.thread
li = love.image
lg = love.graphics
Technicolour
Prole
Posts: 24
Joined: Sat Sep 24, 2011 12:22 am

Re: I Love Gameboy

Post by Technicolour »

I meant as in, if the thing being required exists, else require something else ^^
User avatar
bartbes
Sex machine
Posts: 4946
Joined: Fri Aug 29, 2008 10:35 am
Location: The Netherlands
Contact:

Re: I Love Gameboy

Post by bartbes »

Code: Select all

if love.filesystem.exists("some/file.lua") then
    require("some.file")
else
    require("other.file")
end
User avatar
SiENcE
Party member
Posts: 792
Joined: Thu Jul 24, 2008 2:25 pm
Location: Berlin/Germany
Contact:

Re: I Love Gameboy

Post 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 :)
User avatar
headchant
Party member
Posts: 105
Joined: Fri Sep 03, 2010 12:39 pm
Contact:

Re: I Love Gameboy

Post 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)
User avatar
SiENcE
Party member
Posts: 792
Joined: Thu Jul 24, 2008 2:25 pm
Location: Berlin/Germany
Contact:

Re: I Love Gameboy

Post 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
User avatar
Jasoco
Inner party member
Posts: 3725
Joined: Mon Jun 22, 2009 9:35 am
Location: Pennsylvania, USA
Contact:

Re: I Love Gameboy

Post 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.
Snoopy1611
Prole
Posts: 3
Joined: Thu Mar 22, 2012 2:13 am

Re: I Love Gameboy

Post 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! ;)
User avatar
Xgoff
Party member
Posts: 211
Joined: Fri Nov 19, 2010 4:20 am

Re: I Love Gameboy

Post 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
Delibrete
Prole
Posts: 37
Joined: Mon Dec 05, 2011 11:51 am

Re: I Love Gameboy

Post by Delibrete »

Might I suggest this becomes it's own community forum board?
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests