ManaPlus
Static Public Member Functions | Data Fields
ImageSetLoader Struct Reference

Static Public Member Functions

static Resourceload (const void *const v)
 

Data Fields

const std::string path
 
const int w
 
const int h
 

Detailed Description

Definition at line 38 of file imagesetloader.cpp.

Member Function Documentation

◆ load()

static Resource* ImageSetLoader::load ( const void *const  v)
inlinestatic

Definition at line 46 of file imagesetloader.cpp.

47  {
48  if (v == nullptr)
49  return nullptr;
50 
51  const ImageSetLoader *const
52  rl = static_cast<const ImageSetLoader *>(v);
53 
54  Image *const img = Loader::getImage(rl->path);
55  if (img == nullptr)
56  {
57  reportAlways("Image loading error: %s", rl->path.c_str())
58  return nullptr;
59  }
60  ImageSet *const res = new ImageSet(img, rl->w, rl->h, 0, 0);
61  img->decRef();
62  return res;
63  }
#define reportAlways(...)
Definition: checkutils.h:253
#define new
Definition: debug_new.h:147
Image * getImage(const std::string &idPath)
Definition: imageloader.cpp:86
const std::string path

References Loader::getImage(), h, path, reportAlways, and w.

Referenced by Loader::getImageSet().

Field Documentation

◆ h

const int ImageSetLoader::h

Definition at line 42 of file imagesetloader.cpp.

Referenced by load().

◆ path

const std::string ImageSetLoader::path

Definition at line 40 of file imagesetloader.cpp.

Referenced by load().

◆ w

const int ImageSetLoader::w

Definition at line 41 of file imagesetloader.cpp.

Referenced by load().


The documentation for this struct was generated from the following file: