• R/O
  • SSH
  • HTTPS

oswan: コミット


コミットメタ情報

リビジョン90 (tree)
日時2010-05-12 17:56:46
作者bird_may_nike

ログメッセージ

(メッセージはありません)

変更サマリ

差分

--- oswanj/trunk/src/WSMain.cpp (revision 89)
+++ oswanj/trunk/src/WSMain.cpp (revision 90)
@@ -19,10 +19,17 @@
1919 LRESULT CALLBACK AboutProc(HWND, UINT, WPARAM, LPARAM);
2020 wchar_t* OpenWSFile(wchar_t*, DWORD);
2121 void WsPause(void);
22+void SetRecentRoms(wchar_t* RomPath);
2223
2324 HINSTANCE hInst;
2425 HWND hWnd;
2526 static LPCTSTR szClassName = TEXT("OswanJ"); //クラス名
27+static wchar_t RecentOfn0[512];
28+static wchar_t RecentOfn1[512];
29+static wchar_t RecentOfn2[512];
30+static wchar_t RecentOfn3[512];
31+static wchar_t RecentOfn4[512];
32+static wchar_t* RecentOfn[5] = {RecentOfn0, RecentOfn1, RecentOfn2, RecentOfn3, RecentOfn4};
2633
2734 int WINAPI WinMain(HINSTANCE hCurInst, HINSTANCE hPrevInst, LPSTR lpsCmdLine, int nCmdShow)
2835 {
@@ -132,8 +139,19 @@
132139 WsRelease();
133140 Run = 1;
134141 WsCreate(RomPath);
142+ SetRecentRoms(RomPath);
135143 }
136144 return 0L;
145+ case ID_FILE_RECENT0:
146+ if (*RecentOfn[0])
147+ {
148+ apuWaveClear();
149+ WsRelease();
150+ Run = 1;
151+ WsCreate(RecentOfn[0]);
152+ SetRecentRoms(RecentOfn[0]);
153+ }
154+ return 0L;
137155 case ID_PDATA_SET:
138156 apuWaveClear();
139157 WsRelease();
@@ -366,3 +384,58 @@
366384 CheckMenuItem(menu, ID_PAUSE, MF_UNCHECKED);
367385 }
368386 }
387+
388+void SetRecentRoms(wchar_t* RomPath)
389+{
390+ int i;
391+ wchar_t* temp;
392+ wchar_t* filename;
393+ wchar_t buf[256];
394+ MENUITEMINFOW minfo;
395+ minfo.cbSize = sizeof(MENUITEMINFOW);
396+ minfo.fMask = MIIM_STATE | MIIM_TYPE;
397+ minfo.fType = MFT_STRING;
398+ minfo.fState = MFS_ENABLED;
399+ minfo.dwTypeData = buf;
400+
401+ if (RomPath && *RomPath)
402+ {
403+ for (i = 0; i < 5; i++)
404+ {
405+ if (wcscmp(RomPath, RecentOfn[i]) == 0)
406+ {
407+ temp = RecentOfn[i];
408+ while (i) {
409+ RecentOfn[i] = RecentOfn[i - 1];
410+ i--;
411+ }
412+ RecentOfn[0] = temp;
413+ break;
414+ }
415+ }
416+ if (i)
417+ {
418+ temp = RecentOfn[4];
419+ RecentOfn[4] = RecentOfn[3];
420+ RecentOfn[3] = RecentOfn[2];
421+ RecentOfn[2] = RecentOfn[1];
422+ RecentOfn[1] = RecentOfn[0];
423+ RecentOfn[0] = temp;
424+ wcscpy(RecentOfn[0], RomPath);
425+ }
426+ }
427+ HMENU menu = GetMenu(hWnd);
428+ for (i = 0; i < 5; i++)
429+ {
430+ if (*RecentOfn[i])
431+ {
432+ filename = wcsrchr(RecentOfn[i], '\\');
433+ wsprintf(buf, TEXT("&%d %s"), i + 1, ++filename);
434+ }
435+ else
436+ {
437+ buf[0] = '\0';
438+ }
439+ SetMenuItemInfo(menu, ID_FILE_RECENT0 + i, FALSE, &minfo);
440+ }
441+}
--- oswanj/trunk/src/WSApu.cpp (revision 89)
+++ oswanj/trunk/src/WSApu.cpp (revision 90)
@@ -397,6 +397,10 @@
397397 }
398398 }
399399
400+/*
401+PlaySound()は音量調節が出来ないのでいったんメモリに読み込んで
402+プレイ時にデータを加工する
403+*/
400404 static void* SSMasterBuf;
401405 static void* SSPlayBuf;
402406 static DWORD SSDataLen, SSHeadLen;
@@ -479,7 +483,7 @@
479483 {
480484 return;
481485 }
482- src = (short*)((BYTE*)SSMasterBuf);
486+ src = (short*)SSMasterBuf;
483487 dst = (short*)((BYTE*)SSPlayBuf + SSHeadLen);
484488 // マスターの音量を変更してプレイバッファーにコピー
485489 for (i = 0; i < size; i++)
--- oswanj/trunk/src/WSBandai.h (revision 89)
+++ oswanj/trunk/src/WSBandai.h (revision 90)
@@ -10,12 +10,12 @@
1010 #define BANDAI_Y (48)
1111
1212 RECT bandaiRect[6] = {
13- 5, 9, 16, 23, // Bのrect(left, top, right, bottom)
14- 18, 9, 30, 23, // A
15- 32, 9, 42, 23, // N
16- 5, 25, 16, 39, // D
17- 18, 25, 30, 39, // A
18- 32, 25, 34, 39 // I
13+ { 5, 9, 16, 23}, // Bのrect(left, top, right, bottom)
14+ {18, 9, 30, 23}, // A
15+ {32, 9, 42, 23}, // N
16+ { 5, 25, 16, 39}, // D
17+ {18, 25, 30, 39}, // A
18+ {32, 25, 34, 39} // I
1919 };
2020
2121 #define W (0xFFFF)
--- oswanj/trunk/resource.h (revision 89)
+++ oswanj/trunk/resource.h (revision 90)
@@ -50,6 +50,11 @@
5050 #define ID_ABOUT 40032
5151 #define ID_PAUSE 40033
5252 #define ID_RESET 40034
53+#define ID_FILE_RECENT0 40035
54+#define ID_FILE_RECENT1 40036
55+#define ID_FILE_RECENT2 40037
56+#define ID_FILE_RECENT3 40038
57+#define ID_FILE_RECENT4 40039
5358
5459 // Next default values for new objects
5560 //
@@ -56,7 +61,7 @@
5661 #ifdef APSTUDIO_INVOKED
5762 #ifndef APSTUDIO_READONLY_SYMBOLS
5863 #define _APS_NEXT_RESOURCE_VALUE 109
59-#define _APS_NEXT_COMMAND_VALUE 40035
64+#define _APS_NEXT_COMMAND_VALUE 40040
6065 #define _APS_NEXT_CONTROL_VALUE 1016
6166 #define _APS_NEXT_SYMED_VALUE 101
6267 #endif
旧リポジトリブラウザで表示