emscripten Humble Cloud interface
Edward Rudd
2014-08-21 fecd0b5f82724a66814455a15b3b762cc53d148e

add "simple" implementation of asset remapping

3 files modified
15 ■■■■■ changed files
client/library/humble_api.h 2 ●●●●● patch | view | raw | blame | history
client/library/library_humble.js 7 ●●●●● patch | view | raw | blame | history
client/test/main.cpp 6 ●●●●● patch | view | raw | blame | history
client/library/humble_api.h
@@ -9,6 +9,8 @@
    void humble_sync();
    char *humble_get_url_for_asset(const char* assetPath);
#ifdef __cplusplus
};
#endif
client/library/library_humble.js
@@ -7,6 +7,13 @@
        FS.syncfs(function (err) {
            console.log('File Sync');
        });
    },
    humble_get_url_for_asset: function(assetPath) {
        var path = Pointer_stringify(assetPath);
        var url = 'http://localhost/test/' + path;
        var ret = allocate(intArrayFromString(url), 'i8', ALLOC_NORMAL);
        return ret;
    }
};
client/test/main.cpp
@@ -52,5 +52,11 @@
    // call dummy function to init cloud
    humble_init();
    // Test humble_get_url_for_asset
    char * path = humble_get_url_for_asset("textures/icon1.png");
    std::cout << "humble_get_url_for_asset returned " << path << "\n";
    free(path);
    return 0;
}