/** * Poke the background palette into character 0's images. */ void FettleFontPal(SCNHANDLE fontPal) { const FONT *pFont; IMAGE *pImg; assert(fontPal); assert(g_hTagFont); // Tag font not declared assert(g_hTalkFont); // Talk font not declared pFont = (const FONT *)LockMem(g_hTagFont); pImg = (IMAGE *)LockMem(FROM_32(pFont->fontInit.hObjImg)); // get image for char 0 if (!TinselV2) pImg->hImgPal = TO_32(fontPal); else pImg->hImgPal = 0; pFont = (const FONT *)LockMem(g_hTalkFont); pImg = (IMAGE *)LockMem(FROM_32(pFont->fontInit.hObjImg)); // get image for char 0 if (!TinselV2) pImg->hImgPal = TO_32(fontPal); else pImg->hImgPal = 0; if (TinselV2 && SysVar(SV_TAGCOLOR)) { const COLORREF c = GetActorRGB(-1); SetTagColorRef(c); UpdateDACqueue(SysVar(SV_TAGCOLOR), c); } }
void SetActorRGB(int ano, COLORREF color) { assert(ano >= 0 && ano <= NumActors); if (ano) actorInfo[ano - 1].textColor = TO_32(color); else defaultColor = TO_32(color); }
static void MoverProcessHelper(int X, int Y, int id, PMOVER pMover) { const FILM *pfilm; const MULTI_INIT *pmi; const FRAME *pFrame; IMAGE *pim; assert(BgPal()); // Can't start actor without a background palette assert(pMover->walkReels[0][FORWARD]); // Starting actor process without walk reels InitMover(pMover); InitialPathChecks(pMover, X, Y); pfilm = (const FILM *)LockMem(pMover->walkReels[0][FORWARD]); pmi = (const MULTI_INIT *)LockMem(FROM_32(pfilm->reels[0].mobj)); //--- pFrame = (const FRAME *)LockMem(FROM_32(pmi->hMulFrame)); // get pointer to image pim = (IMAGE *)LockMem(READ_32(pFrame)); // handle to image pim->hImgPal = TO_32(BgPal()); //--- pMover->actorObj = MultiInitObject(pmi); /**/ assert(pMover->actorID == id); pMover->actorID = id; // add it to display list MultiInsertObject(GetPlayfieldList(FIELD_WORLD), pMover->actorObj); storeActorReel(id, NULL, 0, pMover->actorObj, 0, 0, 0); InitStepAnimScript(&pMover->actorAnim, pMover->actorObj, FROM_32(pfilm->reels[0].script), ONE_SECOND / FROM_32(pfilm->frate)); pMover->stepCount = 0; MultiSetAniXY(pMover->actorObj, pMover->objX, pMover->objY); // If no path, just use first path in the scene if (pMover->hCpath != NOPOLY) SetMoverZ(pMover, pMover->objY, GetPolyZfactor(pMover->hCpath)); else SetMoverZ(pMover, pMover->objY, GetPolyZfactor(FirstPathPoly())); // Make him the right size SetMoverStanding(pMover); //**** if added 18/11/94, am if (X != MAGICX && Y != MAGICY) { HideMover(pMover, 0); // Allows a play to come in before this appears pMover->bHidden = false; // ...but don't stay hidden } pMover->bActive = true; }
uint8_t *ud = (uint8_t *) lua_touserdata(L, 1); \ size_t index = (size_t) lua_tonumber(L, 2); \ uint32_t value = (uint32_t) lua_tonumber(L, 3); \ uint8_t *a = &ud[index]; \ T; \ return 0; \ } #define WRITE_8(V, a) a = V & 0xFF; #define WRITE_16(V, a, b) a = (V >> 8) & 0xFF; b = V & 0xFF; #define WRITE_32(V, a, b, c, d) a = (V >> 24) & 0xFF; b = (V >> 16) & 0xFF; c = (V >> 8) & 0xFF; d = V & 0xFF; READ_BUFFER(l_tm_buffer_read_uint8, (uint8_t) a[0]); READ_BUFFER(l_tm_buffer_read_uint16le, (uint16_t) TO_16(a[1], a[0])); READ_BUFFER(l_tm_buffer_read_uint16be, (uint16_t) TO_16(a[0], a[1])); READ_BUFFER(l_tm_buffer_read_uint32le, (uint32_t) TO_32(a[3], a[2], a[1], a[0])); READ_BUFFER(l_tm_buffer_read_uint32be, (uint32_t) TO_32(a[0], a[1], a[2], a[3])); READ_BUFFER(l_tm_buffer_read_int8, (int8_t) a[0]); READ_BUFFER(l_tm_buffer_read_int16le, (int16_t) TO_16(a[1], a[0])); READ_BUFFER(l_tm_buffer_read_int16be, (int16_t) TO_16(a[0], a[1])); READ_BUFFER(l_tm_buffer_read_int32le, (int32_t) TO_32(a[3], a[2], a[1], a[0])); READ_BUFFER(l_tm_buffer_read_int32be, (int32_t) TO_32(a[0], a[1], a[2], a[3])); WRITE_BUFFER(l_tm_buffer_write_uint8, WRITE_8((uint8_t) value, a[0])); WRITE_BUFFER(l_tm_buffer_write_uint16le, WRITE_16((uint16_t) value, a[1], a[0])); WRITE_BUFFER(l_tm_buffer_write_uint16be, WRITE_16((uint16_t) value, a[0], a[1])); WRITE_BUFFER(l_tm_buffer_write_uint32le, WRITE_32((uint32_t) value, a[3], a[2], a[1], a[0])); WRITE_BUFFER(l_tm_buffer_write_uint32be, WRITE_32((uint32_t) value, a[0], a[1], a[2], a[3])); WRITE_BUFFER(l_tm_buffer_write_int8, WRITE_8((int8_t) value, a[0])); WRITE_BUFFER(l_tm_buffer_write_int16le, WRITE_16((int16_t) value, a[1], a[0])); WRITE_BUFFER(l_tm_buffer_write_int16be, WRITE_16((int16_t) value, a[0], a[1]));