X-Git-Url: http://deadsoftware.ru/gitweb?a=blobdiff_plain;f=src%2Fgame%2Fg_game.pas;h=d60a96054b453b02ef495e7a612377c6a00d8ba4;hb=b89a73ac1981feb1c63f4760d696f1b31a6b9349;hp=f7aed54523e41c6a4f133426fdd73404165a2746;hpb=9a066f2c58ac3b0c590f269787de0f6204dcf353;p=d2df-sdl.git diff --git a/src/game/g_game.pas b/src/game/g_game.pas index f7aed54..d60a960 100644 --- a/src/game/g_game.pas +++ b/src/game/g_game.pas @@ -87,7 +87,6 @@ procedure g_Game_Update(); procedure g_Game_PreUpdate(); procedure g_Game_Quit(); procedure g_Game_SetupScreenSize(); -procedure g_Game_ChangeResolution(newWidth, newHeight: Word; nowFull, nowMax: Boolean); function g_Game_ModeToText(Mode: Byte): string; function g_Game_TextToMode(Mode: string): Byte; procedure g_Game_ExecuteEvent(Name: String); @@ -440,7 +439,7 @@ uses {$IFDEF ENABLE_HOLMES} g_holmes, {$ENDIF} - e_res, g_textures, g_window, g_menu, + e_res, g_window, g_menu, r_render, r_textures, r_animations, r_gfx, e_input, e_log, g_console, r_console, g_items, g_map, g_panel, g_playermodel, g_gfx, g_options, Math, g_triggers, g_monsters, e_sound, CONFIG, @@ -1262,7 +1261,7 @@ begin gDelayedEvents[n].DENum := Num; gDelayedEvents[n].DEStr := Str; if DEType = DE_GLOBEVENT then - gDelayedEvents[n].Time := (sys_GetTicks() {div 1000}) + Time + gDelayedEvents[n].Time := (GetTickCount64() {div 1000}) + Time else gDelayedEvents[n].Time := gTime + Time; Result := n; @@ -1467,13 +1466,7 @@ begin g_Game_SetLoadingText(Format('Doom 2D: Forever %s', [GAME_VERSION]), 0, False); g_Game_SetLoadingText('', 0, False); - g_Game_SetLoadingText(_lc[I_LOAD_CONSOLE], 0, False); - r_Console_Init; - g_Console_Init(); - g_Game_SetLoadingText(_lc[I_LOAD_MODELS], 0, False); - r_PlayerModel_Initialize; - // load models from all possible wad types, in all known directories // this does a loosy job (linear search, ooph!), but meh for wext in wadExtensions do @@ -1527,11 +1520,6 @@ begin g_Sound_CreateWADEx('MUSIC_ROUNDMUS', GameWAD+':MUSIC\ROUNDMUS', True, True); g_Sound_CreateWADEx('MUSIC_STDENDMUS', GameWAD+':MUSIC\ENDMUS', True); -{$IFNDEF HEADLESS} - g_Game_SetLoadingText(_lc[I_LOAD_MENUS], 0, False); - g_Menu_Init(); -{$ENDIF} - gMusic := TMusic.Create(); gMusic.SetByName('MUSIC_MENU'); gMusic.Play(); @@ -2246,6 +2234,7 @@ begin g_Weapon_Update(); g_Monsters_Update(); g_GFX_Update(); + r_GFX_Update; g_Player_UpdateAll(); g_Player_UpdatePhysicalObjects(); @@ -2345,7 +2334,7 @@ begin if gResolutionChange then begin e_WriteLog('Changing resolution', TMsgType.Notify); - g_Game_ChangeResolution(gRC_Width, gRC_Height, gRC_FullScreen, gRC_Maximized); + r_Render_Apply; gResolutionChange := False; g_ActiveWindow := nil; end; @@ -2372,7 +2361,7 @@ begin KeyPress(IK_F10); end; - Time := sys_GetTicks() {div 1000}; + Time := GetTickCount64() {div 1000}; // Обработка отложенных событий: if gDelayedEvents <> nil then @@ -2525,7 +2514,6 @@ begin end; end; - g_Frames_CreateWAD(nil, 'FRAMES_TELEPORT', GameWAD+':TEXTURES\TELEPORT', 64, 64, 10, False); g_Frames_CreateWAD(nil, 'FRAMES_PUNCH', GameWAD+':WEAPONS\PUNCH', 64, 64, 4, False); g_Frames_CreateWAD(nil, 'FRAMES_PUNCH_UP', GameWAD+':WEAPONS\PUNCH_UP', 64, 64, 4, False); g_Frames_CreateWAD(nil, 'FRAMES_PUNCH_DN', GameWAD+':WEAPONS\PUNCH_DN', 64, 64, 4, False); @@ -2629,7 +2617,6 @@ begin g_Game_StopAllSounds(True); gMusic.Free(); g_Game_FreeData(); - r_PlayerModel_Finalize; g_PlayerModel_FreeData(); g_Texture_DeleteAll(); g_Frames_DeleteAll(); @@ -2669,7 +2656,6 @@ begin g_Texture_Delete('TEXTURE_PLAYER_BLUEFLAG_D'); g_Texture_Delete('TEXTURE_PLAYER_TALKBUBBLE'); g_Texture_Delete('TEXTURE_PLAYER_INVULPENTA'); - g_Frames_DeleteByName('FRAMES_TELEPORT'); g_Frames_DeleteByName('FRAMES_PUNCH'); g_Frames_DeleteByName('FRAMES_PUNCH_UP'); g_Frames_DeleteByName('FRAMES_PUNCH_DN'); @@ -2794,11 +2780,6 @@ begin end; end; -procedure g_Game_ChangeResolution(newWidth, newHeight: Word; nowFull, nowMax: Boolean); -begin - sys_SetDisplayMode(newWidth, newHeight, gBPP, nowFull, nowMax); -end; - procedure g_Game_AddPlayer(Team: Byte = TEAM_NONE); begin if ((not gGameOn) and (gState <> STATE_INTERCUSTOM)) @@ -5940,16 +5921,7 @@ begin g_Game_Quit(); end; 'r_reset': - begin - gRC_Width := Max(1, gRC_Width); - gRC_Height := Max(1, gRC_Height); - gBPP := Max(1, gBPP); - if sys_SetDisplayMode(gRC_Width, gRC_Height, gBPP, gRC_FullScreen, gRC_Maximized) = True then - e_LogWriteln('resolution changed') - else - e_LogWriteln('resolution not changed'); - sys_EnableVSync(gVSync); - end; + r_Render_Apply; 'r_maxfps': begin if Length(p) = 2 then