1
0

SkinBitmapElement.cpp 854 B

12345678910111213141516171819202122232425262728
  1. #include "api.h"
  2. #include "SkinBitmapElement.h"
  3. #include "PaletteManager.h"
  4. SkinBitmapElement::SkinBitmapElement(const wchar_t *_id, const wchar_t *_filename, const wchar_t *_rootpath, int _x, int _y, int _w, int _h, ifc_xmlreaderparams *pars, int script_id, int secondarycounter, const wchar_t *colorgrp)
  5. : filename(_filename), rootpath(_rootpath), x(_x), y(_y), w(_w), h(_h),
  6. scriptid(script_id), seccount(secondarycounter), colorgroup(colorgrp),
  7. region(NULL)
  8. {
  9. id = _id;
  10. if (pars)
  11. {
  12. for (size_t i = 0;i != pars->getNbItems();i++)
  13. params.addItem(pars->getItemName(i), pars->getItemValue(i));
  14. }
  15. }
  16. SkinBitmapElement::~SkinBitmapElement()
  17. {
  18. if (region != NULL) WASABI_API_PALETTE->garbageCollectRegionServer(region);
  19. region = NULL;
  20. }
  21. SkinItem *SkinBitmapElement::getAncestor()
  22. {
  23. return WASABI_API_PALETTE->getBitmapAncestor(this);
  24. }