X-Git-Url: http://deadsoftware.ru/gitweb?a=blobdiff_plain;f=src%2Fgame%2Fg_window.pas;h=92ee3b97161f475f88d1b9acf04528fa566c813d;hb=a2a24f8302a12dbc95954546c2f401f3566562c0;hp=2cbc4a75bfc3414fea1b6e83e8ce634a9e8e25d9;hpb=965a25fec3fb93ced92ca5e4060dfa29141fa32b;p=d2df-sdl.git diff --git a/src/game/g_window.pas b/src/game/g_window.pas index 2cbc4a7..92ee3b9 100644 --- a/src/game/g_window.pas +++ b/src/game/g_window.pas @@ -17,32 +17,52 @@ unit g_window; interface + procedure g_Game_ClearLoading; + procedure g_Game_SetLoadingText (const text: String; maxval: Integer; rewrite: Boolean); + procedure g_Game_StepLoading (value: Integer = -1); + procedure ProcessLoading (forceUpdate: Boolean=false); implementation uses - {$IFNDEF HEADLESS} + {$IFDEF ENABLE_RENDER} r_render, {$ENDIF} - e_sound, g_system, g_net + {$IFDEF ENABLE_SYSTEM} + g_system, + {$ENDIF} + e_sound, g_net ; procedure ProcessLoading (forceUpdate: Boolean = False); begin - if sys_HandleInput() = False then - begin - {$IFNDEF HEADLESS} - r_Render_DrawLoading(forceUpdate); - {$ENDIF} - e_SoundUpdate(); - // TODO: At the moment, I left here only host network processing, because the client code must - // handle network events on its own. Otherwise separate network cases that use different calls to - // enet_host_service() WILL lose their packets (for example, resource downloading). So they have - // to handle everything by themselves. But in general, this MUST be removed completely, since - // updating the window should never affect the network. Use single enet_host_service(), period. - if NetMode = NET_SERVER then g_Net_Host_Update(); - end + {$IFDEF ENABLE_RENDER} + r_Render_DrawLoading(forceUpdate); + {$ENDIF} + end; + + procedure g_Game_ClearLoading; + begin + {$IFDEF ENABLE_RENDER} + r_Render_ClearLoading; + {$ENDIF} + end; + + procedure g_Game_SetLoadingText (const text: String; maxval: Integer; rewrite: Boolean); + begin + {$IFDEF ENABLE_RENDER} + if maxval < 0 then maxval := 0; + r_Render_SetLoading(text, maxval); + {$ENDIF} + end; + + procedure g_Game_StepLoading (value: Integer = -1); + begin + {$IFDEF ENABLE_RENDER} + if value < 0 then value := 1; + r_Render_StepLoading(value); + {$ENDIF} end; end.