Update 62

After finishing to colorized a map I have realized that the map was only a small part of a bigger drawing. And I need to color everything because  the big view is also used in the game for another map.

It takes a lot of hours to colors 1920*1080 picture with lots of small things, so the tree is not finished. There are so many leaves, I am trying to have the same texture but with a pencil.

treepic

I have a bigger picture than this, so it’s easy to see the leaves but also time-consuming.

I have also retried emscripten to see if the library has progressed.

So I want to import Jpeg I have to port libjpeg and modify SDL2_image, I have already spent two weeks on SDL and Emscripten to find out the library is not yet mature.

I have changed libraries so I do not use SDL_images, I directly load the image with SDL_gpu which use stbi_image for the loading. The compilation of SDL_gpu is complete. After a small display test, it’s working fine with OpenGL ES2. I can port the game with emscripten now but there is a major downside compared to pixijs.

There are two alternatives for how files are packaged: preloading and embedding. Embedding puts the specified files inside the generated JavaScript, while preloading packages the files separately. Embedding files is much less efficient than preloading and should only be used when packaging small numbers of small files.

So the best way is to preload right? I have 60mb of resources files for the demo, so preloading seem not very efficient the person will wait maybe 10 min and it will take a lot of memory. With pixijs I can load on the fly the textures in OpenGL without having the preload all the files. There is a way to load async data with emscripten : emscripten_async_wget. So I have to change the loading system of the game to use emscripten functions, the point of emscripten is to port the c++ game without having to redo a lot of work. I have ported the demo for pixijs so I know what it means to change most of the things to make it work. The code with pixijs is cleaner because the code is already in javascript.

Note : Use emscripten when you can preload the data without having to pay a big price. If not use port the game in javascript with a good library.

Leave a Reply

Your email address will not be published. Required fields are marked *