add "simple" implementation of asset remapping
| | |
| | | |
| | | void humble_sync(); |
| | | |
| | | char *humble_get_url_for_asset(const char* assetPath); |
| | | |
| | | #ifdef __cplusplus |
| | | }; |
| | | #endif |
| | |
| | | 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; |
| | | } |
| | | }; |
| | | |
| | |
| | | // 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; |
| | | } |