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