#include <windows.h>#include "shared.h"#include "mmgr.h"#include "resource.rh"Go to the source code of this file.
Functions | |
| BOOL CALLBACK | StartProc (HWND hwnd, UINT Message, WPARAM wParam, LPARAM) |
| UINT APIENTRY | ColorDialogHook (HWND hdlg, UINT msg, WPARAM, LPARAM) |
| void | GetLightColor () |
Variables | |
| int | DialogInUse |
| float | lightColor [3] |
| HWND | hWnd |
| HWND | hWndStartDlg |
| char | szText [BUFFER_SIZE] |
| char | Directory [MAX_PATH] |
| char | AppDirectory [MAX_PATH] |
| char | HaloTypeName [MAX_PATH] |
| char | FireTypeName [MAX_PATH] |
| char | SplineFileName [MAX_PATH] |
| HWND | hWndOfDlg |
| OPENFILENAME | ofn |
| char | CurrentDirectory [MAX_PATH] |
|
||||||||||||||||||||
|
Definition at line 73 of file winfuncs.cpp. References DialogInUse, FALSE, and TRUE. Referenced by GetLightColor().
00074 {
00075 switch (msg)
00076 {
00077 case WM_INITDIALOG:
00078 {
00079 if(DialogInUse == 1) // Ambient
00080 SetWindowText(hdlg, "Choose Ambient Color");
00081 if(DialogInUse == 2) // Diffuse
00082 SetWindowText(hdlg, "Choose Diffuse Color");
00083 if(DialogInUse == 3) // Specular
00084 SetWindowText(hdlg, "Choose Specular Color");
00085 return TRUE;
00086 }
00087
00088 default:
00089 return FALSE;
00090 }
00091 }
|
|
|
Definition at line 93 of file winfuncs.cpp. References ColorDialogHook(), hWnd, and lightColor. Referenced by WinMain().
00094 {
00095 COLORREF colors[16];
00096 COLORREF colorRGB = RGB(lightColor[0]*255, lightColor[1]*255, lightColor[2]*255);
00097 CHOOSECOLOR colorDialog;
00098 memset(&colorDialog,0,sizeof(colorDialog));
00099 memset(colors,255,sizeof(colors));
00100 colorDialog.lStructSize = sizeof(CHOOSECOLOR);
00101 colorDialog.hwndOwner = hWnd;
00102 colorDialog.rgbResult = colorRGB;
00103 colorDialog.lpCustColors = colors;
00104 colorDialog.Flags = CC_FULLOPEN | CC_RGBINIT | CC_ENABLEHOOK;
00105 colorDialog.lpfnHook = (LPCCHOOKPROC)ColorDialogHook;
00106 ChooseColor(&colorDialog);
00107 lightColor[0] = (float)GetRValue(colorDialog.rgbResult)/255;
00108 lightColor[1] = (float)GetGValue(colorDialog.rgbResult)/255;
00109 lightColor[2] = (float)GetBValue(colorDialog.rgbResult)/255;
00110 }
|
|
||||||||||||||||||||
|
Definition at line 22 of file winfuncs.cpp. References AppDirectory, BUFFER_SIZE, FALSE, hWndStartDlg, ofn, SplineFileName, szText, and TRUE.
00023 {
00024 switch(Message)
00025 {
00026 case WM_INITDIALOG:
00027 hWndStartDlg = hwnd;
00028
00029 SendDlgItemMessage(hwnd, IDC_DLG_TEXT1, EM_SETLIMITTEXT, (WPARAM)BUFFER_SIZE - 1, (LPARAM)0);
00030
00031 sprintf(SplineFileName, "%s", AppDirectory);
00032 strcat(SplineFileName, "\\default.spn");
00033 SetDlgItemText(hWndStartDlg, IDC_DLG_TEXT1, SplineFileName);
00034 return TRUE;
00035
00036 case WM_COMMAND:
00037 switch(LOWORD(wParam))
00038 {
00039 case IDCANCEL:
00040 EndDialog(hwnd, IDCANCEL);
00041 return TRUE;
00042
00043 case IDOK:
00044 if (GetDlgItemText(hwnd, IDC_DLG_TEXT1, szText, BUFFER_SIZE))
00045 sprintf(SplineFileName, "%s", szText);
00046 else
00047 return FALSE;
00048 EndDialog(hwnd, IDOK);
00049 return TRUE;
00050
00051 case IDC_DLG_SETPATH1:
00052 sprintf(szText, "%s", SplineFileName);
00053 ZeroMemory(&ofn, sizeof(ofn));
00054 ofn.lStructSize = sizeof(ofn);
00055 ofn.hwndOwner = hWndStartDlg;
00056 ofn.lpstrFilter = "Spline Files (*.spn)\0*.spn\0\0";
00057 ofn.lpstrFile = szText;
00058 ofn.nMaxFile = MAX_PATH;
00059 ofn.lpstrInitialDir = AppDirectory;
00060 ofn.Flags = OFN_EXPLORER | OFN_FILEMUSTEXIST | OFN_HIDEREADONLY;
00061 ofn.lpstrDefExt = "spn";
00062 if(GetOpenFileName(&ofn))
00063 SetDlgItemText(hWndStartDlg, IDC_DLG_TEXT1, szText);
00064 sprintf(SplineFileName, "%s", szText);
00065 return TRUE;
00066 }
00067 break;
00068 }
00069 return FALSE;
00070 }
|
|
|
Definition at line 12 of file winfuncs.cpp. |
|
|
Definition at line 19 of file winfuncs.cpp. |
|
|
Definition at line 6 of file winfuncs.cpp. Referenced by ColorDialogHook(), and WinMain(). |
|
|
Definition at line 11 of file winfuncs.cpp. |
|
|
Definition at line 14 of file winfuncs.cpp. |
|
|
Definition at line 13 of file winfuncs.cpp. |
|
|
Definition at line 8 of file winfuncs.cpp. Referenced by GetLightColor(), WinMain(), and WndProc(). |
|
|
Definition at line 17 of file winfuncs.cpp. |
|
|
Definition at line 9 of file winfuncs.cpp. Referenced by StartProc(). |
|
|
Definition at line 7 of file winfuncs.cpp. Referenced by GetLightColor(), and WinMain(). |
|
|
Definition at line 18 of file winfuncs.cpp. Referenced by StartProc(). |
|
|
Definition at line 15 of file winfuncs.cpp. Referenced by StartProc(). |
|
|
Definition at line 10 of file winfuncs.cpp. Referenced by StartProc(). |
1.2.15