hedgewars/hwengine.pas
changeset 6863 4d1ce4b4f7c6
parent 6734 9709d15dabfa
child 6917 4889c2b779b4
equal deleted inserted replaced
6862:87e060b69926 6863:4d1ce4b4f7c6
   248                 SDL_QUITEV:
   248                 SDL_QUITEV:
   249                     isTerminated:= true
   249                     isTerminated:= true
   250         end; //end case event.type_ of
   250         end; //end case event.type_ of
   251     end; //end while SDL_PollEvent(@event) <> 0 do
   251     end; //end while SDL_PollEvent(@event) <> 0 do
   252 
   252 
   253         if (cScreenResizeDelay <> 0) and (cScreenResizeDelay < RealTicks)
   253     if (cScreenResizeDelay <> 0) and (cScreenResizeDelay < RealTicks) and
   254         and ((cNewScreenWidth <> cScreenWidth) or (cNewScreenHeight <> cScreenHeight)) then
   254        ((cNewScreenWidth <> cScreenWidth) or (cNewScreenHeight <> cScreenHeight)) then
   255             begin
   255     begin
   256             cScreenResizeDelay:= 0;
   256         cScreenResizeDelay:= 0;
   257             cScreenWidth:= cNewScreenWidth;
   257         cScreenWidth:= cNewScreenWidth;
   258             cScreenHeight:= cNewScreenHeight;
   258         cScreenHeight:= cNewScreenHeight;
   259 
   259 
   260             ParseCommand('fullscr '+intToStr(LongInt(cFullScreen)), true);
   260         ParseCommand('fullscr '+intToStr(LongInt(cFullScreen)), true);
   261             WriteLnToConsole('window resize: ' + IntToStr(cScreenWidth) + ' x ' + IntToStr(cScreenHeight));
   261         WriteLnToConsole('window resize: ' + IntToStr(cScreenWidth) + ' x ' + IntToStr(cScreenHeight));
   262             ScriptOnScreenResize();
   262         ScriptOnScreenResize();
   263             InitCameraBorders();
   263         InitCameraBorders();
   264             InitTouchInterface();
   264         InitTouchInterface();
   265             end;
   265     end;
   266 
   266 
   267         if isTerminated = false then
   267     if isTerminated = false then
   268             begin
   268     begin
   269             CurrTime:= SDL_GetTicks;
   269         CurrTime:= SDL_GetTicks;
   270             if PrevTime + longword(cTimerInterval) <= CurrTime then
   270         if PrevTime + longword(cTimerInterval) <= CurrTime then
   271                 begin
   271         begin
   272                 DoTimer(CurrTime - PrevTime);
   272             DoTimer(CurrTime - PrevTime);
   273                 PrevTime:= CurrTime
   273             PrevTime:= CurrTime
   274                 end
   274         end
   275             else SDL_Delay(1);
   275         else SDL_Delay(1);
   276             IPCCheckSock();
   276         IPCCheckSock();
   277             end;
   277         end;
   278     end;
   278     end;
   279 end;
   279 end;
   280 
   280 
   281 ///////////////
   281 ///////////////
   282 procedure Game{$IFDEF HWLIBRARY}(gameArgs: PPChar); cdecl; export{$ENDIF};
   282 procedure Game{$IFDEF HWLIBRARY}(gameArgs: PPChar); cdecl; export{$ENDIF};