graphics.cpp:Rasmus wrote:I also have a question to anyone that have been digging inside the CSBWin code..
I want as much original graphic as posible in the game.. The roof and floor have to be taken from elsewhere, but almost all other graphic can be used..
So at the start I want to load and convert all the graphic into bitmaps for opengl to use when rendering the 3D dungeon..
Do anyone know a good starting point on how to get all the graphic addresses?
void ReadGraphic(i16 graphicNumber, pnt buffer, i32 maxSize) // TAG021af2
BUT - graphics are loaded when needed and not already cached.
Next problem is, the datastructures to control the cache are simply evil and not handable in C++, because they do have variable size. In some situations they even target the graphics-structure n+1 instead of n and seek back some bytes for the datas at the end of graphics-structure n - that's really pretty dirty. Maybe make a second layout (like I did - with never deleting a graphic anymore once loaded - assuming we got a lot of memory nowadays).
Get http://www.akluwi.de/dmcsb/src/rasmus3.zip for my latest working truecolor/hires-versions and study gfx.cpp. All graphics are included as png-files as well (without masks!).
You may also take a look into draw.cpp how I patched all those drawing routines.
in most cases my routines got a reference to the original DM-label like L_012345 (at least in the header-files). You'll also find a file syn2.cpp in the common-folder. There you find the corresponding T_98765-label of CSB - and if you then search in CSBwin for TAG98765, you'll find the original there.