MCPcopy Create free account
hub / github.com/AppleWin/AppleWin / Video_SetBitmapHeader

Method Video_SetBitmapHeader

source/Video.cpp:494–525  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

492//===========================================================================
493
494void Video::Video_SetBitmapHeader(WinBmpHeader_t *pBmp, int nWidth, int nHeight, int nBitsPerPixel)
495{
496 pBmp->nCookie[ 0 ] = 'B'; // 0x42
497 pBmp->nCookie[ 1 ] = 'M'; // 0x4d
498 pBmp->nSizeFile = 0;
499 pBmp->nReserved1 = 0;
500 pBmp->nReserved2 = 0;
501#if VIDEO_SCREENSHOT_PALETTE
502 pBmp->nOffsetData = sizeof(WinBmpHeader_t) + (256 * sizeof(bgra_t));
503#else
504 pBmp->nOffsetData = sizeof(WinBmpHeader_t);
505#endif
506 pBmp->nStructSize = 0x28; // sizeof( WinBmpHeader_t );
507 pBmp->nWidthPixels = nWidth;
508 pBmp->nHeightPixels = nHeight;
509 pBmp->nPlanes = 1;
510#if VIDEO_SCREENSHOT_PALETTE
511 pBmp->nBitsPerPixel = 8;
512#else
513 pBmp->nBitsPerPixel = nBitsPerPixel;
514#endif
515 pBmp->nCompression = BI_RGB; // none
516 pBmp->nSizeImage = 0;
517 pBmp->nXPelsPerMeter = 0;
518 pBmp->nYPelsPerMeter = 0;
519#if VIDEO_SCREENSHOT_PALETTE
520 pBmp->nPaletteColors = 256;
521#else
522 pBmp->nPaletteColors = 0;
523#endif
524 pBmp->nImportantColors = 0;
525}
526
527//===========================================================================
528

Callers 1

CmdNTSCFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected