22 #ifndef SCI_GRAPHICS_CELOBJ32_H 23 #define SCI_GRAPHICS_CELOBJ32_H 25 #include "common/rational.h" 26 #include "common/rect.h" 27 #include "sci/resource/resource.h" 28 #include "sci/engine/vm_types.h" 55 enum CelCompressionType {
56 kCelCompressionNone = 0,
57 kCelCompressionRLE = 138,
58 kCelCompressionInvalid = 1000
108 inline bool operator==(
const CelInfo32 &other) {
110 type == other.
type &&
113 celNo == other.
celNo &&
118 inline bool operator!=(
const CelInfo32 &other) {
119 return !(*
this == other);
152 #pragma mark CelScaler 203 void activateScaleTables(
const Ratio &scaleX,
const Ratio &scaleY);
210 void buildLookupTable(
int *table,
const Ratio &ratio,
const int size);
223 for (
int i = 1; i <
ARRAYSIZE(_scaleTables); ++i) {
224 _scaleTables[i] = _scaleTables[0];
231 const CelScalerTable &getScalerTable(
const Ratio &scaleX,
const Ratio &scaleY);
349 static void deinit();
394 virtual CelObj *duplicate()
const = 0;
406 virtual uint8 readPixel(
const uint16 x,
const uint16 y,
const bool mirrorX)
const;
412 void submitPalette()
const;
415 #pragma mark CelObj - Drawing 417 template<
typename MAPPER,
typename SCALER>
420 template<
typename MAPPER,
typename SCALER>
428 void scaleDrawUncomp(
Buffer &target,
const Ratio &scaleX,
const Ratio &scaleY,
const Common::Rect &targetRect,
const Common::Point &scaledPosition)
const;
434 void scaleDrawMap(
Buffer &target,
const Ratio &scaleX,
const Ratio &scaleY,
const Common::Rect &targetRect,
const Common::Point &scaledPosition)
const;
435 void scaleDrawUncompMap(
Buffer &target,
const Ratio &scaleX,
const Ratio &scaleY,
const Common::Rect &targetRect,
const Common::Point &scaledPosition)
const;
445 void scaleDrawNoMD(
Buffer &target,
const Ratio &scaleX,
const Ratio &scaleY,
const Common::Rect &targetRect,
const Common::Point &scaledPosition)
const;
446 void scaleDrawUncompNoMD(
Buffer &target,
const Ratio &scaleX,
const Ratio &scaleY,
const Common::Rect &targetRect,
const Common::Point &scaledPosition)
const;
451 #pragma mark CelObj - Caching 471 int searchCache(
const CelInfo32 &celInfo,
int *nextInsertIndex)
const;
476 void putCopyInCache(
int index)
const;
480 #pragma mark CelObjView 492 bool analyzeUncompressedForRemap()
const;
498 bool analyzeForRemap()
const;
506 static int16 getNumLoops(
const GuiResourceId viewId);
507 static int16 getNumCels(
const GuiResourceId viewId,
const int16 loopNo);
513 void draw(
Buffer &target,
const Common::Rect &targetRect,
const Common::Point &scaledPosition,
bool mirrorX,
const Ratio &scaleX,
const Ratio &scaleY);
522 #pragma mark CelObjPic 534 bool analyzeUncompressedForSkip()
const;
564 #pragma mark CelObjMem 581 #pragma mark CelObjColor 606 #endif // SCI_GRAPHICS_CELOBJ32_H #define ARRAYSIZE(x)
Definition: util.h:91
int16 loopNo
Definition: celobj32.h:78
Definition: celobj32.h:571
bool _transparent
Definition: celobj32.h:316
static String format(MSVC_PRINTF const char *fmt,...) GCC_PRINTF(1
CelInfo32 _info
Definition: celobj32.h:270
static bool _drawBlackLines
Definition: celobj32.h:252
int valuesX[kCelScalerTableSize]
Definition: celobj32.h:167
bool _mirrorX
Definition: celobj32.h:333
Common::Point _origin
Definition: celobj32.h:292
int valuesY[kCelScalerTableSize]
Definition: celobj32.h:179
Ratio scaleY
Definition: celobj32.h:184
uint8 color
Definition: celobj32.h:95
int id
Definition: celobj32.h:144
uint16 _xResolution
Definition: celobj32.h:304
CelType type
Definition: celobj32.h:68
Ratio scaleX
Definition: celobj32.h:172
Definition: celobj32.h:161
Definition: rational.h:40
bool _remap
Definition: celobj32.h:326
Definition: celobj32.h:64
uint32 _hunkPaletteOffset
Definition: celobj32.h:281
static CelCache * _cache
Definition: celobj32.h:463
int16 _priority
Definition: celobj32.h:551
CelCompressionType _compressionType
Definition: celobj32.h:321
Definition: celobj32.h:242
void draw(Buffer &target, const ScreenItem &screenItem, const Common::Rect &targetRect) const
Definition: celobj32.h:187
uint8 _skipColor
Definition: celobj32.h:310
int16 celNo
Definition: celobj32.h:84
Definition: celobj32.h:528
GuiResourceId resourceId
Definition: celobj32.h:73
bool _drawMirrored
Definition: celobj32.h:260
static int _nextCacheId
Definition: celobj32.h:457
Definition: celobj32.h:587
uint32 _celHeaderOffset
Definition: celobj32.h:275
Definition: celobj32.h:139
Definition: display_client.h:113
Definition: screen_item32.h:53
Definition: celobj32.h:158
Common::Point _relativePosition
Definition: celobj32.h:545
reg_t bitmap
Definition: celobj32.h:90
Definition: vm_types.h:39
Definition: celobj32.h:486
uint8 _celCount
Definition: celobj32.h:540
bool _isMacSource
Definition: celobj32.h:339
uint16 _width
Definition: celobj32.h:286