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

Method Load_And_Draw_Image

Source/PC/Graphics_PC.cpp:702–731  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

700}
701
702void cGraphics_PC::Load_And_Draw_Image( const std::string &pFilename, unsigned int pColors, size_t pBackColor) {
703 std::string Filename = pFilename;
704
705 if (Filename.find('.') == std::string::npos )
706 Filename.append( ".dat" );
707
708 auto fileBuffer = g_Resource->fileGet(Filename);
709 uint8* srcBuffer = fileBuffer->data();
710
711 uint8 *Buffer = 0;
712
713 mSurface->clearBuffer();
714
715 for (unsigned int Plane = 0; Plane < 4; Plane++) {
716 Buffer = mSurface->GetSurfaceBuffer() + (16 * mSurface->GetWidth()) + 16;
717
718 for (unsigned int Y = 0; Y < 200; ++Y) {
719
720 for (unsigned int X = Plane; X < 320; X += 4 ) {
721
722 Buffer[X] = *srcBuffer++;
723 }
724
725 Buffer += mSurface->GetWidth();
726 }
727 }
728
729 if(pColors)
730 PaletteLoad( fileBuffer->data() + (fileBuffer->size() - (0x100 * 3)), pColors );
731}
732
733void cGraphics_PC::Mission_Intro_DrawHelicopter( uint16 ) {
734

Callers 6

Demo_Amiga_ShowMenuMethod · 0.45
Demo_Quiz_ShowScreenMethod · 0.45
Demo_QuizMethod · 0.45
intro_PlayMethod · 0.45
ShowImage_ForDurationMethod · 0.45
WonGameMethod · 0.45

Calls 6

findMethod · 0.80
clearBufferMethod · 0.80
GetSurfaceBufferMethod · 0.80
GetWidthMethod · 0.80
fileGetMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected