Files
kichikuou_system3-sdl2/src/sys/ags_bmp.cpp
T
kichikuou e8d254328a Merge upstream changes: Merge FILEIO changes
FILEIO has been updated to resolve relative paths inside FILEIO::Fopen(),
which has been already done in System3-sdl2.

FILEIO::Fgets() now uses a length param.

Callsites for these functions are also updated to reduce the diff from
upstream.
2020-05-22 12:04:36 +09:00

47 lines
1.1 KiB
C++

/*
ALICE SOFT SYSTEM 3 for Win32
[ AGS - bmp loader ]
*/
#include "ags.h"
#include "../fileio.h"
void AGS::load_bmp(const char* file_name)
{
// ヘッダ取得
int sx = 0, sy = 0;
// Jコマンドの処理
if(set_cg_dest) {
sx = cg_dest_x;
sy = cg_dest_y;
set_cg_dest = false;
}
if(extract_cg) {
assert(false);
#if 0
// BMP読み込み
WCHAR wszFilePath[_MAX_PATH];
MultiByteToWideChar(CP_ACP, 0, FILEIO::GetFilePath(file_name), -1, wszFilePath, _MAX_PATH);
Gdiplus::Bitmap *pBitmap = Gdiplus::Bitmap::FromFile(wszFilePath);
for(unsigned int y = 0; y < pBitmap->GetHeight(); y++) {
for(unsigned int x = 0; x < pBitmap->GetWidth(); x++) {
Gdiplus::Color srcColor;
pBitmap->GetPixel(x, y, &srcColor);
vram[dest_screen][y + sy][sx + x] = SETPALETTE256(srcColor.GetR(), srcColor.GetG(), srcColor.GetB()) | 0x80000000;
}
}
// 画面更新
if(dest_screen == 0) {
draw_screen(sx, sy, pBitmap->GetWidth(), pBitmap->GetHeight());
}
// BMP開放
delete pBitmap;
#endif
}
}