Jump to content


Photo

Commandos BTCOD with PNG loading


  • Please log in to reply
4 replies to this topic

#1 malik_cjm

malik_cjm
  • Members
  • 40 posts

Posted 16 March 2025 - 08:47 PM

Hi,

 

Recently I was playing with my old BTCOD mod.

I found a way to load and display images in PNG format using SDL2 and SDL2_image libraries.

As a test I just converted one of the COMMANOD CBM00000.png animation frames to PNG image and displayed it on top.

CommandosBTCOD_png_loading_test.jpg  

 

 

Next on my list it to convert WAD file to series of PNG files and try to use it in the game engine.

I already found what needs to be modified, just need to double check if it will not crash the game engine. 

 

Do you have any ideas how loading resources PNG format might be used?

 

 

I was also playing with adding scaling possibility to the game engine.

For now I can control size of each part of the game window separately.

CommandosBTCOD_custom_size_for_one_view.jpg

 

My idea is to force map view to draw to separate buffer then scale this buffer and draw it in the game windows.  


Edited by malik_cjm, 16 March 2025 - 09:06 PM.


#2 Jeroen

Jeroen
  • Members
  • 239 posts
  • Location:Noord-Brabant
  • Projects:Commandos BEL är bara smörja.

Posted 18 March 2025 - 10:48 AM

Good stuff! I use Allegro myself. Attached is a spritesheet have, I do animations with that. Good luck with the environments that's more difficult.

 

Attached Thumbnails

  • comando-sprite-sheet.png

Edited by Jeroen, 18 March 2025 - 10:49 AM.


#3 malik_cjm

malik_cjm
  • Members
  • 40 posts

Posted 22 March 2025 - 10:57 PM

Short update. I was able to redirect rendering commandos view to separate buffer and scale it with XBR algorithm.

To be able to compare result with original I'm rendering scaled version in separate window.

 

commandos_orig.png

 

commandos_XBRx2_new.png

 



#4 wyel2000

wyel2000
  • Members
  • 232 posts

Posted 25 March 2025 - 03:04 PM

good job   :thumbsupcool:

Short update. I was able to redirect rendering commandos view to separate buffer and scale it with XBR algorithm.

To be able to compare result with original I'm rendering scaled version in separate window.

 

attachicon.gif commandos_orig.png

 

attachicon.gif commandos_XBRx2_new.png



#5 malik_cjm

malik_cjm
  • Members
  • 40 posts

Posted 28 March 2025 - 10:50 PM

Another small update on the progress.

I switched to different scaling algorithm called scale2x (https://www.scale2x.it/)

XBR algorithm slowing game down. There is a possibility to use multiple cpu core if available, but this is for the future.

Game window resize triggers 2x scaling if view width is bigger that 800 pixels.

 

commandos_scale2x_in_game_window.png






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users