Skip to content

Commit

Permalink
fix reading/writing of block image in LOOKS file
Browse files Browse the repository at this point in the history
  • Loading branch information
katahiromz committed Apr 5, 2024
1 parent 3a41d74 commit c88c3b9
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 10 deletions.
10 changes: 4 additions & 6 deletions GUI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2099,12 +2099,10 @@ BOOL XgImportLooks(HWND hwnd, LPCWSTR pszFileName)
// 黒マス画像。
GetPrivateProfileStringW(L"Looks", L"BlackCellImage", L"", szText, _countof(szText), pszFileName);
xg_strBlackCellImage = szText;

::DeleteObject(xg_hbmBlackCell);
xg_hbmBlackCell = nullptr;
::DeleteEnhMetaFile(xg_hBlackCellEMF);
xg_hBlackCellEMF = nullptr;
XgGetFileManager()->load_block_image(xg_strBlackCellImage, xg_hbmBlackCell, xg_hBlackCellEMF);
if (XgGetFileManager()->load_block_image(xg_strBlackCellImage))
xg_strBlackCellImage = XgGetFileManager()->get_canonical(xg_strBlackCellImage);
else
xg_strBlackCellImage.clear();

// 二重マス文字。
GetPrivateProfileStringW(L"Looks", L"DoubleFrameLetters", XgLoadStringDx1(IDS_DBLFRAME_LETTERS_1), szText, _countof(szText), pszFileName);
Expand Down
2 changes: 2 additions & 0 deletions HISTORY.txt
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,7 @@
- 2024-XX-YY ver.5.2.3
- Added "Open app folder" item to "Advanced" settings.
- Fixed the board not updating when dropping a LOOKS file.
- Fixed the reading and writing of block image in LOOKS files.

# 開発履歴 (Japanese)

Expand Down Expand Up @@ -945,3 +946,4 @@
- ReadMeを更新。
- 上級者向け設定に「アプリのフォルダを開く」を追加。
- LOOKSファイルをドロップしたときに盤面が更新されなかったのを修正。
- LOOKSファイルの黒マス画像の読み書きを修正。
4 changes: 0 additions & 4 deletions XG_SettingsDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -223,13 +223,9 @@ BOOL XG_SettingsDialog::OnOK(HWND hwnd)
XGStringW strBlock = szText;
xg_str_trim(strBlock);
if (XgGetFileManager()->load_block_image(strBlock))
{
xg_strBlackCellImage = XgGetFileManager()->get_canonical(strBlock);
}
else
{
xg_strBlackCellImage.clear();
}

// スケルトンビューか?
if (::IsDlgButtonChecked(hwnd, chx1) == BST_CHECKED)
Expand Down

0 comments on commit c88c3b9

Please sign in to comment.