Mercurial > mm7
diff VideoPlayer.cpp @ 2069:259df09dfb50
32bits almost there
author | Nomad |
---|---|
date | Tue, 03 Dec 2013 20:18:17 +0200 |
parents | b2a434d65344 |
children | 4231fdf46dde |
line wrap: on
line diff
--- a/VideoPlayer.cpp Mon Dec 02 15:13:49 2013 +0200 +++ b/VideoPlayer.cpp Tue Dec 03 20:18:17 2013 +0200 @@ -843,22 +843,33 @@ //----- (004BF08B) -------------------------------------------------------- void VideoPlayer::SmackUpdatePalette() { - VideoPlayer *v2; // esi@1 + //VideoPlayer *v2; // esi@1 unsigned __int16 *v3; // ebx@1 unsigned int v4; // edi@1 unsigned int v5; // eax@1 - _SMACK *v6; // eax@1 + //_SMACK *v6; // eax@1 - v2 = this; pRenderer->BeginScene(); - v3 = pRenderer->pTargetSurface; - v4 = pRenderer->uTargetSurfacePitch; + + auto pixels = new unsigned short[640 * 480]; + v3 = pixels;//pRenderer->pTargetSurface; + v4 = 640;//pRenderer->uTargetSurfacePitch; v5 = SmackCheckSurfaceFromat(); - SmackToBuffer(v2->pSmackerMovie, 8, 8, 2 * v4, pRenderer->field_14, v3, v5); - v6 = v2->pSmackerMovie; - if ( v6->NewPalette ) + + SmackToBuffer(pSmackerMovie, 8, 8, 2 * v4, pRenderer->field_14, v3, v5); + + + for (unsigned int y = 8; y < 8 + pRenderer->field_14; ++y) + for (unsigned int x = 8; x < 8 + pSmackerMovie->Width; ++x) + { + pRenderer->WritePixel16(x, y, pixels[x + y * 640]); + } + delete [] pixels; + + //v6 = pSmackerMovie; + if ( pSmackerMovie->NewPalette ) { - SmackBufferNewPalette((long)pSmackerBuffer, (long)v6->Palette, LOWORD(v6->PalType)); + SmackBufferNewPalette((long)pSmackerBuffer, (long)pSmackerMovie->Palette, LOWORD(pSmackerMovie->PalType)); SmackColorRemapWithTrans( (long)pSmackerMovie, (long)pSmackerBuffer->Palette, @@ -866,9 +877,9 @@ (long)pSmackerBuffer->PalType, 1000); } - SmackDoFrame(v2->pSmackerMovie); - if ( v2->pSmackerMovie->FrameNum != v2->pSmackerMovie->Frames - 1 || v2->bLoopPlaying ) - SmackNextFrame(v2->pSmackerMovie); + SmackDoFrame(pSmackerMovie); + if ( pSmackerMovie->FrameNum != pSmackerMovie->Frames - 1 || bLoopPlaying ) + SmackNextFrame(pSmackerMovie); else Unload(); pRenderer->EndScene();