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

Method GetImage

Source/Amiga/Graphics_Amiga2.cpp:125–148  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

123}
124
125sImage cGraphics_Amiga2::GetImage(const std::string& pFilename, const size_t pPaletteIndex) {
126 auto Palette = GetPalette(pFilename);
127
128 sImage Decoded;
129
130 // No, treat as a raw file
131 Decoded.mData = g_Resource->fileGet(pFilename + ".RAW");
132 if (!Decoded.mData->size())
133 return Decoded;
134
135 // Calculate planes based on file size
136 if (Decoded.mData->size() == 51400)
137 Decoded.mPlanes = 5;
138 else {
139 Decoded.mPlanes = 4;
140 }
141
142 Decoded.mDimension.mWidth = 0x140;
143 Decoded.mDimension.mHeight = 0x100;
144
145 Decoded.LoadPalette_Amiga((uint8*)Palette->data(), Palette->size() / 2, pPaletteIndex);
146
147 return Decoded;
148}
149
150sImage cGraphics_Amiga2::Decode_Image(const std::string& pFilename, const size_t pCount, const size_t pPaletteOffset, const size_t pStartIndex) {
151 sImage Image;

Callers

nothing calls this directly

Calls 3

LoadPalette_AmigaMethod · 0.80
fileGetMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected