------------------------------------------------------------------------------- Main message procedure of the application The function handles all incoming messages for the main window. However, if does not directly process input commands. NOTE: Due to the impossibility to process WM_CHAR messages in dialogs properly the code for all hotkeys has been moved to the WndMain -------------------------
| 1245 | // properly the code for all hotkeys has been moved to the WndMain |
| 1246 | //------------------------------------------------------------------------------- |
| 1247 | INT_PTR CALLBACK MessageProc(HWND hwndDlg,UINT uMsg, WPARAM wParam,LPARAM lParam) { |
| 1248 | UNREFERENCED_PARAMETER(lParam); |
| 1249 | UNREFERENCED_PARAMETER(wParam); |
| 1250 | |
| 1251 | int xPos,yPos; |
| 1252 | int xPos2,yPos2; |
| 1253 | int fHalfX; |
| 1254 | int fHalfY; |
| 1255 | |
| 1256 | TRACKMOUSEEVENT sEvent; |
| 1257 | switch (uMsg) |
| 1258 | { |
| 1259 | case WM_INITDIALOG: |
| 1260 | |
| 1261 | g_hDlg = hwndDlg; |
| 1262 | |
| 1263 | // load the state of the user interface |
| 1264 | InitUI(); |
| 1265 | |
| 1266 | // load the file history |
| 1267 | LoadHistory(); |
| 1268 | |
| 1269 | // load the current color of the lights |
| 1270 | LoadLightColors(); |
| 1271 | return TRUE; |
| 1272 | |
| 1273 | case WM_HSCROLL: |
| 1274 | |
| 1275 | // XXX quick and dirty fix for #3029892 |
| 1276 | if (GetDlgItem(g_hDlg, IDC_SLIDERANIM) == (HWND)lParam && g_pcAsset && g_pcAsset->pcScene->mAnimations) |
| 1277 | { |
| 1278 | const aiAnimation* anim = g_pcAsset->pcScene->mAnimations[ g_pcAsset->mAnimator->CurrentAnimIndex() ]; |
| 1279 | if (anim && anim->mDuration > 0.0) |
| 1280 | { |
| 1281 | double tps = anim->mTicksPerSecond ? anim->mTicksPerSecond : ANIM_DEFAULT_TICKS_PER_SECOND; |
| 1282 | double sliderValue = (double)SendDlgItemMessage(g_hDlg, IDC_SLIDERANIM, TBM_GETPOS, 0, 0); |
| 1283 | g_dCurrent = (anim->mDuration / tps) * sliderValue / ANIM_SLIDER_MAX; |
| 1284 | g_pcAsset->mAnimator->Calculate(g_dCurrent); |
| 1285 | } |
| 1286 | } |
| 1287 | break; |
| 1288 | |
| 1289 | case WM_MOUSEWHEEL: |
| 1290 | |
| 1291 | if (CDisplay::VIEWMODE_TEXTURE == CDisplay::Instance().GetViewMode()) |
| 1292 | { |
| 1293 | CDisplay::Instance().SetTextureViewZoom ( GET_WHEEL_DELTA_WPARAM(wParam) / 50.0f ); |
| 1294 | } |
| 1295 | else |
| 1296 | { |
| 1297 | if (!g_bFPSView) |
| 1298 | { |
| 1299 | g_sCamera.vPos.z += GET_WHEEL_DELTA_WPARAM(wParam) / 50.0f; |
| 1300 | } |
| 1301 | else |
| 1302 | { |
| 1303 | g_sCamera.vPos += (GET_WHEEL_DELTA_WPARAM(wParam) / 50.0f) * |
| 1304 | g_sCamera.vLookAt.Normalize(); |
nothing calls this directly
no test coverage detected