Search found 5 matches

by DataBrain
Sat Jul 04, 2015 5:02 pm
Forum: Support and Development
Topic: Attempt to yield across C-call boundary
Replies: 2
Views: 3017

Re: Attempt to yield across C-call boundary

move the require outside of the coroutine, save its result into a local, then call that result from inside the coroutine instead Thank you. This works perfectly. I rewrote the require script to wait for the main thread to require the script on love.update, then resume it with the required variable ...
by DataBrain
Sat Jul 04, 2015 2:24 pm
Forum: Support and Development
Topic: Attempt to yield across C-call boundary
Replies: 2
Views: 3017

Attempt to yield across C-call boundary

So I'm trying to make a global function _G.wait(sTime), and it does the same thing as love.timer.sleep, only it will hault the current thread running rather than the whole window. This allows my to yield the main thread, but not love.draw or love.update. Here's what's going on: _G.GlobalData = {} Ma...
by DataBrain
Sat Jul 04, 2015 1:58 pm
Forum: Support and Development
Topic: [SOLVED] Yo dawg I heard you like coroutines
Replies: 2
Views: 2290

Re: Yo dawg I heard you like coroutines

Can you post an example of how your code looked when it was overflowing the call stack? There are probably better options than coroutines for avoiding that. Might be best to restructure things so you're not using so much recursion, but you could also probably do something simple like taking advanta...
by DataBrain
Sat Jul 04, 2015 1:43 am
Forum: Support and Development
Topic: Fast grid drawing
Replies: 7
Views: 5473

Re: Fast grid drawing

love.draw will always clear the render every time at the beginning of its call. I'm not sure what you can do to optimize all of this if it's on-screen. If most squares are off-screen (Which appears to be the case), I would recommend that you simply procedurally generating these squares in the grid r...
by DataBrain
Sat Jul 04, 2015 1:04 am
Forum: Support and Development
Topic: [SOLVED] Yo dawg I heard you like coroutines
Replies: 2
Views: 2290

[SOLVED] Yo dawg I heard you like coroutines

Hey, so the current system I'm using for my game runs basically everything on nested coroutines to avoid stack overflow and such. This is code that I put in main.lua, which is called by other scripts which are being required by this script: _G.GlobalData = {} local CurrentLevel local QueueLevel -- T...