try using the new function pointer.

develop
Japa 2018-01-25 11:55:46 +05:30
parent 68324dfe0b
commit f1b8fa305b
2 changed files with 16 additions and 7 deletions

@ -1 +1 @@
Subproject commit f0c609211fbfd354b576cae75e9e64f8c6c80b06
Subproject commit 618db6349ece5827d371a60b0fac1066b1d7989b

@ -104,13 +104,22 @@ void CopyImage(const df::art_image * image, ArtImage * netImage)
void CopyImage(df::art_image_ref imageRef, ArtImage * netImage)
{
for (int i = 0; i < world->art_image_chunks.size(); i++)
if (df::global::getArtImage)
{
auto chunk = world->art_image_chunks[i];
if (chunk->id != imageRef.id)
continue;
auto image = chunk->images[imageRef.subid];
CopyImage(image, netImage);
df::art_image * (*getImage)(df::art_image_ref *, int *) = (df::art_image * (*)(df::art_image_ref *, int *))df::global::getArtImage;
int subid = -1;
CopyImage(getImage(&imageRef, &subid), netImage);
}
else
{
for (int i = 0; i < world->art_image_chunks.size(); i++)
{
auto chunk = world->art_image_chunks[i];
if (chunk->id != imageRef.id)
continue;
auto image = chunk->images[imageRef.subid];
CopyImage(image, netImage);
}
}
}