hedgewars/hwengine.pas
branchwebgl
changeset 8444 75db7bb8dce8
parent 8340 46a9fde631f4
parent 8437 93b647d6a00f
child 8833 c13ebed437cb
equal deleted inserted replaced
8340:46a9fde631f4 8444:75db7bb8dce8
   291                 SDL_QUITEV:
   291                 SDL_QUITEV:
   292                     isTerminated:= true
   292                     isTerminated:= true
   293             end; //end case event.type_ of
   293             end; //end case event.type_ of
   294         end; //end while SDL_PollEvent(@event) <> 0 do
   294         end; //end while SDL_PollEvent(@event) <> 0 do
   295 
   295 
       
   296         if (CursorMovementX <> 0) or (CursorMovementY <> 0) then
       
   297             handlePositionUpdate(CursorMovementX * cameraKeyboardSpeed, CursorMovementY * cameraKeyboardSpeed);
       
   298 
   296         if (cScreenResizeDelay <> 0) and (cScreenResizeDelay < RealTicks) and
   299         if (cScreenResizeDelay <> 0) and (cScreenResizeDelay < RealTicks) and
   297            ((cNewScreenWidth <> cScreenWidth) or (cNewScreenHeight <> cScreenHeight)) then
   300            ((cNewScreenWidth <> cScreenWidth) or (cNewScreenHeight <> cScreenHeight)) then
   298         begin
   301         begin
   299             cScreenResizeDelay:= 0;
   302             cScreenResizeDelay:= 0;
   300             cScreenWidth:= cNewScreenWidth;
   303             cWindowedWidth:= cNewScreenWidth;
   301             cScreenHeight:= cNewScreenHeight;
   304             cWindowedHeight:= cNewScreenHeight;
       
   305             cScreenWidth:= cWindowedWidth;
       
   306             cScreenHeight:= cWindowedHeight;
   302 
   307 
   303             ParseCommand('fullscr '+intToStr(LongInt(cFullScreen)), true);
   308             ParseCommand('fullscr '+intToStr(LongInt(cFullScreen)), true);
   304             WriteLnToConsole('window resize: ' + IntToStr(cScreenWidth) + ' x ' + IntToStr(cScreenHeight));
   309             WriteLnToConsole('window resize: ' + IntToStr(cScreenWidth) + ' x ' + IntToStr(cScreenHeight));
   305             ScriptOnScreenResize();
   310             ScriptOnScreenResize();
   306             InitCameraBorders();
   311             InitCameraBorders();
   307             InitTouchInterface();
   312             InitTouchInterface();
       
   313             SendIPC('W' + IntToStr(cScreenWidth) + 'x' + IntToStr(cScreenHeight));
   308         end;
   314         end;
   309 
   315 
   310         CurrTime:= SDL_GetTicks();
   316         CurrTime:= SDL_GetTicks();
   311         if PrevTime + longword(cTimerInterval) <= CurrTime then
   317         if PrevTime + longword(cTimerInterval) <= CurrTime then
   312         begin
   318         begin
   363 end;
   369 end;
   364 {$ENDIF}
   370 {$ENDIF}
   365 
   371 
   366 ///////////////////////////////////////////////////////////////////////////////
   372 ///////////////////////////////////////////////////////////////////////////////
   367 procedure Game{$IFDEF HWLIBRARY}(argc: LongInt; argv: PPChar); cdecl; export{$ENDIF};
   373 procedure Game{$IFDEF HWLIBRARY}(argc: LongInt; argv: PPChar); cdecl; export{$ENDIF};
   368 var p: TPathType;
   374 //var p: TPathType;
   369     s: shortstring;
   375 var s: shortstring;
   370     i: LongInt;
   376     i: LongInt;
   371 {$IFDEF WEBGL}
   377 {$IFDEF WEBGL}
   372     l:TResourceList;
   378     l:TResourceList;
   373 {$ENDIF}
   379 {$ENDIF}
   374 
   380 
   488 
   494 
   489 procedure initEverything (complete:boolean);
   495 procedure initEverything (complete:boolean);
   490 begin
   496 begin
   491     uUtils.initModule(complete);    // opens the debug file, must be the first
   497     uUtils.initModule(complete);    // opens the debug file, must be the first
   492     uVariables.initModule;          // inits all global variables
   498     uVariables.initModule;          // inits all global variables
   493     uConsole.initModule;            // opens stdout
       
   494     uCommands.initModule;           // helps below
   499     uCommands.initModule;           // helps below
   495     uCommandHandlers.initModule;    // registers all messages from frontend
   500     uCommandHandlers.initModule;    // registers all messages from frontend
   496 
   501 
   497     uLand.initModule;               // computes land
   502     uLand.initModule;               // computes land
   498     uLandPainted.initModule;        // computes drawn land
   503     uLandPainted.initModule;        // computes drawn land
   559     uLand.freeModule;
   564     uLand.freeModule;
   560     uLandPainted.freeModule;
   565     uLandPainted.freeModule;
   561 
   566 
   562     uCommandHandlers.freeModule;
   567     uCommandHandlers.freeModule;
   563     uCommands.freeModule;
   568     uCommands.freeModule;
   564     uConsole.freeModule;            // closes stdout
       
   565     uVariables.freeModule;
   569     uVariables.freeModule;
   566     uUtils.freeModule;              // closes debug file
   570     uUtils.freeModule;              // closes debug file
   567 end;
   571 end;
   568 
   572 
   569 ///////////////////////////////////////////////////////////////////////////////
   573 ///////////////////////////////////////////////////////////////////////////////