I managed to compile the thing, though it’s not working with the font I’d normally use.
The issues I had:
- SDL include headers need to be in root directory, since the default SDL2/sdl.h doesn’t work
- SDL package needs to be i686-w64-mingw32 and NOT x86_64-w64-mingw32
- zlib1.dll conflicts with MinGW version of the library, so you have to pull the one in the SDL package in the root directory of the game. Otherwise the game will crash.
- Compiled successfully with make NATIVE=win32 TILES=1 RELEASE=1
Anyway. Blending the tiles function with the one used for the rest of the UI wouldn’t work. Because the point here is to draw the graphic window with a different size than normal text. So if we use the normal text to fill the gaps of the graphic window we just don’t respect the cell size.
So, code-wise, what we should do is load up TWO .png and use the other one only when needed for the ASCI fallback. So, ideally, I’d simply duplicate the functions that load one tileset. And then manually override the draw function to use the second tileset only in those cases where a sprite isn’t available.
I know very little C++, even less figuring out someone else’s code.
Right now I have:
sdltiles.cpp
cata_tiles *tilecontext;
cata_tiles *tilecontext2;
So we have two pointers.
under curses_init I added:
tilecontext2 = new cata_tiles(renderer);
So again duplicating the memory content. We have two pointers pointing to two different memory spaces.
Then the next instruction seems to be:
tilecontext->init(“gfx”);
The init function is in cata_tiles.cpp and it calls:
get_tile_information(load_file_path, json_path, tileset_path);
I think that what happens in that function is only about storing the right paths. Then:
load_tileset(tileset_path);
This handles first a tile_atlas, that is part of the cata_tiles object, so if the plan is to duplicate the tileset then I don’t need to change anything here, since both tilesets will have their respective tile_atlas.
So what I did was create an init2 duplicate function that simply initializes a different .png
Up to this point it compiles:
Could not locate tileset file at gfx/HoderTileset/hellobeta.png
I guess I’ll continue tomorrow.