Removed changes by Nicholas. These will need to be re-submitted through Trac and manually validated.

Added BMP (24-bit uncompressed, 8-bit uncompressed, and RLE8) and PNG support to File::ReadImageFile(). So far everything in FileHandler is presumed to be safe with any input file except UTK decompression.

Also started making use of the static keyword in various places to aid the compiler in optimization.
This commit is contained in:
Fatbag 2012-04-06 13:27:40 -05:00
parent 7442579090
commit cb751c0bb8
29 changed files with 692 additions and 1291 deletions

View file

@ -16,7 +16,7 @@ void SetType(HWND hDlg, int type){
}
INT_PTR CALLBACK DlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam){
switch (message){
switch (message){
case WM_INITDIALOG: {
CenterDialog(hDlg);
@ -43,15 +43,15 @@ INT_PTR CALLBACK DlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam){
//Create the tooltips
HWND FARInfo = CreateWindowEx(0, TOOLTIPS_CLASS, NULL,
WS_POPUP | TTS_NOPREFIX | 0x40 | TTS_ALWAYSTIP,
CW_USEDEFAULT, CW_USEDEFAULT,
CW_USEDEFAULT, CW_USEDEFAULT,
hDlg, NULL, hInst, NULL),
DBPFInfo = CreateWindowEx(0, TOOLTIPS_CLASS, NULL,
WS_POPUP | TTS_NOPREFIX | 0x40 | TTS_ALWAYSTIP,
CW_USEDEFAULT, CW_USEDEFAULT,
CW_USEDEFAULT, CW_USEDEFAULT,
hDlg, NULL, hInst, NULL);
WS_POPUP | TTS_NOPREFIX | TTS_BALLOON | TTS_ALWAYSTIP,
CW_USEDEFAULT, CW_USEDEFAULT,
CW_USEDEFAULT, CW_USEDEFAULT,
hDlg, NULL, hInst, NULL),
DBPFInfo = CreateWindowEx(0, TOOLTIPS_CLASS, NULL,
WS_POPUP | TTS_NOPREFIX | TTS_BALLOON | TTS_ALWAYSTIP,
CW_USEDEFAULT, CW_USEDEFAULT,
CW_USEDEFAULT, CW_USEDEFAULT,
hDlg, NULL, hInst, NULL);
TOOLINFO tinfo = {
sizeof(TOOLINFO), //cbSize
@ -67,9 +67,9 @@ INT_PTR CALLBACK DlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam){
L"FAR version 1a is found in The Sims 1.\r\n\r\n"
L"Version 1b appears to be a mistake, in which it was intended to take on the version number 2.\r\n\r\n"
L"1b and 3 are both found exclusively in The Sims Online.";
SendMessage(FARInfo, (WM_USER + 24), 2000, 200);
SendMessage(FARInfo, (WM_USER + 32), TTI_INFO_LARGE, (LPARAM) L"FAR version");
SendMessage(FARInfo, TTM_ADDTOOL, 0, (LPARAM) &tinfo);
SendMessage(FARInfo, TTM_SETMAXTIPWIDTH, 2000, 200);
SendMessage(FARInfo, TTM_SETTITLE, TTI_INFO_LARGE, (LPARAM) L"FAR version");
SendMessage(FARInfo, TTM_ADDTOOL, 0, (LPARAM) &tinfo);
SendMessage(FARInfo, TTM_SETDELAYTIME, TTDT_AUTOPOP, 12000);
tinfo.uId = (UINT_PTR) GetDlgItem(hDlg, IDC_NA_DBPFINFO);
tinfo.lpszText = (wchar_t*)
@ -78,21 +78,21 @@ INT_PTR CALLBACK DlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam){
L"DBPF 1.0;i7.0 is found in The Sims Online and SimCity 4.\r\n\r\n"
L"1.0;i7.0 and 1.1;i7.1 are found in The Sims 2.\r\n\r\n"
L"2.0;i3.0 is found in Spore.";
SendMessage(DBPFInfo, (WM_USER + 24), 2000, 200);
SendMessage(DBPFInfo, (WM_USER + 32), TTI_INFO_LARGE, (LPARAM) L"DBPF version");
SendMessage(DBPFInfo, TTM_ADDTOOL, 0, (LPARAM) &tinfo);
SendMessage(DBPFInfo, TTM_SETMAXTIPWIDTH, 2000, 200);
SendMessage(DBPFInfo, TTM_SETTITLE, TTI_INFO_LARGE, (LPARAM) L"DBPF version");
SendMessage(DBPFInfo, TTM_ADDTOOL, 0, (LPARAM) &tinfo);
SendMessage(DBPFInfo, TTM_SETDELAYTIME, TTDT_AUTOPOP, 20000);
SetType(hDlg, TYPE_FAR);
} return TRUE;
case WM_CTLCOLORSTATIC:
if((HWND) lParam == GetDlgItem(hDlg, IDC_NA_TYPETEXT)){
SetBkColor((HDC) wParam, GetSysColor(COLOR_WINDOW));
return (INT_PTR) GetSysColorBrush(COLOR_WINDOW);
}
break;
case WM_COMMAND:
switch(LOWORD(wParam)){
if((HWND) lParam == GetDlgItem(hDlg, IDC_NA_TYPETEXT)){
SetBkColor((HDC) wParam, GetSysColor(COLOR_WINDOW));
return (INT_PTR) GetSysColorBrush(COLOR_WINDOW);
}
break;
case WM_COMMAND:
switch(LOWORD(wParam)){
case IDC_NA_TYPE:
if(HIWORD(wParam) == CBN_SELCHANGE)
SetType(hDlg, SendMessage((HWND)lParam, CB_GETCURSEL, 0, 0));
@ -110,7 +110,7 @@ INT_PTR CALLBACK DlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam){
EndDialog(hDlg, 0);
} break;
case WM_CLOSE:
EndDialog(hDlg, 0);
EndDialog(hDlg, 0);
}
return 0;
}

View file

@ -30,8 +30,8 @@ bool Close(){
Archive::IsOpen = false;
SetWindowText(hWnd, L"FARDive");
SendMessage(statusbar, SB_SETTEXT, 0, (LPARAM) L"");
SetWindowText(hWnd, L"FARDive");
SendMessage(statusbar, SB_SETTEXT, 0, (LPARAM) L"");
MENUITEMINFO mii;
mii.cbSize = sizeof(MENUITEMINFO);
@ -86,7 +86,7 @@ bool PopulateEntries(){
item.mask = LVIF_TEXT;
item.iItem = 0;
item.pszText = (LPTSTR) L"Test";
SendMessage(hList, LVM_SETITEMCOUNT, EntryCount, 0x00000002);
SendMessage(hList, LVM_SETITEMCOUNT, EntryCount, LVSICF_NOSCROLL);
SendMessage(hList, LVM_INSERTITEM, 0, (LPARAM) &item);
wchar_t buffer[17];
@ -162,7 +162,7 @@ bool SetWorkspace(){
RECT ClientRect;
GetClientRect(hWnd, &ClientRect);
hList = CreateWindowEx(WS_EX_CLIENTEDGE | 0x00010000 | WS_EX_COMPOSITED, WC_LISTVIEW, NULL, LVS_LIST | LVS_SHOWSELALWAYS | WS_CHILD | WS_VISIBLE,
hList = CreateWindowEx(WS_EX_CLIENTEDGE | LVS_EX_DOUBLEBUFFER | WS_EX_COMPOSITED, WC_LISTVIEW, NULL, LVS_LIST | LVS_SHOWSELALWAYS | WS_CHILD | WS_VISIBLE,
5, 5, 192, ClientRect.bottom-statusbarheight-10, hWnd, NULL, NULL, NULL);
SetWindowTheme(hList, L"Explorer", NULL);