@jeana somewhere in pokittolib there is macros for min max messing up with std::min
and std::max
i always fix it like this
#ifdef max
#undef max
#endif
#ifdef min
#undef min
#endif
#include <vector>
@jeana somewhere in pokittolib there is macros for min max messing up with std::min
and std::max
i always fix it like this
#ifdef max
#undef max
#endif
#ifdef min
#undef min
#endif
#include <vector>
Can’t you just include vector first, then include the pokittolib?
sure, you can.
Ah, I know this one. It’s been bugging me for quite some time.
The ‘proper’ way to solve it is to add this before you #include <Pokitto.h>
:
#if !defined(DISABLEAVRMIN)
#define DISABLEAVRMIN
#endif
(Or perhaps add DISABLEAVRMIN
to your compiler’s defines, wherever the settings for that may be.)
It’s because the Pokitto does a few things to try to simulate an Arduino environment,
and one of those things is to define min
and max
as macros.
Needless to say that’s a horrible idea because it poisons the global scope,
which stops std::min
and std::max
from working properly.
std::min
and std::max
are vastly superior implementations anyway.
Thanks, Why is this the default behavior?
The library seems to be kind of a mess
That’s pretty much what I said when I found out. :P
I honestly have no idea, I’ve only made a few small contributions to the library.
It is a little bit. We’ve been discussing ways to fix it for a while but it tends to fall to the wayside because of other projects.
There’s a discussion about it here:
And it’s been brought up a few times in a few other threads.
If you want I could show you the prototype I mentioned earlier,
but it’s pretty bare bones and isn’t actually usable.
I’m reasonable experienced with API design, but I struggle with hardware details.
I still can’t wrap my head around how to manipulate the screen (using the low-level screen stuff, not using Display
).
Put this in your main.js
:
function boot(){
try{
let width = (localStorage.getItem("width")|0) || 800;
let height = (localStorage.getItem("height")|0) || 600;
nw.Window.open('www/index.html', {width, height}, win=>{
win.on("close", _=>{
width = win.width;
height = win.height;
localStorage.setItem("width", width);
localStorage.setItem("height", height);
win.close(true);
});
});
}catch(ex){
console.log(ex);
}
}
nw.App.on('open', (...args)=>{
boot();
});
nw.Window.open("www/splash.jpg", {
width:690,
height:350,
position:"center",
frame:false
}, splash =>{
setTimeout(_=>{
boot();
splash.close(true);
}, 1000);
});
OMG your the best!
Changelog:
Ctrl+,
and Ctrl+.
Edit: Updated the zips, the release script had undone some of the changes in the update as part of the clean-up it does before packaging. >_<
Great news for the JS scripting per project!
I should really port and expand the tiled map exported I made in python.
That would be awesome and handy for the compo.
I suspect I won’t make it in time for the compo : /
I just noticed there’s a minor bug and will try to upload a new release tonight.
When you copy+paste, the clipboard gets pasted twice.
For now, in your config.js file, remove these bindings:
"C-c": APP.copy,
"C-x": APP.cut,
"C-v": APP.paste,
I just tried out FemtoIDE (running GalliumOS, a Linux distro), and I’m having an issue with the bundled emulator. I can compile the Java demo, but I get this error when it tries to run the emulator:
/home/username/bin/FemtoIDE/IDE-linux-v0.0.15b/linux/PokittoEmu: /usr/lib/x86_64-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.22’ not found (required by /home/username/bin/FemtoIDE/IDE-linux-v0.0.15b/linux/PokittoEmu)
I assume my system’s libc++ version is too old? I have encountered this problem before on a different old linux distro, but in that case I might have had to recompile the software. I do have a version of the emulator that I have compiled that works fine, and I ran the compiled .bin separately from the IDE with no problems. Should I just replace the IDE’s version of the PokittoEmu with mine for now, or is there a way to change the path for the emulator?
I faced the same problem with lxle (a Debian distro)
I fixed using this commands to update the tool chain.
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-get install gcc-4.9
sudo apt-get upgrade libstdc++6
From the wiki
Hi! So I started using Femto in order to make a tiny game rush, related with the Java comp. It’s… honestly a bit disturbing, but as long as it builds it’s fine by me haha
I created two sprites without any animation in Aseprite and exported them with JSON. But they’re rendered completely messed up, slanted and all. Doesn’t seem like to be a palette issue, but a calculation gone wrong.
Original sprite with json:
Limb2.json (589 Bytes)
Any idea about what I got wrong?
First time I’ve seen it do that. Can you attach the zipped project folder?
I can’t right now, will do as soon as I get back to my place;
In the meanwhile … I pretty much replaced the dog by this sprite, changed the text and removed the background, from the “new project”. The dog was behaving correctly - it’s a good boy after all, unlike those dead limbs.
edit: also I did a screen.clear(0);
I actually witnessed a similar thing yesterday. I don’t know how I fixed it but eventually after monkeying with the Sprite itself it suddenly worked.
Did you make sure to do an animation tag even though there isn’t one? Like idle
or something?
Indeed, that worked like a charm. I can now see that limb doing rounds.
To be more specific, in order to make Sprite work properly, you HAVE to call an animation method, otherwise something won’t be initialized inside and it will glitch.
Thanks a lot!