Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
#include "timage.h"
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
#ifndef TNZCORE_LIGHT
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
#include "tpalette.h"
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
void TImage::setPalette(TPalette *palette) {
Shinya Kitaoka 120a6e
  if (m_palette == palette) return;
Shinya Kitaoka 120a6e
  if (palette) palette->addRef();
Shinya Kitaoka 120a6e
  if (m_palette) m_palette->release();
Shinya Kitaoka 120a6e
  m_palette = palette;
Toshihiro Shimizu 890ddd
}
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
TImage::~TImage() {
Shinya Kitaoka 120a6e
  if (m_palette) m_palette->release();
Toshihiro Shimizu 890ddd
}
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
#else
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
class TPalette {};
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
void TImage::setPalette(TPalette *palette) { assert(false); }
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
TImage::~TImage() {}
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
#endif
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//#include "tiio.h"
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
DEFINE_CLASS_CODE(TImage, 4)
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
TImage::TImage() : TSmartObject(m_classCode), m_palette(0) {}