long PASCAL DescentWndProc(HWND hWnd,UINT message, WPARAM wParam,LPARAM lParam ) { switch(message) { case WM_KEYDOWN: case WM_KEYUP: if (WMKey_Handler_Ready) { // key_wparam=wParam; key_lparam=lParam; key_msg=message; keyboard_handler(); } break; case WM_MOUSEMOVE: case WM_LBUTTONDOWN: case WM_LBUTTONUP: case WM_RBUTTONDOWN: case WM_RBUTTONUP: case WM_NCMOUSEMOVE: case WM_NCLBUTTONDOWN: case WM_NCLBUTTONUP: case WM_NCRBUTTONDOWN: case WM_NCRBUTTONUP: break; case WM_PALETTECHANGED: case WM_PALETTEISCHANGING: return 0; case WM_KILLFOCUS: if (!GLPREF_windowed) ShowWindow(g_hWnd, SW_SHOWMINNOACTIVE);//this minimizes the game after you alt-tab out. break; case WM_ACTIVATE: wgl_game_activate((!(LOWORD(wParam) == WA_INACTIVE)),(BOOL) HIWORD(wParam); break; case WM_ACTIVATEAPP: // Win32_Key_Hook(wParam); // DPH: This doesn't work... no idea why not... break; case WM_DESTROY: finiObjects(); PostQuitMessage(0); break; default: return DefWindowProc(hWnd,message,wParam,lParam); } return 1; }
extern "C" void rglswDeleteWindow(GLint ihwnd) { HWND hwnd = (HWND)ihwnd; DrawEnd(); finiObjects(TRUE); if (scratch_buffer != NULL) { free(scratch_buffer); scratch_buffer = NULL; } if (scratch_buffer_2 != NULL) { free(scratch_buffer_2); scratch_buffer_2 = NULL; } }
void LoadRifFile() { char file_and_path[100]; int i = 0; Set_Progress_Bar_Position(PBAR_LEVEL_START); // clear the dir names for(i = 0; i < 100; i++) { file_and_path[i] = (char)0; EnvFileName[i] = (char)0; LevelDir[i] = (char)0; } // Set up the dirname for the Rif load catpathandextension(&file_and_path[0], (char *)&GameDataDirName[0]); catpathandextension(&file_and_path[0], Env_List[AvP.CurrentEnv]->main); /* root of the file name,smae as dir*/ catpathandextension(&file_and_path[0], (char *)&FileNameExtension[0]); /* extension*/ env_rif = avp_load_rif((const char*)&file_and_path[0]); Set_Progress_Bar_Position(PBAR_LEVEL_START+PBAR_LEVEL_INTERVAL*.4); if(INVALID_RIFFHANDLE == env_rif) { finiObjects(); exit(0x3421); }; #if MaxImageGroups>1 SetCurrentImageGroup(2); // FOR ENV #endif copy_rif_data(env_rif,CCF_ENVIRONMENT,PBAR_LEVEL_START+PBAR_LEVEL_INTERVAL*.4,PBAR_LEVEL_INTERVAL*.6); //setup_shading_tables(); }
long PASCAL DescentWndProc(HWND hWnd,UINT message, WPARAM wParam,LPARAM lParam ) { switch(message) { case WM_KEYDOWN: case WM_KEYUP: if (WMKey_Handler_Ready) { // key_wparam=wParam; key_lparam=lParam; key_msg=message; keyboard_handler(); } break; case WM_MOUSEMOVE: case WM_LBUTTONDOWN: case WM_LBUTTONUP: case WM_RBUTTONDOWN: case WM_RBUTTONUP: case WM_NCMOUSEMOVE: case WM_NCLBUTTONDOWN: case WM_NCLBUTTONUP: case WM_NCRBUTTONDOWN: case WM_NCRBUTTONUP: break; case WM_PALETTECHANGED: case WM_PALETTEISCHANGING: return 0; case WM_ACTIVATEAPP: // Win32_Key_Hook(wParam); // DPH: This doesn't work... no idea why not... break; case WM_DESTROY: finiObjects(); PostQuitMessage(0); break; } return DefWindowProc(hWnd,message,wParam,lParam); }