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