Ticket #8619: agipalNew.diff
File agipalNew.diff, 2.1 KB (added by , 18 years ago) |
---|
-
graphics.cpp
22 22 * 23 23 */ 24 24 25 #include "common/file.h" 25 26 #include "common/stdafx.h" 26 27 27 28 #include "graphics/cursorman.h" … … 375 376 g_system->setPalette(pal, 0, 32); 376 377 } 377 378 379 //Gets AGIPAL Data 380 void GfxMgr::setAGIPal(int p0) { 381 //report("Using AGIPAL hack\n"); 382 Common::File agipal; 383 384 char filename[15]; 385 uint32 fileSize; 386 sprintf(filename, "pal.%d", p0); 387 agipal.open(filename); 388 fileSize = agipal.size(); 389 byte *palData = (byte *)malloc(fileSize); 390 agipal.read(palData, fileSize); 391 agipal.close(); 392 393 //Chunk0 holds colors 0-7 394 for (int i = 0; i < 8 * 3; i++) 395 _agipalPalette[i] = palData[i]; 396 397 398 //Chunk1 is the same as the chunk0 399 //Chunk2 chunk holds colors 8-15 400 int pos = 8 * 3 * 2; 401 for (int i = 24; i < 8 * 3 * 2; i++) 402 _agipalPalette[i] = palData[pos + i]; 403 404 //Chunk3 is the same as the chunk2 405 //Chunks4-7 are duplicates of chunks0-3 406 407 initPalette(_agipalPalette); 408 gfxSetPalette(); 409 free(palData); 410 palData = 0; 411 } 412 378 413 /* put a block onto the screen */ 379 414 void GfxMgr::gfxPutBlock(int x1, int y1, int x2, int y2) { 380 415 if (x1 >= GFX_WIDTH) -
graphics.h
46 46 47 47 uint8 *_shakeH, *_shakeV; 48 48 49 uint8 _agipalPalette[16 * 3]; 50 49 51 public: 50 52 GfxMgr(AgiEngine *vm) { 51 53 _vm = vm; … … 80 82 void saveBlock(int, int, int, int, uint8 *); 81 83 void restoreBlock(int, int, int, int, uint8 *); 82 84 void initPalette(uint8 *); 85 void setAGIPal(int); 83 86 void drawFrame(int x1, int y1, int x2, int y2, int c1, int c2); 84 87 85 88 void putPixel(int, int, int); -
op_cmd.cpp
1231 1231 * set the palette. 1232 1232 */ 1233 1233 if ((g_agi->getFeatures() & GF_AGIPAL) && p0 >= 100 && p0 < 110) { 1234 report("not implemented: AGIPAL palettes\n");1234 g_gfx->setAGIPal(p0); 1235 1235 return; 1236 1236 } else 1237 1237 g_gfx->shakeStart();