Mercurial > hg > dmlib
comparison tools/lib64gfx.h @ 1764:52e31cfc1e36
Implement fake X raster position for the pixel getting functions. At some
point this will be turned into real fullscreen raster position.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Tue, 12 Jun 2018 04:43:05 +0300 |
parents | 07111a60cd4e |
children | 88354355b8e1 |
comparison
equal
deleted
inserted
replaced
1763:847bd77a538d | 1764:52e31cfc1e36 |
---|---|
159 } DMC64Image; | 159 } DMC64Image; |
160 | 160 |
161 | 161 |
162 typedef Uint8 (*DMC64GetPixelFunc)( | 162 typedef Uint8 (*DMC64GetPixelFunc)( |
163 const DMC64Image *img, const int bmoffs, const int scroffs, | 163 const DMC64Image *img, const int bmoffs, const int scroffs, |
164 const int vshift, const int vbitmap, const int raster); | 164 const int vshift, const int vbitmap, const int rasterX, const int rasterY); |
165 | 165 |
166 #define D64_MAX_ENCDEC_OPS 64 | 166 #define D64_MAX_ENCDEC_OPS 64 |
167 | 167 |
168 | 168 |
169 typedef struct _DMC64ImageFormat DMC64ImageFormat; | 169 typedef struct _DMC64ImageFormat DMC64ImageFormat; |
347 } | 347 } |
348 | 348 |
349 | 349 |
350 static inline Uint8 dmC64GetGenericMCPixel( | 350 static inline Uint8 dmC64GetGenericMCPixel( |
351 const DMC64Image *img, const int bmoffs, const int scroffs, | 351 const DMC64Image *img, const int bmoffs, const int scroffs, |
352 const int vshift, const int vbank, const int vbitmap, const int cbank, | 352 const int vshift, const int vbank, const int vbitmap, const int cbank, const int bgcolor) |
353 const int bgcolor) | |
354 { | 353 { |
355 switch ((img->bitmap[vbitmap].data[bmoffs] >> vshift) & 3) | 354 switch ((img->bitmap[vbitmap].data[bmoffs] >> vshift) & 3) |
356 { | 355 { |
357 case 0: return bgcolor; | 356 case 0: return bgcolor; |
358 case 1: return img->screen[vbank].data[scroffs] >> 4; | 357 case 1: return img->screen[vbank].data[scroffs] >> 4; |
362 } | 361 } |
363 | 362 |
364 | 363 |
365 static inline Uint8 fmtGetGenericSCPixel( | 364 static inline Uint8 fmtGetGenericSCPixel( |
366 const DMC64Image *img, const int bmoffs, const int scroffs, | 365 const DMC64Image *img, const int bmoffs, const int scroffs, |
367 const int vshift, const int vbitmap, const int raster) | 366 const int vshift, const int vbitmap, const int rasterX, const int rasterY) |
368 { | 367 { |
369 (void) raster; | 368 (void) rasterX; |
369 (void) rasterY; | |
370 return dmC64GetGenericSCPixel(img, bmoffs, scroffs, vshift, 0, vbitmap, 0); | 370 return dmC64GetGenericSCPixel(img, bmoffs, scroffs, vshift, 0, vbitmap, 0); |
371 } | 371 } |
372 | 372 |
373 | 373 |
374 static inline Uint8 fmtGetGenericMCPixel( | 374 static inline Uint8 fmtGetGenericMCPixel( |
375 const DMC64Image *img, const int bmoffs, const int scroffs, | 375 const DMC64Image *img, const int bmoffs, const int scroffs, |
376 const int vshift, const int vbitmap, const int raster) | 376 const int vshift, const int vbitmap, const int rasterX, const int rasterY) |
377 { | 377 { |
378 (void) raster; | 378 (void) rasterX; |
379 (void) rasterY; | |
379 return dmC64GetGenericMCPixel(img, bmoffs, scroffs, vshift, 0, vbitmap, 0, img->bgcolor); | 380 return dmC64GetGenericMCPixel(img, bmoffs, scroffs, vshift, 0, vbitmap, 0, img->bgcolor); |
380 } | 381 } |
381 | 382 |
382 | 383 |
383 static inline const DMC64EncDecOp * fmtGetEncDecOp(const DMC64ImageFormat *fmt, const int index) | 384 static inline const DMC64EncDecOp * fmtGetEncDecOp(const DMC64ImageFormat *fmt, const int index) |