Search found 2563 matches

by pgimeno
Sun Apr 18, 2021 2:19 am
Forum: Support and Development
Topic: Efficiently drawing a grid map
Replies: 7
Views: 144

Re: Efficiently drawing a grid map

If you had a dungeon crawler that doesn't scroll very fast, would it help to draw all the floor tiles first then all the walls then all the doors etc? In other words, don't blindly draw left to right and causing a lot of swapping? If you have all floor tiles in a single texture atlas, all the walls...
by pgimeno
Sat Apr 17, 2021 5:47 pm
Forum: Support and Development
Topic: Efficiently drawing a grid map
Replies: 7
Views: 144

Re: Efficiently drawing a grid map

I'm not hitting a bottleneck, just done with the map, so now I'm thinking on optimization... Planning on using a texture atlas in advance would have saved you some work. Don't believe the tale about "premature optimization blah blah". Misuse of that adage is the root of all evil. 1)So wil...
by pgimeno
Sat Apr 17, 2021 11:38 am
Forum: Support and Development
Topic: Efficiently drawing a grid map
Replies: 7
Views: 144

Re: Efficiently drawing a grid map

A texture atlas is the way to speed it up. SpriteBatch is made mostly for this kind of usage, and requires a texture atlas. Thnx, now I know it's possible, but how? 1)Any pointers/references on the use for this type of thing? 2) Will it make the game faster? 1) https://love2d.org/wiki/Tutorial:Effi...
by pgimeno
Sat Apr 17, 2021 11:33 am
Forum: Games and Creations
Topic: Commodore 64 emulator
Replies: 1
Views: 71

Re: Commodore 64 emulator

Wow.
by pgimeno
Sat Apr 17, 2021 10:56 am
Forum: Support and Development
Topic: Efficiently drawing a grid map
Replies: 7
Views: 144

Re: Efficiently drawing a grid map

A texture atlas is the way to speed it up. SpriteBatch is made mostly for this kind of usage, and requires a texture atlas.
by pgimeno
Sat Apr 17, 2021 10:52 am
Forum: General
Topic: What if I distribute an exe without cleaning the console?
Replies: 4
Views: 128

Re: What if I distribute an exe without cleaning the console?

It has potential to make the application slower. You can disable print() just in case:

Code: Select all

function print() end
by pgimeno
Fri Apr 16, 2021 4:38 pm
Forum: Support and Development
Topic: Why doesn't Font.getHeight() work the same as Font.getWidth()?
Replies: 3
Views: 96

Re: Why doesn't Font.getHeight() work the same as Font.getWidth()?

If you use love.graphics.print, the total height is the number of lines (number of \n + 1) multiplied by Font:getHeight(). If you use love.graphics.printf, you can get the number of final lines by taking the number of elements present in the second return value of Font:getWrap . Multiplying that by ...
by pgimeno
Fri Apr 16, 2021 11:07 am
Forum: Support and Development
Topic: Coordinates for lines vs points (and pixel grid alignment for points)
Replies: 4
Views: 187

Re: Coordinates for lines vs points (and pixel grid alignment for points)

Well, I was wrong, but not by much. As it turns out, the rounding depends on whether the line is horizontal or vertical, and there are good reasons for that. First, let's talk about filled rectangles. Rectangles don't have the same problems as lines, because they have an edge. You place the top left...
by pgimeno
Wed Apr 14, 2021 4:29 pm
Forum: Support and Development
Topic: Coordinates for lines vs points (and pixel grid alignment for points)
Replies: 4
Views: 187

Re: Coordinates for lines vs points (and pixel grid alignment for points)

I see no inconsistency in behaviour. There seems to be some inconsistency in the rounding performed by your graphics card driver when drawing points, which I believe is an OpenGL native operation, while love.graphics.line is polygon-based, so the rounding for lines is performed on the Löve side. The...
by pgimeno
Tue Apr 13, 2021 11:31 am
Forum: Support and Development
Topic: Coordinates for lines vs points (and pixel grid alignment for points)
Replies: 4
Views: 187

Re: Coordinates for lines vs points (and pixel grid alignment for points)

It's just natural that coordinates work that way. The edges of the pixels are at integral positions, the centres are at a distance of 0.5 from either edge. It's the same for lines and rectangles; try drawing horizontal or vertical lines, or rectangles in line mode, at integer coordinates with love.g...