Forum Replies Created
-
AuthorPosts
-
For a simple fix, try running your loading code on a fiber and calling this after each ‘LoadImage’ etc…
Monkey12345678910Function Yield()Local future:=New Future<Bool>App.Idle+=Lambda()future.Set( True )Endfuture.Get()EndThe key thing about fibers is that they’re *not* threads – if one fiber blocks, everything blocks, so a simple Repeat…Forever will hang the entire app.
You can’t asynchronously load stuff yet.
The ted2 ‘building’ process works because there is some native code behind the scenes of the Process class that effectively runs mc2cc on a different thread. But there is nothing like that for loading images etc yet.
It shouldn’t be too hard to do though, the only catch being that the loaders will need to run on a fiber.
Yes, that “Flush!” shouldn’t be there either – try removing it from canvas.monkey2.
Ok, think I’ve fixed the color problem. Haven’t updated github yet though, other stuff currently in progress.
The debug slowdown is a bit weirder, although the new version is doing more ‘validation’ (in order to reduce rendering) so it might be that.
A quick fix might be to set the emscripten optimization options in env_windows.txt (or whatever) to -02. It’s currently -O0 which means no optimizations, but I only changed it to this from -O2 a while back to test something so it should be -O2 anyway.
After this, you’ll need to rebuild all emscripten modules and delete your .build dir before rebuilding. Speeds things up considerably here.
Am loving this game too!
That would look great with some bumpmapping I think, not that it doesn’t look great already!
You’d just have to bumpmap the backdrop and use AddLight instead of DrawImage for the slowly rotating light/shadow image. Maybe set LightDepth quite high too.
Source code?
September 30, 2016 at 8:29 pm in reply to: [SOLVED in 1.07] Error on Mac -> Rebuild Modules – > Android -> Truetype #4186> BTW: Ted2 MacOS does not let me copy text from the build window, that would be nice to have.
It does (well on windows…) but you have to use the edit->copy menu.
It’s good practice to write these yourself at least once in your career I think!
Monkey12345678910111213#import "<std>"Using std.stringioFunction Main()Print ULongToString( 26,16 )Print ULongToString( 5,2 )Print StringToULong( "1aA",16 )Print StringToULong( "10001",2)EndSeptember 30, 2016 at 5:36 am in reply to: #Import "assets/something" why import lines for this ? #4165I did like the way MX1 handle this with use of a path to the data folder ala. monkey://data/.
The mx2 system works pretty much the same way. Any asset files you #import are copied into the apps ‘data’ folder (just like mx1’s blah.data dir) and using “asset::blah…” as a file path will load an asset at runtime.
You can replicate mx1 exactly-ish by using #Import “myapp.data/” or whatever at the top of your code. The trailing ‘/’ means to copy the whole dir. You can then use “asset::” to load these assets at runtime.
I think you’re probably after ‘AppDir()’, ie: the dir the application is in.
CurrentDir() can be changed with ChangeDir() and is the base dir for relative file names.
CurrentDir() will be different at startup depending on how the app was launched, eg: via console or desktop etc.
September 29, 2016 at 8:30 pm in reply to: #Import "assets/something" why import lines for this ? #4161In other words, what is the best path to save files so it works on all clients devices/desktop
These need to be added…
Do you have a CDROM on D:?
Can you try deleting this line from your env_windows.txt file?
PATH=D:\devtools\Android\sdk\ndk-bundle;${PATH}
There’s a bunch more errors in the command prompt. Do you need me to list them all?
Yes please.
Have you got mingw ‘i686-5.3.0-posix-dwarf-rt_v4-rev0’ installed in ‘devtools’?
Have you messed with the ‘bin/env_windows.txt’ file at all?
Yes, unless the class has no ctors at all in which case it gets a default ctor ‘for free’.
But as soon as you provide at least one ctor, then only the ctors you provide are available.
-
AuthorPosts