Tag Archives: c

FLTK tech, HICON to Fl_RGB_Image

This is a simple source code for converting Windows HICON to Fl_RGB_Image for my own customized FLTK window.

Before understanding how it works, It must be requires understanding of some Windows API like LoadImage().

API, icon_to_flrgb()

Plus, to remove Fl_RGB_Image in safe, use this.

remove_fl_rgb_image()

And, let know understand how it calls :

Sequence to convert image and apply, then discard.

remove_fl_rgb_image() may called in end of program, when it terminates or class destructor to release memory contains user allocated memory, and it is specification of FLTK 1.3.x.

openXcom save editor C++ source code.

open-xcom-infight  openXcom is a great windows application developed for everyone as an open source. Anybody can enjoy long time ago original Xcom:UFO defense in any version of Windows, specially my Windows10 with Pentium 957 really works well in low energy cost, lovely game.

But if you have any experience in legendary Xcom, it is too hard to defeat aliens, humanbeings are just like a scam in game. I know some players are plays game as like God, wow, but not me. It’s too difficult to enjoying in relaxed mind. So I just made a simple editor : Xcom soldier upgrader, it helps your openXcom save files. Simply you need set openXcom uncompressed save format and compile my source code with any version of minGW. I recommend to use mingw-w64 with Code::Blocks.

Here I sharing my simple source code in zip file. It doesn’t contains exe file. You may compile in your system.

How to it works ? Just see what made in source code, really simple. Every attribute of soldier if under 190, it automatically adjust to 190, then write it again to original save file before it back up to changing file extention to .bak.

Just compile source, and execute result exe with your save file. for example,

It’s done.

Have fun gaming, soldiers will be stronger than before, even weak aliens, but you may try to keep fighting with aliens not wounded. It never helps heal from wounded soldiers, maybe you can upgrade my simple source codes.

oxcomsavemod

* Download is free, Modifying also free, no warranty from me.

 

FLTK+MinGW+DirectX8, Joystick example

Joystick image got from Google search... Here I made an example source code with Code::Blocks+MinGW-W64+WINE project directX8 library for using joystick.

You should know this project limited to under Windows32 platform, but You can make fast faced simple game without DirectX surface, only using FLTK and Direct Input.

I recommend to using my FLTK-1.3.3-ts library for compile this example to running without strange graphic crash. (visit here: https://github.com/rageworx/fltk-1.3.3-ts )

Source code is open, you can modify, republish.

To download file, just click below. Compressed with 7z and you may need Code::Blocks and MinGW-W64. And archived library is a part of WINE project – DirectX8.

fltk_dx8_joystic_test

 

 

Printing bits from unsigned char (BYTE) in C.

Anybody knows what numbers made in our computer if you have experience in programming. But did you have try to print what ‘unsigned char’ or ‘BYTE’, 1 byte data to bits?
‘unsigned char’ and ‘BYTE’ contain a number in ranged 0 to 255 in 8 bits. 0000:0000 to 1111:1111. Every numbers made in bits, a digital switched. So I made this expression for simple C code.