Search found 3544 matches

by pgimeno
Mon Feb 08, 2021 5:59 pm
Forum: Libraries and Tools
Topic: Objective Lua - additional syntax to original Lua!
Replies: 26
Views: 21872

Re: Objective Lua - additional syntax to original Lua!

Generally, var *= expr does not translate to var = var * expr, it translates to var = var * (expr). For example, most people would expect this: i = 1 j = 2 k = 5 k *= i + j print(k) to print 15, as it's the result of 5 * (1 + 2), and not 7, which is the result of 5 * 1 + 2. However, I can't get that...
by pgimeno
Sun Feb 07, 2021 1:00 pm
Forum: Support and Development
Topic: love.physics: mass vs weight
Replies: 6
Views: 3724

Re: love.physics: mass vs weight

A scale is graduated in units of mass, not force. They are generally calibrated to be used approximately at sea level, otherwise the measure may be incorrect (the variation is generally too small to be noticeable at most common heights, though - EDIT: according to this , the measure will be approxim...
by pgimeno
Sun Feb 07, 2021 11:37 am
Forum: Support and Development
Topic: Problem with raycasting (floor tiles)
Replies: 5
Views: 5580

Re: Problem with raycasting (floor tiles)

That looks a lot like lack of perspective correction applied to the mesh. Squeezing a quad without applying perspective distorts the triangles that form the quad like that. Edit: Here's an example to demonstrate the distortion, using your floor.png texture: love.graphics.setDefaultFilter("neare...
by pgimeno
Fri Feb 05, 2021 7:34 pm
Forum: Libraries and Tools
Topic: Objective Lua - additional syntax to original Lua!
Replies: 26
Views: 21872

Re: Objective Lua - additional syntax to original Lua!

Not sure where the difference lies, but it's clear that the "lab test" gives quite different results than my "field test".
by pgimeno
Fri Feb 05, 2021 6:44 pm
Forum: Libraries and Tools
Topic: Objective Lua - additional syntax to original Lua!
Replies: 26
Views: 21872

Re: Objective Lua - additional syntax to original Lua!

It's quite fast because it uses string.byte, not string.sub If you microbenchmark string.byte(i) vs. string.sub(i, i), you'll find that they're basically identical in performance. Garbage isn't an issue either for 256 interned strings. http://www.formauri.es/personal/pgimeno/pastes/benchmark-string...
by pgimeno
Fri Feb 05, 2021 6:26 pm
Forum: Libraries and Tools
Topic: Objective Lua - additional syntax to original Lua!
Replies: 26
Views: 21872

Re: Objective Lua - additional syntax to original Lua!

YACC and Flex also use regular experessions in the lexing phase so yes it is common practice. Agreed. Regex is probaby slower than a hand written lexer like pgimeno's but regex is much easier to read and modify. Yeah, my hand written lexer basically mimics what Flex would generate. Also, you still ...
by pgimeno
Fri Feb 05, 2021 4:26 pm
Forum: Libraries and Tools
Topic: Objective Lua - additional syntax to original Lua!
Replies: 26
Views: 21872

Re: Objective Lua - additional syntax to original Lua!

Can I have the file that failed for inspection? I could iron out the issue while having the file. Also, I'm doing test cases for any Lua/Objective Lua code that could occur, I will try to iron out as many issues as I can, I wrote some files that could have potential errors but I'd like some communi...
by pgimeno
Fri Feb 05, 2021 1:17 pm
Forum: Support and Development
Topic: Problem with raycasting (floor tiles)
Replies: 5
Views: 5580

Re: Problem with raycasting

It looks like a problem with Löve's line algorithm; not sure if it's a bug or just an expected loss of precision. Here is a test case, not sure if it can be reproduced everywhere: love.graphics.setLineStyle("rough") function love.draw() love.graphics.line(70, 49138.421592350249, 70, -48658...
by pgimeno
Fri Feb 05, 2021 12:24 pm
Forum: General
Topic: When are we going to see 0.12.0?
Replies: 14
Views: 17353

Re: When are we going to see 0.12.0?

And LuaJIT 2.1? I saw that mentioned, and it's a feature that I am eager to get, because it should support trace stitching (meaning that loops containing calls to Löve functions or calls to NYI stuff will no longer prevent JIT compilation).
by pgimeno
Fri Feb 05, 2021 12:16 pm
Forum: Libraries and Tools
Topic: Objective Lua - additional syntax to original Lua!
Replies: 26
Views: 21872

Re: Objective Lua - additional syntax to original Lua!

I've tried your example, but since I generally need to use 'dt' in the update function, I added it as a parameter in Main.olua; as a result, the update function no longer existed. Looking at the parsed result, it had created a function called dt, instead of update. The parser does not handle strings...