Page 1 of 1

[idea] Graphics

Posted: Tue Jun 09, 2020 4:59 pm
by jezek
Hello I had an idea, to make the usage of bitmap graphics in TomeNET work.

Some work was done and the result is a use_graphics branch in my TomeNET fork. Right now working graphics support can be compiled only for Linux with X11. There are 3 commits, which group changes made in different areas. Every commit has more detailed explanation of what was done in description.

To test I've also drawn some tiles.

Feel free to test & contribute.
Also some feedback would be helpful, what has to be done to merge with upstrem.
Have fun and a nice day.

Re: [idea] Graphics

Posted: Wed Jun 10, 2020 4:41 pm
by Faraday
Wow, that's awesome!

What problems with compiling for Windows?

How this idea can be helped?

Re: [idea] Graphics

Posted: Thu Jun 11, 2020 4:31 pm
by jezek
Faraday wrote: Wed Jun 10, 2020 4:41 pm What problems with compiling for Windows?
How this idea can be helped?
I have no Windows, only Linux. This project uses different window (keyboard, events) handling libraries for different OS. The documentation says, that the latest clients can be build for Linux, Windows and Mac. For each platform there is a different file that needs to be edited. I did so only for the Linux file. To be able to make this work on other platform (eg. Windows), someone who has the right skills and means, has to make the same adjustments to the platform file, using libraries for the platform.

And that is the biggest disadvantage with this approach. Every platform dependent change has to be replicated to other platform files. And in some time the clients for each platform will become slightly different and non-consistent.

My idea was to test the new graphics implementation on Linux using X11 library (I had previous experience with X11) and if it is likeable, rewrite it using some opensource multiplatform graphics (keyboard, sound, ...) library. My eyes are on SDL2 library right now. The SDL2 client, should be buildable on Linux, Windows, Mac and even Android with the same code. The project could use only one code to rule them all ;)

What are the maintainers's thoughts on this graphics approach and on the SDL2 client?

Re: [idea] Graphics

Posted: Tue Jun 23, 2020 9:43 pm
by mikaelh
Interesting work. I'll need to test it when I have more time.

Windows client runs just fine under Wine so you don't actually needs Windows for anything. That's what me and C. Blue do most of the time anyway. Just install the MinGW-w64 cross compiler. There's a separate makefile.mingw for cross compiling the Windows client on Linux. I wrote some instructions on how to install SDL so that you can compile with sound support.

I think using 32 bit characters makes sense. Plenty of room for a big tileset. Also unicode characters can possibly get stuffed in there somehow. A possible concern is how much extra bandwidth the 32 bit characters use.

As for the SDL2 client... If you can make it work, I'd say it's welcome.

Re: [idea] Graphics

Posted: Thu Jun 25, 2020 5:00 pm
by jezek
Thank you for reply.

I will try the mingw + wine approach for windows client, next time I will have some spare time.

I thought about unicode, when designing tiles support. It's definitely doable, got already vision how to, currently it's planned after win client.

The sdl2 will be my next goal after the previous 2 are completed.

Happy testing in meantime. One thing interests me is speed of drawing. On my 10 years old laptop (Toshiba M750), it's a little bit slow, if redrawing the whole screen, if everything is explored and scrolling occurs. I would like to know, if the redraw speed is bearable on newer/other computers.

Thanks again and I will post if I have something new.