Search found 497 matches

by grump
Mon Feb 18, 2019 10:15 am
Forum: Support and Development
Topic: Converting imageData:getPixel() numbers to the 0-255 range
Replies: 2
Views: 212

Re: Converting imageData:getPixel() numbers to the 0-255 range

math.floor(c * 255 +.5) should do the trick. Or use cindy . Either call require('cindy').applyPatch() to have the old behavior restored in all relevant functions, or use the provided *Bytes alternatives. function converter:imagetomap(img) local pixelData = {} local function map(x, y, r, g, b, a) pi...
by grump
Tue Feb 12, 2019 5:03 pm
Forum: General
Topic: [HELP] (breakout clone) powered up big ball doesn't remove several bricks at once
Replies: 2
Views: 261

Re: [HELP] (breakout clone) powered up big ball doesn't remove several bricks at once

When you remove table entries in a loop like this, entries will be skipped. The simplest solution is to iterate backwards over the bricks when your remove them.
by grump
Tue Feb 12, 2019 8:13 am
Forum: Support and Development
Topic: Class Best Practices
Replies: 16
Views: 1694

Re: Class Best Practices

@grump - I did this and my sort time went down by 30x!!! :crazy: This is just normal insertion sort :)! That combined with spreading my offscreen zombie updates evenly between frames rather than ever 1/5 seconds resulted in a fps increase of upto 75 fps on top of what I had!!! Nice! Now I just have...
by grump
Sun Feb 10, 2019 9:44 am
Forum: Support and Development
Topic: Love-imgui canvas render acting strange on focus
Replies: 1
Views: 615

Re: Love-imgui canvas render acting strange on focus

Sounds like something sets a blendmode but fails to restore the previous one.
by grump
Sun Feb 10, 2019 9:41 am
Forum: Libraries and Tools
Topic: A little library for convert colors
Replies: 5
Views: 524

Re: A little library for convert colors

To be fair, this one does different things from mine - mine is (on purpose) only concerned with value ranges and function patching, not so much with different color representations. In addition to ivan's remarks, I would expect that all components are to be given in the same value range. It makes li...
by grump
Fri Feb 08, 2019 3:08 pm
Forum: General
Topic: How to reverse a picture from right to left??
Replies: 3
Views: 316

Re: How to reverse a picture from right to left??

You also need to adjust the X offset to keep it at its position when you mirror it. If you only want to flip the cannon part, you can create two quads: one that covers the upper part with the cannon, and another one for the rest of the image. Then draw the first quad like described above, and the se...
by grump
Fri Feb 08, 2019 12:05 pm
Forum: Support and Development
Topic: [SOLVED] Simple save/load game system using .txt files?
Replies: 1
Views: 316

Re: Simple save/load game system using .txt files?

What is table.show? Why do you call saveGame() when you want to load a game? To get better answers, post a love file with the entire code. Your code will only work in Windows (because of mkdir Games). There's also the danger that the Games directory is created in a random location, if you didn't mak...
by grump
Wed Jan 30, 2019 6:06 am
Forum: Libraries and Tools
Topic: Blob.lua - binary serialization library
Replies: 16
Views: 6034

Re: Blob.lua - binary serialization library

Thanks! Yeah, vector support is really needed since serialization is used for saving objects. You can implement object saving without explicit ctype support if you use one of the methods I have shown in the previous comment. Doing it automatically has proven somewhat difficult , so I'd need to writ...
by grump
Tue Jan 29, 2019 4:43 pm
Forum: Support and Development
Topic: [SOLVED]love.physics world performance
Replies: 11
Views: 908

Re: love.physics world performance

Sure, but I was already used to using a third of that memory But you've also gained full-fledged physics simulation. and I thought that sleeping bodies and deactivate would lower memory usage. Deactivating bodies does not remove them from memory. You have to destroy them completely and force a GC c...
by grump
Tue Jan 29, 2019 4:10 pm
Forum: Support and Development
Topic: [SOLVED]love.physics world performance
Replies: 11
Views: 908

Re: love.physics world performance

150 kb is not "a lot of memory".