Changeset 533


Ignore:
Timestamp:
Apr 12, 2024, 8:58:58 PM (3 weeks ago)
Author:
chronos
Message:
  • Fixed: Eliminated unwanted second map resize and redraw during displaying of the main game window.
Location:
trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/LocalPlayer/IsoEngine.pas

    r530 r533  
    380380    for Y := -2 to 6 do
    381381      BitBltBitmap(LandPatch, (X + 2) * (xxt * 2), (Y + 2) * yyt, xxt,
    382         yyt, HGrTerrain.Data, xSrc + xxt, ySrc + yyt,
    383         SRCPAINT);
     382        yyt, HGrTerrain.Data, xSrc + xxt, ySrc + yyt, SRCPAINT);
    384383    for Y := -2 to 6 do
    385384      BitBltBitmap(LandPatch, (X + 2) * (xxt * 2) + xxt, (Y + 2) * yyt,
    386         xxt, yyt, HGrTerrain.Data, xSrc, ySrc + yyt,
    387         SRCPAINT);
     385        xxt, yyt, HGrTerrain.Data, xSrc, ySrc + yyt, SRCPAINT);
    388386    for Y := -2 to 6 do
    389387      BitBltBitmap(LandPatch, (X + 2) * (xxt * 2), (Y + 2) * yyt, xxt,
     
    413411    for X := 0 to 7 do
    414412      BitBltBitmap(LandMore, (X + 2) * (xxt * 2) - xxt, (Y + 2) * yyt,
    415         xxt * 2, yyt, HGrTerrain.Data, xSrc, ySrc + yyt,
    416         SRCPAINT);
     413        xxt * 2, yyt, HGrTerrain.Data, xSrc, ySrc + yyt, SRCPAINT);
    417414    for X := -2 to 6 do
    418415      BitBltBitmap(LandMore, (X + 2) * (xxt * 2), (Y + 2) * yyt,
     
    432429      begin
    433430        BitBltBitmap(OceanPatch, X * (xxt * 2), Y * yyt, xxt, yyt,
    434           HGrTerrain.Data, xSrc + xxt, ySrc + yyt,
    435           SRCPAINT);
     431          HGrTerrain.Data, xSrc + xxt, ySrc + yyt, SRCPAINT);
    436432        BitBltBitmap(OceanPatch, X * (xxt * 2) + xxt, Y * yyt, xxt, yyt,
    437433          HGrTerrain.Data, xSrc, ySrc + yyt, SRCPAINT);
     
    456452      begin
    457453        BitBltBitmap(OceanMore, X * (xxt * 2), Y * yyt, xxt, yyt,
    458           HGrTerrain.Data, xSrc + xxt, ySrc + yyt,
    459           SRCPAINT);
     454          HGrTerrain.Data, xSrc + xxt, ySrc + yyt, SRCPAINT);
    460455        BitBltBitmap(OceanMore, X * (xxt * 2) + xxt, Y * yyt, xxt, yyt,
    461456          HGrTerrain.Data, xSrc, ySrc + yyt, SRCPAINT);
  • trunk/LocalPlayer/Term.lfm

    r456 r533  
    3333  LCLVersion = '2.2.0.4'
    3434  Scaled = False
    35   WindowState = wsMaximized
     35  WindowState = wsNormal
    3636  object UnitBtn: TButtonB
    3737    Tag = 14
  • trunk/LocalPlayer/Term.pas

    r531 r533  
    245245    procedure FormResize(Sender: TObject);
    246246    procedure PanelBtnClick(Sender: TObject);
    247     procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean);
    248247    procedure Toggle(Sender: TObject);
    249248    procedure PanelBoxMouseMove(Sender: TObject; Shift: TShiftState;
     
    260259      Shift: TShiftState; X, Y: Integer);
    261260    procedure FormPaint(Sender: TObject);
     261    procedure FormClose(Sender: TObject; var Action: TCloseAction);
     262    procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean);
     263    procedure FormShow(Sender: TObject);
    262264    procedure mRepClicked(Sender: TObject);
    263265    procedure mLogClick(Sender: TObject);
    264     procedure FormClose(Sender: TObject; var Action: TCloseAction);
    265     procedure FormShow(Sender: TObject);
    266266    procedure Radio(Sender: TObject);
    267267    procedure mManipClick(Sender: TObject);
     
    329329    NoMap: TIsoMap;
    330330    NoMapPanel: TIsoMap;
     331    LastResizeWidth: Integer;
     332    LastResizeHeight: Integer;
     333    LastWindowState: TWindowState;
    331334    // Forms
    332335    FWondersDlg: TWondersDlg;
     
    28152818          Brush.Style := TBrushStyle.bsClear;
    28162819        end;
    2817         FormResize(nil); // place mini map correctly according to its size
    28182820        Show;
    28192821        Update;
     
    41974199  MiniFrame, MaxMapWidth: Integer;
    41984200begin
     4201  if (LastResizeWidth = Width) and (LastResizeHeight = Height) and
     4202    (LastWindowState = WindowState) then Exit
     4203  else begin
     4204    LastResizeWidth := Width;
     4205    LastResizeHeight := Height;
     4206    LastWindowState := WindowState;
     4207  end;
     4208
    41994209  SmallScreen := Width < 1024;
    42004210  with MainMap do begin
     
    70917101    if not Active and (CurrentWindowState = TWindowState.wsFullScreen) then begin
    70927102      if PrevWindowState = TWindowState.wsMaximized then begin
    7093         CurrentWindowState := TWindowState.wsMaximized;
     7103        CurrentWindowState := TWindowState.wsNormal;
    70947104        WindowState := CurrentWindowState;
    70957105      end else begin
    7096         CurrentWindowState := TWindowState.wsNormal;
     7106        CurrentWindowState := PrevWindowState;
    70977107        WindowState := CurrentWindowState;
    70987108        WindowState := TWindowState.wsFullScreen;
     
    81068116procedure TMainScreen.FormShow(Sender: TObject);
    81078117begin
     8118  if FullScreen then BoundsRect := Bounds(0, 0, Screen.Width, Screen.Height)
     8119    else BoundsRect := TermBounds;
    81088120  SetFullScreen(FullScreen);
     8121  FormResize(nil); // place mini map correctly according to its size
    81098122  Timer1.Enabled := True;
    81108123end;
     
    81128125procedure TMainScreen.FormClose(Sender: TObject; var Action: TCloseAction);
    81138126begin
     8127  TermBounds := BoundsRect;
    81148128  Timer1.Enabled := False;
    81158129end;
  • trunk/Packages/CevoComponents/EOTButton.pas

    r531 r533  
    8585    end else begin
    8686      Brush.Color := $0000FF;
    87       FrameRect(Rect(0, 0, 48, 48))
     87      FrameRect(Rect(0, 0, 48, 48));
    8888    end;
    8989end;
  • trunk/Packages/CevoComponents/ScreenTools.pas

    r531 r533  
    193193  DrawBuffer: TBitmap;
    194194  FullScreen: Boolean;
     195  TermBounds: TRect;
    195196  GenerateNames: Boolean;
    196197  InitOrnamentDone: Boolean;
  • trunk/Start.pas

    r531 r533  
    407407      else ScreenMode := 1;
    408408    FullScreen := ScreenMode > 0;
     409    if ValueExists('TermLeft') then TermBounds.Left := ReadInteger('TermLeft')
     410      else TermBounds.Left := 0;
     411    if ValueExists('TermTop') then TermBounds.Top := ReadInteger('TermTop')
     412      else TermBounds.Top := 0;
     413    if ValueExists('TermWidth') then TermBounds.Width := ReadInteger('TermWidth')
     414      else TermBounds.Width := 800;
     415    if ValueExists('TermHeight') then TermBounds.Height := ReadInteger('TermHeight')
     416      else TermBounds.Height := 480;
     417
    409418    if ValueExists('MultiControl') then
    410419      MultiControl := ReadInteger('MultiControl')
     
    444453    if FullScreen then WriteInteger('ScreenMode', 1)
    445454      else WriteInteger('ScreenMode', 0);
     455    WriteInteger('TermWidth', TermBounds.Width);
     456    WriteInteger('TermHeight', TermBounds.Height);
     457    WriteInteger('TermLeft', TermBounds.Left);
     458    WriteInteger('TermTop', TermBounds.Top);
    446459    WriteInteger('MultiControl', MultiControl);
    447460    WriteInteger('StartTab', Integer(ShowTab));
Note: See TracChangeset for help on using the changeset viewer.