I've got a small question regarding performance. Since Fog of War in my project is based on 32x32 tiles, I use a single .png graphic, completely black. It's 2.75kb in size.
I draw it in 2 states: with alpha set to 255 and 128, depending on what did player see. At most, there are 1,248 of these tiles drawn on screen (if player is looking at the part of map which has no player characters on). I was wondering, if replacing:
@sprite = Image.new($window, "Graphics/Sprites/fow_frame.png", false)
with:
@sprite = $window.record { $window.draw_quad(x, y, @color, x + 32, y, @color, x + 32, y + 32, @color, x, y+32, @color, Z::FOW) }
Would be faster? I would like to use a bit smaller grid, but halving both width and height of single FOW tile (to 16x16) increases amount of tiles being drawn 4 times, which drops FPS really bad.
Also I wouldn't mind some good alternatives on creating FOW effect.
Loading...