Author Topic: Need help to understand the code  (Read 2392 times)

Offline Callahan

  • Captain
  • ***
  • Posts: 61
    • View Profile
Need help to understand the code
« on: April 07, 2018, 10:54:42 pm »
So, after I got a lot of help from all sides, I am capable of compiling on my ancient PC.
Now my major problem is to understand what I read in those CPPs.

I worked last on "Jagged Alliance 2" code and thought I could adapt to the new code format, but I am mostly only confused over all those arrays and variable names. Maybe because I am new to the OXC code (preferred) or cause I'm a bit dumb.

What I want to achieve is that all "extrasprites" are not loaded on program start, but only when they are about to be blitted and the surface has not been loaded yet.
So I would be happy for any help to make me understand what is done at image loading and blitting and how to accomplish my goal.

I've taken a look at "void Mod::loadExtraResources()". The loading of surfaces is done into "_surfaces[sheetName]"
I assume "sheetname" is the -type field of a dataset and the properties and path being "i->second"
Is this correct?

Is there a convenient way to check for if an image has been loaded in "Surface::blitNShade" or "Surface::blit(Surface *surface)" and then load this specific image/surface inside "Surface::Blit" ?

A deeper look into the rulesets indicated that some surfaces are put together from alot of image files. So my plan of "loading on demand" will be restricted to those surfaces that are using only one image file.
« Last Edit: April 08, 2018, 12:12:22 pm by Callahan »