MCPcopy Create free account
hub / github.com/OpenFodder/openfodder / Video_Draw_8

Method Video_Draw_8

Source/PC/Graphics_PC.cpp:392–433  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

390}
391
392void cGraphics_PC::Video_Draw_8(cSurface *pTarget, const uint8* RowPallete) {
393 if (!pTarget)
394 pTarget = mSurface;
395
396 uint8* di = pTarget->GetSurfaceBuffer();
397 uint8* si = mFodder->mVideo_Draw_FrameDataPtr;
398
399 di += pTarget->GetWidth() * mFodder->mVideo_Draw_PosY;
400 di += mFodder->mVideo_Draw_PosX;
401
402 mFodder->mVideo_Draw_Columns >>= 1;
403 mFodder->mDraw_Source_SkipPixelsPerRow = 160 - mFodder->mVideo_Draw_Columns;
404 mFodder->mDraw_Dest_SkipPixelsPerRow = (uint16)(pTarget->GetWidth() - (mFodder->mVideo_Draw_Columns * 2));
405
406 for (int16 dx = 0; dx < mFodder->mVideo_Draw_Rows; ++dx) {
407 uint8 Palette = mFodder->mVideo_Draw_PaletteIndex;
408 if (RowPallete) {
409 int16 bx = mFodder->mVideo_Draw_PosY + dx;
410
411 Palette = RowPallete[bx];
412 }
413
414 for (int16 cx = mFodder->mVideo_Draw_Columns; cx > 0; --cx) {
415 uint8 ah = *si;
416
417
418 uint8 al = ah >> 4;
419 if (al)
420 *di = al | Palette;
421
422 al = ah & 0x0F;
423 if (al)
424 *(di + 1) = al | Palette;
425
426 si++;
427 di+=2;
428 }
429
430 si += mFodder->mDraw_Source_SkipPixelsPerRow;
431 di += mFodder->mDraw_Dest_SkipPixelsPerRow;
432 }
433}
434
435void cGraphics_PC::Video_Draw_16(const uint8* RowPallete) {
436 uint8* di = mSurface->GetSurfaceBuffer();

Callers 4

GUI_Draw_Frame_8Method · 0.45
Sprite_Draw_FrameMethod · 0.45
Service_Sprite_DrawMethod · 0.45

Calls 2

GetSurfaceBufferMethod · 0.80
GetWidthMethod · 0.80

Tested by

no test coverage detected