Save
Saving
  • M
    mundusnine

    Ok yeah it's clear now. So kha doesn't use Electron file saving but the Mozilla localStorage API when we are in HTML5. That storage API literally saves a json file somewhere with the data that we tell it to store.

    posted in Kode read more
  • M
    mundusnine

    Following what is said here:

    - Mac OS: ~/Library/Application Support/<Your App Name (taken from the name property in package.json)>
    
    - Windows: C:\Users\<you>\AppData\Local\<Your App Name>
    
    - Linux: ~/.config/<Your App Name> 
    

    On my linux machine I found KodeStudio-Debug in the .config folder but the image I am trying to store doesn't seem to be written there in the Local Storage. I am doing an http request and my image data seems sane(i.e. I see the PNG id and the adobe software notice that probably comes from photoshop).

    posted in Kode read more
  • M
    mundusnine

    @robert. Oh ok good to know. Actually, I should of shared a better resolution image but yes I tried adding a breakpoint in the krom.js file and in my haxe file. That's what the image showed. The breakpoint is in the initialization, that shouldn't have any impact but I will try adding it in the update.

    posted in Kode read more
  • M
    mundusnine

    @robert For the debug argument it's per khamake option definition. If I am not mistaken it enables the creation of the krom.js.temp file for debugging. Without that option the krom.js.temp wasn't generated. Good to know for the addresse. CL = command-line. When I set the breakpoints in the krom.js file the debugger still doesn't break. The debugger seems connected(ie the kodestudio window is changed to the debug theme, the bottom is orange). I get output from the debug console so probably.alt text

    posted in Kode read more
  • M
    mundusnine

    First part:

    @robert So after a bit of debugging I found out that the executed task when having default launch for krom is :

    > Executing task: /home/jsnadeau/Documents/KodeStudio/kodestudio --khamake /home/jsnadeau/Documents/projects/Test/Kha/make.js krom <
    

    But since we want to debug we need the krom.js.temp.map but with above command we get

    (node:8803) UnhandledPromiseRejectionWarning: Unhandled promise
    rejection (rejection id: 1): Error: ENOENT: no such file or directory, open
    '/home/jsnadeau/Documents/projects/Test/build
    krom/krom.js.temp.map'(node:8803) [DEP0018] DeprecationWarning:
    Unhandled promise rejections are deprecated. In the future, promise
    rejections that are not handled will terminate the Node.js process with a non-zero exit code.
    

    So to fix the first issue of Krom not connecting we should have something like:

    "command": "node Kha/make --debug -t krom",
    

    But this is with a git cloned workspace version of Kha; I tried using Kha from KodeStudio but I always had issues because there is apparently no --debug argument. When trying the solution the CL gives me ie --inspect I now have an issue with the Starting inspector on 127.0.0.1:9229 failed: address already in use so using the Kha version of KodeStudio(on linux at least) doesn't seems to work.

    Second part:

    When I get Krom running with the git cloned workspace version of Kha the issue is that breakpoints don't get activated while debugging.

    posted in Kode read more
  • M
    mundusnine

    So there is a vscode extension to be able to debug with Krom. I can't find how to make it work with the launch.json >

    {
                "type": "krom",
                "request": "launch",
                "name": "Kha: Krom",
                "preLaunchTask": "Kha: Build for Krom"
            }
    

    Is this all that is needed to debug when you have the extensions ? If so I can't get it to work on linux Ubuntu 18.04. I am using the latest KodeStudio i.e the one from november. Kha is in my project path. Using haxe 4.0.0-rc.1. I tried with the most recent vscode.

    posted in Kode read more
  • M
    mundusnine

    @robert I realised why things where not working.I thought that Kha used Kore as it's backend for audio but now I know that for audio everything is implemented in kha. Is Kha totally seperate from Kore ? I thought that some part of the framework used Kore to inject some c/cpp code as we can do that with hxcpp.

    posted in Kode read more
  • M
    mundusnine

    How does one know if the right version of Kha is used when testing new functionnalities implemented in Kha?

    Also how does Kha interact with Kore?

    posted in Kode read more
  • M
    mundusnine

    I don't know if this would be desired in Kore but FFT would be useful for some types of applications and I found a tiny FFT implementation that maybe could be used.

    posted in Kode read more
  • M
    mundusnine

    Here be bash script:

    #!/bin/bash
    file="$HOME/.local/share/applications/Kodestudio.desktop"
    dir="$(dirname $0)/"
    echo "Creating shortcut for Kodestudio"
    if [ -e $file ]; then
      echo "Symlink of $dir already exists!"
    else
        sudo echo "#!/usr/bin/env xdg-open
        [Desktop Entry]
        Version=1.0
        Type=Application
        Terminal=false
        Exec=$dir/kodestudio
        Name=Kodestudio
        Comment=Kodestudio
        Icon=$dir/resources/app/resources/linux/code.png" >> "$HOME/Kodestudio.desktop"
        sudo mv "$HOME/Kodestudio.desktop" $file
        touch "$HOME/kode"
        echo "#!/bin/bash
        $dir/kodestudio"  >>"$HOME/kode"
        sudo mv "$HOME/kode" "/sbin/kode"
        sudo chmod +x "/sbin/kode"
        sudo chmod +x $file
    fi
    

    Adds shortcuts in terminal and on the gnome desktop.

    In terminal or on alt-f2 write kode.

    In the desktop search:
    0_1543340450565_image3791.png

    posted in Kode read more