hedgewars/uWorld.pas
changeset 5521 3be9fda5c3c2
parent 5485 e943a005d0e8
child 5522 5a4bc518c59a
equal deleted inserted replaced
5520:7a950ef0cee0 5521:3be9fda5c3c2
    31 procedure DrawWorldStereo(Lag: LongInt; RM: TRenderMode);
    31 procedure DrawWorldStereo(Lag: LongInt; RM: TRenderMode);
    32 procedure ShowMission(caption, subcaption, text: ansistring; icon, time : LongInt);
    32 procedure ShowMission(caption, subcaption, text: ansistring; icon, time : LongInt);
    33 procedure HideMission;
    33 procedure HideMission;
    34 procedure ShakeCamera(amount: LongWord);
    34 procedure ShakeCamera(amount: LongWord);
    35 procedure MoveCamera;
    35 procedure MoveCamera;
       
    36 procedure onFocusStateChanged;
    36 
    37 
    37 implementation
    38 implementation
    38 uses
    39 uses
    39     uStore,
    40     uStore,
    40     uMisc,
    41     uMisc,
    49     uVariables,
    50     uVariables,
    50     uUtils,
    51     uUtils,
    51     uTextures,
    52     uTextures,
    52     uRender,
    53     uRender,
    53     uCaptions,
    54     uCaptions,
    54     uCursor
    55     uCursor,
       
    56     uCommands
    55     ;
    57     ;
    56 
    58 
    57 var cWaveWidth, cWaveHeight: LongInt;
    59 var cWaveWidth, cWaveHeight: LongInt;
    58     AMSlotSize, AMxOffset, AMyOffset, AMWidth, AMxShift, SlotsNum: LongInt;
    60     AMSlotSize, AMxOffset, AMyOffset, AMWidth, AMxShift, SlotsNum: LongInt;
    59     tmpSurface: PSDL_Surface;
    61     tmpSurface: PSDL_Surface;
  1310     amount:= Max(1, amount);
  1312     amount:= Max(1, amount);
  1311     WorldDx:= WorldDx - amount + LongInt(getRandom(1 + amount * 2));
  1313     WorldDx:= WorldDx - amount + LongInt(getRandom(1 + amount * 2));
  1312     WorldDy:= WorldDy - amount + LongInt(getRandom(1 + amount * 2));
  1314     WorldDy:= WorldDy - amount + LongInt(getRandom(1 + amount * 2));
  1313 end;
  1315 end;
  1314 
  1316 
       
  1317 
       
  1318 procedure onFocusStateChanged;
       
  1319 begin
       
  1320 if (not cHasFocus) and (GameState <> gsConfirm) then
       
  1321     ParseCommand('quit', true)
       
  1322 end;
       
  1323 
       
  1324 
  1315 procedure initModule;
  1325 procedure initModule;
  1316 begin
  1326 begin
  1317     fpsTexture:= nil;
  1327     fpsTexture:= nil;
  1318     FollowGear:= nil;
  1328     FollowGear:= nil;
  1319     WindBarWidth:= 0;
  1329     WindBarWidth:= 0;