- Timestamp:
- Apr 9, 2021, 5:56:50 PM (4 years ago)
- Location:
- branches/highdpi
- Files:
-
- 30 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/highdpi/CmdList.pas
r303 r361 14 14 15 15 TCmdListState = record 16 nLog, { used size of LogData in bytes } 17 LoadPos, { position in LogData when loading a game } 18 LastMovingUnit: integer; 19 MoveCode, LoadMoveCode: Cardinal; 16 nLog: Integer; { used size of LogData in bytes } 17 LoadPos: Integer; { position in LogData when loading a game } 18 LastMovingUnit: Integer; 19 MoveCode: Cardinal; 20 LoadMoveCode: Cardinal; 20 21 end; 21 22 … … 72 73 end; 73 74 74 procedure TCmdList.Get(var Command, Player, Subject: integer; 75 var Data: pointer); 75 procedure TCmdList.Get(var Command, Player, Subject: integer; var Data: pointer); 76 76 var 77 DirCode, code: Cardinal; 77 DirCode: Cardinal; 78 Code: Cardinal; 78 79 begin 79 80 if FState.LoadMoveCode > 0 then … … 94 95 end; 95 96 case DirCode of 96 0: 97 Command := sMoveUnit + $090; 98 1: 99 Command := sMoveUnit + $0F0; 100 2: 101 Command := sMoveUnit + $390; 102 3: 103 Command := sMoveUnit + $3F0; 104 4: 105 Command := sMoveUnit + $020; 106 5: 107 Command := sMoveUnit + $060; 108 6: 109 Command := sMoveUnit + $100; 110 7: 111 Command := sMoveUnit + $300; 97 0: Command := sMoveUnit + $090; 98 1: Command := sMoveUnit + $0F0; 99 2: Command := sMoveUnit + $390; 100 3: Command := sMoveUnit + $3F0; 101 4: Command := sMoveUnit + $020; 102 5: Command := sMoveUnit + $060; 103 6: Command := sMoveUnit + $100; 104 7: Command := sMoveUnit + $300; 112 105 end; 113 106 Data := nil; … … 135 128 begin 136 129 FState.LoadMoveCode := code and $FF; 137 inc(FState.LoadPos) 130 inc(FState.LoadPos); 138 131 end 139 132 else … … 143 136 end; 144 137 Get(Command, Player, Subject, Data); 145 exit;138 Exit; 146 139 end; 147 140 … … 152 145 Data := @LogData[FState.LoadPos]; 153 146 inc(FState.LoadPos, Command and $F * 4); 154 end 155 end 147 end; 148 end; 156 149 end; 157 150 … … 164 157 inc(FState.LoadPos, 4); 165 158 b0 := 0; 166 while Map0 > 0 do 167 begin 168 if Map0 and 1 <> 0 then 169 begin 159 while Map0 > 0 do begin 160 if Map0 and 1 <> 0 then begin 170 161 Map1 := Cardinal((@LogData[FState.LoadPos])^); 171 162 inc(FState.LoadPos, 4); 172 163 for b1 := 0 to 31 do 173 if 1 shl b1 and Map1 <> 0 then 174 begin 164 if 1 shl b1 and Map1 <> 0 then begin 175 165 if b0 * 32 + b1 < DataSize then 176 166 PData(Data)[b0 * 32 + b1] := Cardinal((@LogData[FState.LoadPos])^); … … 180 170 inc(b0); 181 171 Map0 := Map0 shr 1; 182 end 172 end; 183 173 end; 184 174 … … 190 180 begin // move command shortcut 191 181 case Command of 192 sMoveUnit + $090: 193 DirCode := 0; 194 sMoveUnit + $0F0: 195 DirCode := 1; 196 sMoveUnit + $390: 197 DirCode := 2; 198 sMoveUnit + $3F0: 199 DirCode := 3; 200 sMoveUnit + $020: 201 DirCode := 4; 202 sMoveUnit + $060: 203 DirCode := 5; 204 sMoveUnit + $100: 205 DirCode := 6; 206 sMoveUnit + $300: 207 DirCode := 7; 182 sMoveUnit + $090: DirCode := 0; 183 sMoveUnit + $0F0: DirCode := 1; 184 sMoveUnit + $390: DirCode := 2; 185 sMoveUnit + $3F0: DirCode := 3; 186 sMoveUnit + $020: DirCode := 4; 187 sMoveUnit + $060: DirCode := 5; 188 sMoveUnit + $100: DirCode := 6; 189 sMoveUnit + $300: DirCode := 7; 208 190 end; 209 191 if Subject = FState.LastMovingUnit then … … 231 213 begin 232 214 PutData(@FState.MoveCode, 3); 233 FState.MoveCode := code 215 FState.MoveCode := code; 234 216 end; 235 217 FState.LastMovingUnit := Subject; … … 306 288 code := Cardinal(Command - sExecute) shl 2 + Cardinal(Player) shl 16; 307 289 Cardinal((@LogData[FState.nLog])^) := code; 308 FState.nLog := MapPos 290 FState.nLog := MapPos; 309 291 end; 310 292 … … 329 311 PutData(@FState.MoveCode, 3); // Single M 330 312 FState.MoveCode := 0; 331 end 313 end; 332 314 end; 333 315 … … 346 328 CompleteMoveCode; 347 329 f.write(FState.nLog, 4); 348 f.write(LogData^, FState.nLog) 330 f.write(LogData^, FState.nLog); 349 331 end; 350 332 … … 355 337 f.write(FState.nLog, 4); 356 338 f.Position := f.Position + OldState.nLog; 357 f.write(LogData[OldState.nLog], FState.nLog - OldState.nLog) 339 f.write(LogData[OldState.nLog], FState.nLog - OldState.nLog); 358 340 end; 359 341 … … 370 352 result := (FState.LoadPos shr 8) * 999 div (FState.nLog shr 8) 371 353 else 372 result := FState.LoadPos * 999 div FState.nLog 354 result := FState.LoadPos * 999 div FState.nLog; 373 355 end; 374 356 -
branches/highdpi/Direct.pas
r349 r361 60 60 case ID of 61 61 ntInitLocalHuman: begin 62 SetMainTextureByAge(-1);62 MainTexture.Age := -1; 63 63 State := -1; 64 64 Info := Phrases.Lookup('BUSY_MODLH'); 65 65 Show; 66 66 {$IFDEF LINUX} 67 // Force shown window repaint on Gtk2 widgetset 68 Sleep(1); 67 69 DpiApplication.ProcessMessages; 68 70 {$ENDIF} … … 151 153 while BiColorTextWidth(Canvas, Info) + 64 > ClientWidth do 152 154 Delete(Info, Length(Info), 1); 153 SetMainTextureByAge(-1);155 MainTexture.Age := -1; 154 156 State := -1; 155 157 Show; 156 158 {$IFDEF LINUX} 159 // Force shown window repaint on Gtk2 widgetset 160 Sleep(1); 157 161 DpiApplication.ProcessMessages; 158 162 {$ENDIF} … … 276 280 Frame(Canvas, 0, 0, ClientWidth - 1, ClientHeight - 1, 0, 0); 277 281 Frame(Canvas, 1, 1, ClientWidth - 2, ClientHeight - 2, 278 MainTexture. clBevelLight, MainTexture.clBevelShade);282 MainTexture.ColorBevelLight, MainTexture.ColorBevelShade); 279 283 Frame(Canvas, 2, 2, ClientWidth - 3, ClientHeight - 3, 280 MainTexture. clBevelLight, MainTexture.clBevelShade);284 MainTexture.ColorBevelLight, MainTexture.ColorBevelShade); 281 285 if State >= 0 then 282 286 RisedTextOut(Canvas, (ClientWidth - BiColorTextWidth(Canvas, Info)) -
branches/highdpi/GameServer.pas
r349 r361 148 148 CCData: array [0 .. 14] of integer; 149 149 bix: TBrains; { brain of the players } 150 DevModelTurn ,{ turn of last call to sResetModel }151 OriginalDataVersion: array [0 .. nPl - 1] of integer;150 DevModelTurn: array [0 .. nPl - 1] of Integer; { turn of last call to sResetModel } 151 OriginalDataVersion: array [0 .. nPl - 1] of Integer; 152 152 SavedTiles { , SavedResourceWeights } : array [0 .. ncmax - 1] of Cardinal; 153 153 SavedData: array [0 .. nPl - 1] of pointer; -
branches/highdpi/Inp.pas
r253 r361 37 37 Canvas.Brush.Style := bsClear; 38 38 TitleHeight := Height; 39 InitButtons ();39 InitButtons; 40 40 Center := true; 41 41 end; … … 46 46 Frame(Canvas, 0, 0, ClientWidth - 1, ClientHeight - 1, 0, 0); 47 47 Frame(Canvas, 1, 1, ClientWidth - 2, ClientHeight - 2, 48 MainTexture. clBevelLight, MainTexture.clBevelShade);48 MainTexture.ColorBevelLight, MainTexture.ColorBevelShade); 49 49 Frame(Canvas, 2, 2, ClientWidth - 3, ClientHeight - 3, 50 MainTexture. clBevelLight, MainTexture.clBevelShade);50 MainTexture.ColorBevelLight, MainTexture.ColorBevelShade); 51 51 EditFrame(Canvas, EInput.BoundsRect, MainTexture); 52 52 BtnFrame(Canvas, OKBtn.BoundsRect, MainTexture); … … 84 84 begin 85 85 OKBtn.Caption := Phrases.Lookup('BTN_OK'); 86 EInput.Font.Color := MainTexture. clMark;86 EInput.Font.Color := MainTexture.ColorMark; 87 87 EInput.SelStart := 0; 88 88 EInput.SelLength := Length(EInput.Text); -
branches/highdpi/LocalPlayer/Battle.pas
r349 r361 206 206 OKBtn.Caption := Phrases.Lookup('BTN_YES'); 207 207 CancelBtn.Caption := Phrases.Lookup('BTN_NO'); 208 InitButtons ();208 InitButtons; 209 209 end; 210 210 … … 243 243 end; 244 244 Frame(Canvas, Border + 1, Border + 1, ClientWidth - (2 + Border), 245 ClientHeight - (2 + Border), MainTexture. clBevelLight,246 MainTexture. clBevelShade);245 ClientHeight - (2 + Border), MainTexture.ColorBevelLight, 246 MainTexture.ColorBevelShade); 247 247 Frame(Canvas, 2 + Border, 2 + Border, ClientWidth - (3 + Border), 248 ClientHeight - (3 + Border), MainTexture. clBevelLight,249 MainTexture. clBevelShade);248 ClientHeight - (3 + Border), MainTexture.ColorBevelLight, 249 MainTexture.ColorBevelShade); 250 250 251 251 if IsSuicideQuery then -
branches/highdpi/LocalPlayer/CityScreen.pas
r349 r361 15 15 type 16 16 TCityCloseAction = (None, RestoreFocus, StepFocus); 17 TSmallMapMode = (smSupportedUnits, smImprovements); 17 18 18 19 TCityDlg = class(TBufferedDrawDlg) … … 59 60 cix: Integer; 60 61 cLoc: Integer; 61 Mode: Integer;62 SmallMapMode: TSmallMapMode; 62 63 ZoomArea: Integer; 63 64 Page: Integer; … … 73 74 CityAreaInfo: TCityAreaInfo; 74 75 AreaMap: TIsoMap; 76 NoMap: TIsoMap; 75 77 CityMapTemplate: TDpiBitmap; 76 78 SmallCityMapTemplate: TDpiBitmap; … … 82 84 ProdHint: Boolean; 83 85 AllowChange: Boolean; 86 RedTex: TTexture; 87 BarTex: TTexture; 84 88 procedure InitSmallCityMap; 85 89 procedure InitZoomCityMap; … … 109 113 110 114 const 111 { modes }112 mSupp = 1;113 mImp = 2;114 115 115 wBar = 106; 116 116 xDiv = 400; … … 197 197 begin 198 198 inherited; 199 RedTex := TTexture.Create; 200 BarTex := TTexture.Create; 201 NoMap := TIsoMap.Create; 199 202 AreaMap := TIsoMap.Create; 200 203 AreaMap.SetOutput(offscreen); 201 204 AreaMap.SetPaintBounds(xmArea - 192, ymArea - 96 - 32, xmArea + 192, 202 205 ymArea + 96); 203 Mode := mImp;206 SmallMapMode := smImprovements; 204 207 ZoomArea := 1; 205 208 ProdHint := false; … … 208 211 AgePrepared := -2; 209 212 Optimize_cixTileChange := -1; 210 InitButtons ();213 InitButtons; 211 214 // InitWindowRegion; 212 215 CloseBtn.Caption := Phrases.Lookup('BTN_OK'); … … 252 255 procedure TCityDlg.FormDestroy(Sender: TObject); 253 256 begin 257 FreeAndNil(NoMap); 254 258 FreeAndNil(AreaMap); 255 259 FreeAndNil(SmallCityMap); … … 259 263 FreeAndNil(Template); 260 264 FreeAndNil(Back); 265 FreeAndNil(RedTex); 266 FreeAndNil(BarTex); 261 267 end; 262 268 263 269 procedure TCityDlg.Reset; 264 270 begin 265 Mode := mImp;271 SmallMapMode := smImprovements; 266 272 ZoomArea := 1; 267 273 end; … … 269 275 procedure TCityDlg.CheckAge; 270 276 begin 271 if MainTextureAge <> AgePrepared then 272 begin 273 AgePrepared := MainTextureAge; 277 if MainTexture.Age <> AgePrepared then begin 278 AgePrepared := MainTexture.Age; 274 279 275 280 UnshareBitmap(Back); … … 370 375 DpiBitCanvas(ZoomCityMap.Canvas, 0, 0, wZoomMap, hZoomMap, 371 376 Back.Canvas, xZoomMap, yZoomMap); 372 if Mode = mImpthen begin377 if SmallMapMode = smImprovements then begin 373 378 if ZoomArea < 3 then begin 374 379 ImageOp_B(ZoomCityMap, CityMapTemplate, 0, 0, 376 * SizeClass, … … 388 393 procedure FillBar(x, y, pos, Growth, max, Kind: integer; 389 394 IndicateComplete: boolean); 390 var 391 Tex: TTexture; 392 begin 393 Tex := MainTexture; 394 if Kind = 3 then 395 begin 396 Tex.clBevelLight := HGrSystem.Data.Canvas.Pixels[104, 36]; 397 Tex.clBevelShade := Tex.clBevelLight; 395 begin 396 BarTex.Assign(MainTexture); 397 if Kind = 3 then begin 398 BarTex.ColorBevelLight := HGrSystem.Data.Canvas.Pixels[104, 36]; 399 BarTex.ColorBevelShade := BarTex.ColorBevelLight; 398 400 end; 399 401 PaintRelativeProgressBar(offscreen.Canvas, Kind, x - 3, y, wBar - 4, pos, 400 Growth, max, IndicateComplete, Tex);402 Growth, max, IndicateComplete, BarTex); 401 403 end; 402 404 … … 492 494 UnitInfo: TUnitInfo; 493 495 UnitReport: TUnitReport; 494 RedTex: TTexture;495 496 IsCityAlive, CanGrow: boolean; 496 497 begin … … 524 525 Report.Working := c.Size; 525 526 526 RedTex := MainTexture;527 RedTex. clBevelLight := $0000FF;528 RedTex. clBevelShade := $000000;529 RedTex. clTextLight := $000000;530 RedTex. clTextShade := $0000FF;527 RedTex.Assign(MainTexture); 528 RedTex.ColorBevelLight := $0000FF; 529 RedTex.ColorBevelShade := $000000; 530 RedTex.ColorTextLight := $000000; 531 RedTex.ColorTextShade := $0000FF; 531 532 532 533 DpiBitCanvas(offscreen.Canvas, 0, 0, 640, 480, Back.Canvas, 0, 0); … … 596 597 597 598 with AreaMap do begin 598 rx := (192 + xxt * 2 - 1) div (xxt * 2); 599 ry := (96 + yyt * 2 - 1) div (yyt * 2); 600 AreaMap.Paint(xmArea - xxt * 2 * rx, ymArea - yyt * 2 * ry - 3 * yyt, 601 dLoc(cLoc, -2 * rx + 1, -2 * ry - 1), 4 * rx - 1, 4 * ry + 1, cLoc, cOwner, 602 false, AllowChange and IsCityAlive and 603 (c.Status and csResourceWeightsMask = 0)); 604 DpiBitCanvas(offscreen.Canvas, xmArea + 102, 42, 90, 33, Back.Canvas, 605 xmArea + 102, 42); 606 607 if IsCityAlive then 608 for dy := -3 to 3 do 609 for dx := -3 to 3 do 610 if ((dx + dy) and 1 = 0) and (dx * dx * dy * dy < 81) then 611 begin 612 Loc1 := dLoc(cLoc, dx, dy); 613 av := CityAreaInfo.Available[(dy + 3) shl 2 + (dx + 3) shr 1]; 614 if ((av = faNotAvailable) or (av = faTreaty) or (av = faInvalid)) and 615 ((Loc1 < 0) or (Loc1 >= G.lx * G.ly) or (MyMap[Loc1] and fCity = 0)) 616 then 617 Sprite(offscreen, HGrTerrain, xmArea - xxt + xxt * dx, 618 ymArea - yyt + yyt * dy, xxt * 2, yyt * 2, 1 + 5 * (xxt * 2 + 1), 619 1 + yyt + 15 * (yyt * 3 + 1)); 620 if (1 shl ((dy + 3) shl 2 + (dx + 3) shr 1) and c.Tiles <> 0) then 621 PaintResources(xmArea - xxt + xxt * dx, ymArea - yyt + yyt * dy, 622 Loc1, (dx = 0) and (dy = 0)); 623 end; 599 rx := (192 + xxt * 2 - 1) div (xxt * 2); 600 ry := (96 + yyt * 2 - 1) div (yyt * 2); 601 AreaMap.Paint(xmArea - xxt * 2 * rx, ymArea - yyt * 2 * ry - 3 * yyt, 602 dLoc(cLoc, -2 * rx + 1, -2 * ry - 1), 4 * rx - 1, 4 * ry + 1, cLoc, cOwner, 603 false, AllowChange and IsCityAlive and 604 (c.Status and csResourceWeightsMask = 0)); 605 DpiBitCanvas(offscreen.Canvas, xmArea + 102, 42, 90, 33, Back.Canvas, 606 xmArea + 102, 42); 607 608 if IsCityAlive then 609 for dy := -3 to 3 do 610 for dx := -3 to 3 do 611 if ((dx + dy) and 1 = 0) and (dx * dx * dy * dy < 81) then begin 612 Loc1 := dLoc(cLoc, dx, dy); 613 av := CityAreaInfo.Available[(dy + 3) shl 2 + (dx + 3) shr 1]; 614 if ((av = faNotAvailable) or (av = faTreaty) or (av = faInvalid)) and 615 ((Loc1 < 0) or (Loc1 >= G.lx * G.ly) or (MyMap[Loc1] and fCity = 0)) 616 then 617 Sprite(offscreen, HGrTerrain, xmArea - xxt + xxt * dx, 618 ymArea - yyt + yyt * dy, xxt * 2, yyt * 2, 1 + 5 * (xxt * 2 + 1), 619 1 + yyt + 15 * (yyt * 3 + 1)); 620 if (1 shl ((dy + 3) shl 2 + (dx + 3) shr 1) and c.Tiles <> 0) then 621 PaintResources(xmArea - xxt + xxt * dx, ymArea - yyt + yyt * dy, 622 Loc1, (dx = 0) and (dy = 0)); 623 end; 624 624 end; 625 625 … … 794 794 DpiBitCanvas(offscreen.Canvas, xSmallMap, ySmallMap, wSmallMap, hSmallMap, 795 795 SmallCityMap.Canvas, 0, 0); 796 if Mode = mImpthen796 if SmallMapMode = smImprovements then 797 797 Frame(offscreen.Canvas, xSmallMap + 48 * (ZoomArea div 3), 798 798 ySmallMap + 24 * (ZoomArea mod 3), xSmallMap + 48 * (ZoomArea div 3) + 49, 799 ySmallMap + 24 * (ZoomArea mod 3) + 25, MainTexture. clMark,800 MainTexture. clMark);799 ySmallMap + 24 * (ZoomArea mod 3) + 25, MainTexture.ColorMark, 800 MainTexture.ColorMark); 801 801 Frame(offscreen.Canvas, xSmallMap - 1, ySmallMap - 1, xSmallMap + wSmallMap, 802 802 ySmallMap + hSmallMap, $B0B0B0, $FFFFFF); … … 810 810 x := xSupport + wSupport div 2; 811 811 y := ySupport + hSupport div 2; 812 if Mode = mSuppthen813 begin 814 offscreen.Canvas.brush.Color := MainTexture. clMark;812 if SmallMapMode = smSupportedUnits then 813 begin 814 offscreen.Canvas.brush.Color := MainTexture.ColorMark; 815 815 offscreen.Canvas.FillRect(Rect(x - 27, y - 6, x + 27, y + 6)); 816 816 offscreen.Canvas.brush.style := bsClear; … … 825 825 for i := 0 to 5 do 826 826 imix[i] := -1; 827 if Mode = mImpthen827 if SmallMapMode = smImprovements then 828 828 begin 829 829 if ZoomArea = 5 then … … 917 917 Imp5Area.Hint := ''; 918 918 end 919 else { if mode=mSuppthen }919 else { if SmallMapMode = smSupportedUnits then } 920 920 begin 921 921 LoweredTextout(offscreen.Canvas, -1, MainTexture, xZoomMap + 6, … … 934 934 y := ((Cnt - 6 * Page) div 3) * 52 + yZoomMap + 20; 935 935 MakeUnitInfo(me, MyUn[i], UnitInfo); 936 AreaMap.SetOutput(offscreen);937 AreaMap.PaintUnit(x, y, UnitInfo, MyUn[i].Status);936 NoMap.SetOutput(offscreen); 937 NoMap.PaintUnit(x, y, UnitInfo, MyUn[i].Status); 938 938 939 939 for j := 0 to UnitReport.FoodSupport - 1 do … … 1048 1048 else { enemy city } 1049 1049 begin 1050 Mode := mImp;1050 SmallMapMode := smImprovements; 1051 1051 Server(sGetCity, me, cLoc, GetCityData); 1052 1052 c := GetCityData.c; … … 1146 1146 (y >= ySmallMap) and (y < ySmallMap + hSmallMap) then 1147 1147 begin 1148 Mode := mImp;1148 SmallMapMode := smImprovements; 1149 1149 ZoomArea := (y - ySmallMap) * 3 div hSmallMap + 3 * 1150 1150 ((x - xSmallMap) * 2 div wSmallMap); … … 1157 1157 (y >= ySupport) and (y < ySupport + hSupport) then 1158 1158 begin 1159 Mode := mSupp;1159 SmallMapMode := smSupportedUnits; 1160 1160 Page := 0; 1161 1161 InitZoomCityMap; … … 1189 1189 ChooseProject; 1190 1190 end 1191 else if ( Mode = mImp) and (x >= xZoomMap) and (x < xZoomMap + wZoomMap) and1191 else if (SmallMapMode = smImprovements) and (x >= xZoomMap) and (x < xZoomMap + wZoomMap) and 1192 1192 (y >= yZoomMap) and (y < yZoomMap + hZoomMap) then 1193 1193 begin … … 1203 1203 if iix >= 0 then 1204 1204 if ssShift in Shift then 1205 HelpDlg.ShowNewContent( Mode or wmPersistent, hkImp, iix)1205 HelpDlg.ShowNewContent(FWindowMode or wmPersistent, hkImp, iix) 1206 1206 else if (ClientMode < scContact) then 1207 1207 with MessgExDlg do … … 1300 1300 end; 1301 1301 end 1302 else if ( Mode = mSupp) and (x >= xZoomMap) and (x < xZoomMap + wZoomMap) and1302 else if (SmallMapMode = smSupportedUnits) and (x >= xZoomMap) and (x < xZoomMap + wZoomMap) and 1303 1303 (y >= yZoomMap) and (y < yZoomMap + hZoomMap) then 1304 1304 begin … … 1321 1321 else if (x >= xmArea - 192) and (x < xmArea + 192) and (y >= ymArea - 96) 1322 1322 and (y < ymArea + 96) then 1323 with AreaMap do 1324 begin 1323 with AreaMap do begin 1325 1324 qx := ((4000 * xxt * yyt) + (x - xmArea) * (yyt * 2) + (y - ymArea + yyt) 1326 1325 * (xxt * 2)) div (xxt * yyt * 4) - 1000; … … 1335 1334 Loc1 := dLoc(cLoc, dx, dy); 1336 1335 if (Loc1 >= 0) and (Loc1 < G.lx * G.ly) then 1337 HelpOnTerrain(Loc1, Mode or wmPersistent)1336 HelpOnTerrain(Loc1, FWindowMode or wmPersistent) 1338 1337 end 1339 1338 else if (ClientMode < scContact) and (cGov <> gAnarchy) and -
branches/highdpi/LocalPlayer/CityType.pas
r349 r361 63 63 inherited; 64 64 CaptionRight := CloseBtn.Left; 65 InitButtons ();65 InitButtons; 66 66 HelpContext := 'MACRO'; 67 67 Caption := Phrases.Lookup('TITLE_CITYTYPES'); … … 71 71 procedure TCityTypeDlg.CloseBtnClick(Sender: TObject); 72 72 begin 73 Close 73 Close; 74 74 end; 75 75 … … 93 93 94 94 Frame(offscreen.Canvas, 0, yList + 32 * nListRow, InnerWidth - 255, 95 yPool - 23, MainTexture. clBevelLight, MainTexture.clBevelShade);95 yPool - 23, MainTexture.ColorBevelLight, MainTexture.ColorBevelShade); 96 96 Frame(offscreen.Canvas, InnerWidth - 254, yList + 32 * nListRow, 97 InnerWidth - 89, yPool - 23, MainTexture. clBevelLight,98 MainTexture. clBevelShade);97 InnerWidth - 89, yPool - 23, MainTexture.ColorBevelLight, 98 MainTexture.ColorBevelShade); 99 99 Frame(offscreen.Canvas, InnerWidth - 88, yList + 32 * nListRow, 100 InnerWidth - 1, yPool - 23, MainTexture. clBevelLight,101 MainTexture. clBevelShade);100 InnerWidth - 1, yPool - 23, MainTexture.ColorBevelLight, 101 MainTexture.ColorBevelShade); 102 102 Frame(offscreen.Canvas, 0, yPool - 22, InnerWidth - 1, yPool - 1, 103 MainTexture. clBevelLight, MainTexture.clBevelShade);103 MainTexture.ColorBevelLight, MainTexture.ColorBevelShade); 104 104 for i := 0 to nCityType - 1 do 105 105 begin 106 106 RFrame(offscreen.Canvas, xSwitch + i * 42, ySwitch, xSwitch + 39 + i * 42, 107 ySwitch + 23, MainTexture. clBevelShade, MainTexture.clBevelLight);107 ySwitch + 23, MainTexture.ColorBevelShade, MainTexture.ColorBevelLight); 108 108 if i = ctype then 109 109 Frame(offscreen.Canvas, xSwitch + 1 + i * 42, ySwitch + 1, 110 xSwitch + 38 + i * 42, ySwitch + 22, MainTexture. clBevelShade,111 MainTexture. clBevelLight)110 xSwitch + 38 + i * 42, ySwitch + 22, MainTexture.ColorBevelShade, 111 MainTexture.ColorBevelLight) 112 112 else 113 113 Frame(offscreen.Canvas, xSwitch + 1 + i * 42, ySwitch + 1, 114 xSwitch + 38 + i * 42, ySwitch + 22, MainTexture. clBevelLight,115 MainTexture. clBevelShade);114 xSwitch + 38 + i * 42, ySwitch + 22, MainTexture.ColorBevelLight, 115 MainTexture.ColorBevelShade); 116 116 DpiBitCanvas(offscreen.Canvas, xSwitch + 2 + i * 42, ySwitch + 2, 117 117 xSizeSmall, ySizeSmall, SmallImp.Canvas, (i + 3) * xSizeSmall, 0); … … 130 130 for i := 1 to nListRow - 1 do 131 131 DLine(offscreen.Canvas, xList - 5, xList + 4 + 42 * nListCol, 132 yList - 1 + 32 * i, MainTexture. clBevelLight, MainTexture.clBevelShade);132 yList - 1 + 32 * i, MainTexture.ColorBevelLight, MainTexture.ColorBevelShade); 133 133 for i := 0 to nListCol * nListRow - 1 do 134 134 begin 135 135 s := IntToStr(i + 1); 136 Font.Color := MainTexture. clTextLight;136 Font.Color := MainTexture.ColorTextLight; 137 137 Textout(xList + 20 + i mod nListCol * 42 - TextWidth(s) div 2, 138 138 yList + 15 + i div nListCol * 32 - TextHeight(s) div 2, s); 139 end 139 end; 140 140 end; 141 141 … … 147 147 xList + 21 + xSizeSmall div 2 + i mod nListCol * 42, 148 148 yList + 16 + ySizeSmall div 2 + i div nListCol * 32, 149 MainTexture. clBevelLight, MainTexture.clBevelShade);149 MainTexture.ColorBevelLight, MainTexture.ColorBevelShade); 150 150 DpiBitCanvas(offscreen.Canvas, xList + 21 - xSizeSmall div 2 + 151 151 i mod nListCol * 42, yList + 16 - ySizeSmall div 2 + i div nListCol * 32, … … 169 169 nPool div nPoolCol * 32, xPool + 21 + xSizeSmall div 2 + 170 170 nPool mod nPoolCol * 42, yPool + 16 + ySizeSmall div 2 + 171 nPool div nPoolCol * 32, MainTexture. clBevelLight,172 MainTexture. clBevelShade);171 nPool div nPoolCol * 32, MainTexture.ColorBevelLight, 172 MainTexture.ColorBevelShade); 173 173 DpiBitCanvas(offscreen.Canvas, xPool + 21 - xSizeSmall div 2 + 174 174 nPool mod nPoolCol * 42, yPool + 16 - ySizeSmall div 2 + … … 201 201 begin 202 202 include(listed, MyData.ImpOrder[ctype, i]); 203 inc(i) 204 end; 205 Changed := false 203 inc(i); 204 end; 205 Changed := false; 206 206 end; 207 207 … … 215 215 if (MyCity[cix].Loc >= 0) and (MyCity[cix].Status and 7 = ctype + 1) then 216 216 AutoBuild(cix, MyData.ImpOrder[ctype]); 217 Changed := false 217 Changed := false; 218 218 end; 219 219 end; … … 252 252 dragiix := MyData.ImpOrder[ctype, i]; 253 253 DpiScreen.Cursor := crImpDrag; 254 SmartUpdateContent 254 SmartUpdateContent; 255 255 end; 256 256 exit; … … 268 268 dragiix := Pooliix[i]; 269 269 DpiScreen.Cursor := crImpDrag; 270 SmartUpdateContent 270 SmartUpdateContent; 271 271 end; 272 272 exit; … … 279 279 SaveType; 280 280 LoadType(i); 281 SmartUpdateContent 282 end 281 SmartUpdateContent; 282 end; 283 283 end; 284 284 … … 318 318 MyData.ImpOrder[ctype, i] := dragiix; 319 319 include(listed, dragiix); 320 Changed := true 320 Changed := true; 321 321 end 322 322 else if (dragiix in listed) and (x >= xPool) and (x < xPool + nPoolCol * 42) … … 324 324 begin 325 325 UnList(dragiix); 326 Changed := true 326 Changed := true; 327 327 end; 328 328 dragiix := -1; 329 SmartUpdateContent 330 end; 331 DpiScreen.Cursor := crDefault 329 SmartUpdateContent; 330 end; 331 DpiScreen.Cursor := crDefault; 332 332 end; 333 333 -
branches/highdpi/LocalPlayer/ClientTools.pas
r349 r361 201 201 i: integer; 202 202 begin 203 if p = me then 204 begin 203 if p = me then begin 205 204 Result := 0; 206 205 for i := 1 to 3 do 207 206 if MyRO.Tech[AgePreq[i]] >= tsApplicable then 208 207 Result := i; 209 end 210 else 211 begin 208 end else begin 212 209 Result := 0; 213 210 for i := 1 to 3 do -
branches/highdpi/LocalPlayer/Diagram.pas
r349 r361 63 63 Canvas.Brush.Style := bsClear; 64 64 ScreenTools.Frame(canvas, Left - 1, Top - 1, Left + Width, Top + 200, 65 MainTexture. clBevelShade, MainTexture.clBevelLight);65 MainTexture.ColorBevelShade, MainTexture.ColorBevelLight); 66 66 RFrame(canvas, Left - 2, Top - 2, Left + Width + 1, Top + 200 + 1, 67 MainTexture. clBevelShade, MainTexture.clBevelLight);67 MainTexture.ColorBevelShade, MainTexture.ColorBevelLight); 68 68 69 69 // stars … … 132 132 CaptionRight := CloseBtn.Left; 133 133 CaptionLeft := ToggleBtn.Left + ToggleBtn.Width; 134 InitButtons ();134 InitButtons; 135 135 end; 136 136 … … 163 163 begin 164 164 LoweredTextOut(offscreen.canvas, -1, MainTexture, x - 2, y, Cap); 165 DLine(offscreen.canvas, x - 2, x + 169, y + 16, MainTexture. clTextShade,166 MainTexture. clTextLight);165 DLine(offscreen.canvas, x - 2, x + 169, y + 16, MainTexture.ColorTextShade, 166 MainTexture.ColorTextLight); 167 167 if val0 > 0 then 168 168 s := Format(Phrases.Lookup('SHARE'), [val0, val1]) -
branches/highdpi/LocalPlayer/Draft.pas
r349 r361 68 68 begin 69 69 inherited; 70 InitButtons ();70 InitButtons; 71 71 HelpContext := 'CLASSES'; 72 72 Caption := Phrases.Lookup('TITLE_DRAFT'); … … 183 183 Phrases.Lookup('UNITSPEED')); 184 184 DLine(offscreen.Canvas, xTotal - 2, xTotal + 174, y + 16, 185 MainTexture. clBevelShade, MainTexture.clBevelLight);185 MainTexture.ColorBevelShade, MainTexture.ColorBevelLight); 186 186 DLine(offscreen.Canvas, xTotal2 + 176, xTotal2 + 263, y + 16, 187 MainTexture. clBevelShade, MainTexture.clBevelLight);187 MainTexture.ColorBevelShade, MainTexture.ColorBevelLight); 188 188 s := MovementToString(MyRO.DevModel.Speed); 189 189 RisedTextOut(offscreen.Canvas, xTotal2 + 170 + 64 + 30 - … … 199 199 xTotal2 + 148 + 30, y, '='); 200 200 DLine(offscreen.Canvas, xTotal - 2, xTotal + 174, y + 16, 201 MainTexture. clBevelShade, MainTexture.clBevelLight);201 MainTexture.ColorBevelShade, MainTexture.ColorBevelLight); 202 202 DLine(offscreen.Canvas, xTotal2 + 176, xTotal2 + 263, y + 16, 203 MainTexture. clBevelShade, MainTexture.clBevelLight);203 MainTexture.ColorBevelShade, MainTexture.ColorBevelLight); 204 204 s := IntToStr(MyRO.DevModel.Cost); 205 205 RisedTextOut(offscreen.Canvas, xTotal2 + 170 + 64 + 30 - 12 - … … 216 216 xTotal2 + 148 + 30, y, '='); 217 217 DLine(offscreen.Canvas, xTotal - 2, xTotal + 174, y + 16, 218 MainTexture. clBevelShade, MainTexture.clBevelLight);218 MainTexture.ColorBevelShade, MainTexture.ColorBevelLight); 219 219 DLine(offscreen.Canvas, xTotal2 + 176, xTotal2 + 263, y + 16, 220 MainTexture. clBevelShade, MainTexture.clBevelLight);220 MainTexture.ColorBevelShade, MainTexture.ColorBevelLight); 221 221 s := IntToStr(MyRO.DevModel.Cost * BuildCostMod 222 222 [G.Difficulty[me]] div 12); … … 236 236 237 237 ClientHeight := Template.Height - Cut; 238 if ClientHeight > hMainTexturethen238 if ClientHeight > MainTexture.Height then 239 239 // assemble background from 2 texture tiles 240 240 begin 241 241 DpiBitCanvas(Back.Canvas, 0, 0, ClientWidth, 64, 242 MainTexture.Image.Canvas, ( wMainTexture- ClientWidth) div 2,243 hMainTexture- 64);242 MainTexture.Image.Canvas, (MainTexture.Width - ClientWidth) div 2, 243 MainTexture.Height - 64); 244 244 DpiBitCanvas(Back.Canvas, 0, 64, ClientWidth, ClientHeight - 64, 245 MainTexture.Image.Canvas, ( wMainTexture- ClientWidth) div 2,245 MainTexture.Image.Canvas, (MainTexture.Width - ClientWidth) div 2, 246 246 0); 247 247 end 248 248 else 249 249 DpiBitCanvas(Back.Canvas, 0, 0, ClientWidth, ClientHeight, 250 MainTexture.Image.Canvas, ( wMainTexture- ClientWidth) div 2,251 ( hMainTexture- ClientHeight) div 2);250 MainTexture.Image.Canvas, (MainTexture.Width - ClientWidth) div 2, 251 (MainTexture.Height - ClientHeight) div 2); 252 252 ImageOp_B(Back, Template, 0, 0, 0, 0, Template.Width, 64); 253 253 ImageOp_B(Back, Template, 0, 64, 0, 64 + Cut, Template.Width, … … 320 320 RFrame(offscreen.Canvas, xFeature - (21 + 1), 321 321 yFeature + 2 + LinePitch * i - 1, xFeature - (21 - 24), 322 yFeature + 2 + LinePitch * i + 12, MainTexture. clBevelShade,323 MainTexture. clBevelLight);322 yFeature + 2 + LinePitch * i + 12, MainTexture.ColorBevelShade, 323 MainTexture.ColorBevelLight); 324 324 end 325 325 else … … 329 329 RFrame(offscreen.Canvas, xFeature - (9 + 1), 330 330 yFeature + 2 + LinePitch * i - 1, xFeature - (21 - 24), 331 yFeature + 2 + LinePitch * i + 12, MainTexture. clBevelShade,332 MainTexture. clBevelLight);331 yFeature + 2 + LinePitch * i + 12, MainTexture.ColorBevelShade, 332 MainTexture.ColorBevelLight); 333 333 end; 334 334 … … 362 362 363 363 if MyRO.DevModel.Cap[code[i]] > 0 then 364 TextColor := MainTexture. clLitText364 TextColor := MainTexture.ColorLitText 365 365 else 366 366 TextColor := -1; -
branches/highdpi/LocalPlayer/Enhance.pas
r349 r361 65 65 CaptionRight := CloseBtn.Left; 66 66 CaptionLeft := ToggleBtn.Left + ToggleBtn.Width; 67 InitButtons ();67 InitButtons; 68 68 HelpContext := 'MACRO'; 69 69 Caption := Phrases.Lookup('TITLE_ENHANCE'); -
branches/highdpi/LocalPlayer/Help.pas
r349 r361 301 301 CaptionFont.Assign(UniFont[ftNormal]); 302 302 CaptionFont.Style := CaptionFont.Style + [fsItalic, fsBold]; 303 InitButtons ();303 InitButtons; 304 304 305 305 TopBtn.Hint := Phrases.Lookup('BTN_CONTENTS'); … … 1248 1248 MainText[Count - 1] := Format(HelpText.Lookup('REQUIRED'), 1249 1249 [MainText[Count - 1]]); 1250 end 1250 end; 1251 1251 end; 1252 end 1252 end; 1253 1253 end; 1254 1254 … … 1422 1422 LineFeed; 1423 1423 LineFeed; 1424 end 1425 end 1424 end; 1425 end; 1426 1426 end; 1427 1427 miscSearchResult: … … 1642 1642 NextSection('REPLACE'); 1643 1643 AddItem('REPLACETEXT'); 1644 j := 1 1644 j := 1; 1645 1645 end; 1646 1646 AddImprovement(ImpReplacement[i].OldImp); … … 1676 1676 AddLine(HelpText.Lookup('HELPTITLE_JOBLIST'), pkNormal, 0, 1677 1677 hkMisc + hkCrossLink, miscJobList); 1678 CheckSeeAlso := true 1678 CheckSeeAlso := true; 1679 1679 end; 1680 1680 … … 1696 1696 begin 1697 1697 TerrType := fDesert; 1698 TerrSubType := 0 1698 TerrSubType := 0; 1699 1699 end; 1700 1700 with Terrain[TerrType] do … … 1766 1766 [Phrases.Lookup('TERRAIN', fGrass + 12)]), pkTer, fGrass + 12, 1767 1767 hkTer + hkCrossLink, fGrass + 12); 1768 end 1768 end; 1769 1769 end; 1770 1770 NextSection('SPECIAL'); … … 1778 1778 AddLine(Phrases.Lookup('TERRAIN', 3 * 12 + Special), pkTer, 1779 1779 3 * 12 + Special); 1780 end 1780 end; 1781 1781 end 1782 1782 else if (no < 12) and (no <> fGrass) and (no <> fOcean) then … … 1814 1814 AddImprovement(woGardens); 1815 1815 CheckSeeAlso := true 1816 end 1817 end 1816 end; 1817 end; 1818 1818 end; 1819 1819 … … 1882 1882 AddLine(Format(HelpText.Lookup('WEIGHT'), ['+2']), 1883 1883 pkDomain, dGround); 1884 end 1884 end; 1885 1885 end; 1886 1886 if Feature[no].Preq <> preNone then … … 1969 1969 Line(Canvas, Sel0, False); 1970 1970 if Sel <> -1 then 1971 Line(Canvas, Sel, True) 1972 end 1971 Line(Canvas, Sel, True); 1972 end; 1973 1973 end; 1974 1974 … … 1992 1992 else 1993 1993 ShowNewContent(FWindowMode, Link shr 8 and $3F, Link and $FF); 1994 end 1994 end; 1995 1995 end; 1996 1996 … … 2036 2036 function THelpDlg.TextIndex(Item: string): Integer; 2037 2037 begin 2038 Result := HelpText.Gethandle(Item) 2038 Result := HelpText.Gethandle(Item); 2039 2039 end; 2040 2040 -
branches/highdpi/LocalPlayer/LocalPlayer.pas
r210 r361 5 5 6 6 procedure Client(Command, Player: integer; var Data); stdcall; 7 8 7 procedure SetAIName(p: integer; Name: string); 9 8 … … 12 11 uses 13 12 UDpiControls, Term, CityScreen, Draft, MessgEx, Select, CityType, Help, UnitStat, Diagram, 14 NatStat, Wonders, Nego, Enhance, BaseWin, Battle, Rates, TechTree, 15 16 Forms; 13 NatStat, Wonders, Nego, Enhance, BaseWin, Battle, Rates, TechTree, Forms; 17 14 18 15 var -
branches/highdpi/LocalPlayer/MessgEx.pas
r349 r361 10 10 11 11 type 12 TMessageIconKind = (mikNone, mikImp, mikModel, mikTribe, mikBook, mikAge, 13 mikPureIcon, mikMyArmy, mikEnemyArmy, mikFullControl, mikShip, mikBigIcon, 14 mikEnemyShipComplete); 15 12 16 TMessgExDlg = class(TBaseMessgDlg) 13 17 Button1: TButtonA; … … 26 30 procedure RemoveBtnClick(Sender: TObject); 27 31 public 28 Kind, IconKind, IconIndex, HelpKind, HelpNo, CenterTo: integer; 32 Kind: TMessageKind; 33 IconIndex: Integer; 34 HelpKind: Integer; 35 HelpNo: Integer; 36 CenterTo: Integer; 37 IconKind: TMessageIconKind; 29 38 OpenSound: string; 30 39 function ShowModal: integer; override; … … 38 47 end; 39 48 40 const41 // extra message kinds42 mkYesNoCancel = 4;43 mkOkCancelRemove = 5;44 mkOkHelp = 6;45 mkModel = 7;46 47 // message icon kinds48 mikNone = -1;49 mikImp = 0;50 mikModel = 1;51 mikTribe = 2;52 mikBook = 3;53 mikAge = 4;54 mikPureIcon = 5;55 mikMyArmy = 6;56 mikEnemyArmy = 7;57 mikFullControl = 8;58 mikShip = 9;59 mikBigIcon = 10;60 mikEnemyShipComplete = 11;61 62 49 var 63 50 MessgExDlg: TMessgExDlg; … … 65 52 procedure SoundMessageEx(SimpleText, SoundItem: string); 66 53 procedure TribeMessage(p: integer; SimpleText, SoundItem: string); 67 function SimpleQuery(QueryKind: integer; SimpleText, SoundItem: string)54 function SimpleQuery(QueryKind: TMessageKind; SimpleText, SoundItem: string) 68 55 : integer; 69 56 procedure ContextMessage(SimpleText, SoundItem: string; … … 199 186 function TMessgExDlg.ShowModal: integer; 200 187 var 201 Ticks0, Ticks: TDateTime; 188 Ticks0: TDateTime; 189 Ticks: TDateTime; 202 190 begin 203 191 if GameMode = cMovie then … … 357 345 if (IconKind = mikImp) and (IconIndex = 27) then 358 346 begin // "YOU WIN" message 359 clSaveTextLight := MainTexture. clTextLight;360 clSaveTextShade := MainTexture. clTextShade;361 MainTexture. clTextLight := $000000; // gold362 MainTexture. clTextShade := $0FDBFF;347 clSaveTextLight := MainTexture.ColorTextLight; 348 clSaveTextShade := MainTexture.ColorTextShade; 349 MainTexture.ColorTextLight := $000000; // gold 350 MainTexture.ColorTextShade := $0FDBFF; 363 351 inherited; 364 MainTexture. clTextLight := clSaveTextLight;365 MainTexture. clTextShade := clSaveTextShade;352 MainTexture.ColorTextLight := clSaveTextLight; 353 MainTexture.ColorTextShade := clSaveTextShade; 366 354 end 367 355 else … … 411 399 end; 412 400 mikBook: 413 PaintBook(Canvas, ClientWidth div 2, 24, MainTexture. clPage,414 MainTexture. clCover);401 PaintBook(Canvas, ClientWidth div 2, 24, MainTexture.ColorPage, 402 MainTexture.ColorCover); 415 403 mikTribe: 416 404 if Assigned(Tribe[IconIndex].faceHGr) then … … 516 504 end; 517 505 518 function SimpleQuery(QueryKind: integer; SimpleText, SoundItem: string)506 function SimpleQuery(QueryKind: TMessageKind; SimpleText, SoundItem: string) 519 507 : integer; 520 508 begin … … 524 512 OpenSound := SoundItem; 525 513 Kind := QueryKind; 526 DpiApplication.ProcessMessages; // TODO: Needed for Gtk2, Lazarus gtk2 bug?527 514 ShowModal; 528 515 result := ModalResult; -
branches/highdpi/LocalPlayer/NatStat.pas
r349 r361 81 81 GetMem(SelfReport, SizeOf(TEnemyReport) - 2 * (INFIN + 1)); 82 82 ReportText := TStringList.Create; 83 InitButtons ();83 InitButtons; 84 84 ContactBtn.Template := Templates.Data; 85 85 HelpContext := 'DIPLOMACY'; … … 107 107 procedure TNatStatDlg.CheckAge; 108 108 begin 109 if MainTextureAge <> AgePrepared then 110 begin 111 AgePrepared := MainTextureAge; 109 if MainTexture.Age <> AgePrepared then begin 110 AgePrepared := MainTexture.Age; 112 111 DpiBitCanvas(Back.Canvas, 0, 0, ClientWidth, ClientHeight, 113 MainTexture.Image.Canvas, ( wMainTexture- ClientWidth) div 2,114 ( hMainTexture- ClientHeight) div 2);112 MainTexture.Image.Canvas, (MainTexture.Width - ClientWidth) div 2, 113 (MainTexture.Height - ClientHeight) div 2); 115 114 ImageOp_B(Back, Template, 0, 0, 0, 0, ClientWidth, ClientHeight); 116 115 end; … … 358 357 with Canvas do 359 358 begin 360 Brush.Color := MainTexture. clBevelShade;359 Brush.Color := MainTexture.ColorBevelShade; 361 360 FillRect(Rect(xReport + wReport, yReport + PaperShade, 362 361 xReport + wReport + PaperShade, yReport + hReport + PaperShade)); -
branches/highdpi/LocalPlayer/Nego.pas
r349 r361 144 144 cix: integer; 145 145 begin 146 InitButtons ();146 InitButtons; 147 147 for cix := 0 to ComponentCount - 1 do 148 148 if Components[cix] is TButtonN then … … 510 510 511 511 Fill(Offscreen.Canvas, 3, 3, ClientWidth - 6, ClientHeight - 6, 512 ( wMaintexture - ClientWidth) div 2, (hMaintexture- ClientHeight) div 2);512 (Maintexture.Width - ClientWidth) div 2, (Maintexture.Height - ClientHeight) div 2); 513 513 Frame(Offscreen.Canvas, 0, 0, ClientWidth - 1, ClientHeight - 1, 0, 0); 514 514 Frame(Offscreen.Canvas, 1, 1, ClientWidth - 2, ClientHeight - 2, 515 MainTexture. clBevelLight, MainTexture.clBevelShade);515 MainTexture.ColorBevelLight, MainTexture.ColorBevelShade); 516 516 Frame(Offscreen.Canvas, 2, 2, ClientWidth - 3, ClientHeight - 3, 517 MainTexture. clBevelLight, MainTexture.clBevelShade);517 MainTexture.ColorBevelLight, MainTexture.ColorBevelShade); 518 518 Corner(Offscreen.Canvas, 1, 1, 0, MainTexture); 519 519 Corner(Offscreen.Canvas, ClientWidth - 9, 1, 1, MainTexture); … … 565 565 with Offscreen.Canvas do 566 566 begin 567 Brush.Color := MainTexture. clBevelShade;567 Brush.Color := MainTexture.ColorBevelShade; 568 568 if History[me].Text[Page - 1] <> '' then 569 569 begin -
branches/highdpi/LocalPlayer/Rates.pas
r349 r361 42 42 begin 43 43 TitleHeight := DpiScreen.Height; 44 InitButtons ();44 InitButtons; 45 45 end; 46 46 … … 56 56 57 57 Fill(Offscreen.Canvas, 0, 0, ClientWidth, ClientHeight, 58 ( wMaintexture - ClientWidth) div 2, (hMaintexture- ClientHeight) div 2);58 (Maintexture.Width - ClientWidth) div 2, (Maintexture.Height - ClientHeight) div 2); 59 59 Frame(Offscreen.Canvas, 0, 0, ClientWidth - 1, ClientHeight - 1, 0, 0); 60 60 Frame(Offscreen.Canvas, 1, 1, ClientWidth - 2, ClientHeight - 2, 61 MainTexture. clBevelLight, MainTexture.clBevelShade);61 MainTexture.ColorBevelLight, MainTexture.ColorBevelShade); 62 62 Frame(Offscreen.Canvas, 2, 2, ClientWidth - 3, ClientHeight - 3, 63 MainTexture. clBevelLight, MainTexture.clBevelShade);63 MainTexture.ColorBevelLight, MainTexture.ColorBevelShade); 64 64 65 65 BtnFrame(Offscreen.Canvas, CloseBtn.BoundsRect, MainTexture); … … 118 118 Frame(Offscreen.Canvas, x - 1, y - 1, x + max, y + 7, $000000, $000000); 119 119 RFrame(Offscreen.Canvas, x - 2, y - 2, x + max + 1, y + 8, 120 MainTexture. clBevelShade, MainTexture.clBevelLight);120 MainTexture.ColorBevelShade, MainTexture.ColorBevelLight); 121 121 with Offscreen.Canvas do 122 122 begin … … 138 138 MyRO.LuxRate * 120 div 100, 0, 120, MainTexture); 139 139 RFrame(Offscreen.Canvas, ScienceBtn.Left - 1, LuxBtn.Top - 1, 140 LuxBtn.Left + 12, LuxBtn.Top + 12, MainTexture. clBevelShade,141 MainTexture. clBevelLight);142 end; 143 144 DLine(Offscreen.Canvas, 1, ClientWidth - 2, 154, MainTexture. clBevelShade,145 MainTexture. clBevelLight);140 LuxBtn.Left + 12, LuxBtn.Top + 12, MainTexture.ColorBevelShade, 141 MainTexture.ColorBevelLight); 142 end; 143 144 DLine(Offscreen.Canvas, 1, ClientWidth - 2, 154, MainTexture.ColorBevelShade, 145 MainTexture.ColorBevelLight); 146 146 RisedTextOut(Offscreen.Canvas, 16 + 80, 164, Phrases.Lookup('TAXRATE')); 147 147 s := Format('%d%%', [MyRO.TaxRate]); … … 151 151 MyRO.TaxRate * 120 div 100, 0, 120, MainTexture); 152 152 RFrame(Offscreen.Canvas, TaxUpBtn.Left - 1, TaxUpBtn.Top - 1, 153 TaxUpBtn.Left + 12, TaxDownBtn.Top + 12, MainTexture. clBevelShade,154 MainTexture. clBevelLight);153 TaxUpBtn.Left + 12, TaxDownBtn.Top + 12, MainTexture.ColorBevelShade, 154 MainTexture.ColorBevelLight); 155 155 156 156 MarkUsedOffscreen(ClientWidth, ClientHeight); … … 206 206 SmartUpdateContent; 207 207 MainScreen.UpdateViews(true); 208 end 208 end; 209 209 end; 210 210 -
branches/highdpi/LocalPlayer/Select.pas
r349 r361 112 112 Canvas.Font.Assign(UniFont[ftNormal]); 113 113 sb := TPVScrollbar.Create(Self); 114 sb.SetBorderSpacing(36, 10, 36); 114 115 sb.OnUpdate := ScrollBarUpdate; 115 InitButtons ();116 InitButtons; 116 117 Kind := kMission; 117 118 Layer0Btn.Hint := Phrases.Lookup('BTN_IMPRS'); … … 201 202 begin 202 203 Frame(offscreen.Canvas, x + (16 - 1), y + (16 - 2), x + (16 + xSizeSmall), 203 y + (16 - 1 + ySizeSmall), MainTexture. clBevelLight,204 MainTexture. clBevelShade);204 y + (16 - 1 + ySizeSmall), MainTexture.ColorBevelLight, 205 MainTexture.ColorBevelShade); 205 206 if pix and cpType = 0 then 206 207 if (pix and cpIndex = imPalace) and (MyRO.Government <> gAnarchy) then … … 230 231 if y + TextSize.cy >= TitleHeight + InnerHeight then 231 232 TextSize.cy := TitleHeight + InnerHeight - y; 232 Fill(ca, x, y, TextSize.cx, TextSize.cy, ( wMaintexture- ClientWidth)233 div 2, ( hMaintexture- ClientHeight) div 2);233 Fill(ca, x, y, TextSize.cx, TextSize.cy, (Maintexture.Width - ClientWidth) 234 div 2, (Maintexture.Height - ClientHeight) div 2); 234 235 end; 235 236 LoweredTextOut(ca, Color, MainTexture, x, y, s); … … 259 260 begin 260 261 x := x + SideFrame; 261 y := y + TitleHeight 262 y := y + TitleHeight; 262 263 end; 263 264 if lit then 264 TextColor := MainTexture. clLitText265 TextColor := MainTexture.ColorLitText 265 266 else 266 267 TextColor := -1; … … 433 434 end; 434 435 if lit then 435 TextColor := MainTexture. clLitText436 TextColor := MainTexture.ColorLitText 436 437 else 437 438 TextColor := -1; … … 555 556 begin 556 557 Frame(offscreen.Canvas, (8 + 16 - 1), y0 - 1, (8 + 16 + 36), 557 y0 + 20, MainTexture. clBevelLight, MainTexture.clBevelShade);558 y0 + 20, MainTexture.ColorBevelLight, MainTexture.ColorBevelShade); 558 559 Dump(offscreen, HGrSystem, (8 + 16), y0, 36, 20, 223, 295) 559 560 end … … 561 562 begin 562 563 Frame(offscreen.Canvas, (8 + 16 - 1), y0 - 1, (8 + 16 + 36), 563 y0 + 20, MainTexture. clBevelLight, MainTexture.clBevelShade);564 y0 + 20, MainTexture.ColorBevelLight, MainTexture.ColorBevelShade); 564 565 Dump(offscreen, HGrSystem, (8 + 16), y0, 36, 20, 260, 295) 565 566 end … … 567 568 begin 568 569 Frame(offscreen.Canvas, (8 + 16 - 1), y0 - 1, (8 + 16 + 36), 569 y0 + 20, MainTexture. clBevelLight, MainTexture.clBevelShade);570 y0 + 20, MainTexture.ColorBevelLight, MainTexture.ColorBevelShade); 570 571 Dump(offscreen, HGrSystem, (8 + 16), y0, 36, 20, 38, 295) 571 572 end … … 574 575 Frame(offscreen.Canvas, (8 + 16 - 1), y0 - 1, 575 576 (8 + 16 + xSizeSmall), y0 + ySizeSmall, 576 MainTexture. clBevelLight, MainTexture.clBevelShade);577 MainTexture.ColorBevelLight, MainTexture.ColorBevelShade); 577 578 if AdvIcon[lix] < 84 then 578 579 DpiBitCanvas(offscreen.Canvas, (8 + 16), y0, xSizeSmall, … … 680 681 Frame(offscreen.Canvas, 8 + 16 - 1, y0 - 15 + (16 - 2), 681 682 8 + 16 + xSizeSmall, y0 - 15 + (16 - 1 + ySizeSmall), 682 MainTexture. clBevelLight, MainTexture.clBevelShade);683 MainTexture.ColorBevelLight, MainTexture.ColorBevelShade); 683 684 DpiBitCanvas(offscreen.Canvas, 8 + 16, y0 - 15 + (16 - 1), 684 685 xSizeSmall, ySizeSmall, SmallImp.Canvas, … … 711 712 end; 712 713 if lit then 713 TextColor := MainTexture. clLitText714 TextColor := MainTexture.ColorLitText 714 715 else 715 716 TextColor := -1; … … 811 812 begin 812 813 Fill(Canvas, 9, ClientHeight - 29, ClientWidth - 18, 24, 813 ( wMaintexture- ClientWidth) div 2,814 ( hMaintexture- ClientHeight) div 2);814 (Maintexture.Width - ClientWidth) div 2, 815 (Maintexture.Height - ClientHeight) div 2); 815 816 if ScienceNation >= 0 then 816 817 begin … … 828 829 ScienceNationDot.Height, Canvas, xScreen - 10, ClientHeight - 27); 829 830 ImageOp_BCC(ScienceNationDotBuffer, Templates.Data, Point(0, 0), 830 ScienceNationDot.BoundsRect, MainTexture. clBevelShade, Tribe[ScienceNation].Color);831 ScienceNationDot.BoundsRect, MainTexture.ColorBevelShade, Tribe[ScienceNation].Color); 831 832 DpiBitCanvas(Canvas, xScreen - 10, ClientHeight - 27, ScienceNationDot.Width, 832 833 ScienceNationDot.Height, ScienceNationDotBuffer.Canvas, 0, 0); … … 1531 1532 begin 1532 1533 LineDistance := 21; // looks ugly with scrollbar 1533 MaxLines := ( hMaintexture- (24 + TitleHeight + NarrowFrame))1534 MaxLines := (Maintexture.Height - (24 + TitleHeight + NarrowFrame)) 1534 1535 div LineDistance - 1; 1535 1536 end … … 1537 1538 begin 1538 1539 LineDistance := 24; 1539 MaxLines := ( hMaintexture- (24 + TitleHeight + WideFrame))1540 MaxLines := (Maintexture.Height - (24 + TitleHeight + WideFrame)) 1540 1541 div LineDistance - 1; 1541 1542 end; … … 1551 1552 if (Kind = kAdvance) and (MyData.FarTech <> adNone) or (Kind = kModels) or 1552 1553 (Kind = kEModels) then begin 1554 sb.SetBorderSpacing(56, 10, 10); 1553 1555 TitleHeight := WideFrame + 20; 1554 sb.SetBorderSpacing(56, 10, 10);1555 1556 end else begin 1557 sb.SetBorderSpacing(36, 10, 34); 1556 1558 TitleHeight := WideFrame; 1557 sb.SetBorderSpacing(36, 10, 34);1558 1559 end; 1559 1560 … … 1576 1577 ClientHeight := InnerHeight + TitleHeight + NarrowFrame; 1577 1578 end; 1578 assert(ClientHeight <= hMaintexture);1579 assert(ClientHeight <= Maintexture.Height); 1579 1580 1580 1581 TechNameSpace := 224; -
branches/highdpi/LocalPlayer/Term.pas
r351 r361 1697 1697 Controls[i].Visible := false; 1698 1698 me := -1; 1699 SetMainTextureByAge(-1);1699 MainTexture.Age := -1; 1700 1700 with Panel.Canvas do 1701 1701 begin … … 1734 1734 { if MyRO.Happened and phGameEnd<>0 then 1735 1735 begin 1736 Age :=3;1737 SetMainTextureByAge(-1);1736 Age := 3; 1737 MainTexture.Age := -1; 1738 1738 end 1739 1739 else } 1740 1740 begin 1741 1741 Age := GetAge(me); 1742 if SetMainTextureByAge(Age) then 1742 if MainTexture.Age <> Age then begin 1743 MainTexture.Age := Age; 1743 1744 EOT.Invalidate; // has visible background parts in its bounds 1745 end; 1744 1746 end; 1745 1747 // age:=MyRO.Turn mod 4; //!!! … … 1754 1756 begin 1755 1757 Age := 0; 1756 SetMainTextureByAge(-1);1758 MainTexture.Age := -1; 1757 1759 if ClientMode = cMovieTurn then 1758 1760 EOT.ButtonIndex := eotCancel … … 2544 2546 Age := 0; 2545 2547 if Command = cHelpOnly then 2546 SetMainTextureByAge(-1);2548 MainTexture.Age := -1; 2547 2549 Tribes.Init; 2548 2550 HelpDlg.UserLeft := (DpiScreen.width - HelpDlg.width) div 2; … … 4271 4273 xMini + 2 + G.lx - MapWidth div (xxt * 2), yMini + 2, 4272 4274 xMini + 1 + G.lx + MapWidth div (xxt * 2), yMini + 2 + G.ly - 1, 4273 MainTexture. clMark, MainTexture.clMark)4275 MainTexture.ColorMark, MainTexture.ColorMark) 4274 4276 else 4275 4277 Frame(Panel.Canvas, 4276 4278 xMini + 2 + G.lx - MapWidth div (xxt * 2), yMini + 2 + yw, 4277 4279 xMini + 1 + G.lx + MapWidth div (xxt * 2), yMini + yw + MapHeight div yyt, 4278 MainTexture. clMark, MainTexture.clMark);4280 MainTexture.ColorMark, MainTexture.ColorMark); 4279 4281 end; 4280 4282 end; … … 4307 4309 begin 4308 4310 Fill(Panel.Canvas, 0, 3, xMidPanel + 7 - 10, PanelHeight - 3, 4309 wMainTexture - (xMidPanel + 7 - 10), hMainTexture- PanelHeight);4311 MainTexture.Width - (xMidPanel + 7 - 10), MainTexture.Height - PanelHeight); 4310 4312 Fill(Panel.Canvas, xRightPanel + 10 - 7, 3, Panel.width - xRightPanel - 10 + 4311 7, PanelHeight - 3, -(xRightPanel + 10 - 7), hMainTexture- PanelHeight);4313 7, PanelHeight - 3, -(xRightPanel + 10 - 7), MainTexture.Height - PanelHeight); 4312 4314 FillLarge(Panel.Canvas, xMidPanel - 2, PanelHeight - MidPanelHeight, 4313 4315 xRightPanel + 2, PanelHeight, ClientWidth div 2); … … 4321 4323 LineTo(xRightPanel, 0); 4322 4324 LineTo(ClientWidth, 0); 4323 Pen.Color := MainTexture. clBevelLight;4325 Pen.Color := MainTexture.ColorBevelLight; 4324 4326 MoveTo(xMidPanel + 7 - 9, PanelHeight - MidPanelHeight + 2); 4325 4327 LineTo(xRightPanel + 10 - 8, PanelHeight - MidPanelHeight + 2); 4326 Pen.Color := MainTexture. clBevelLight;4328 Pen.Color := MainTexture.ColorBevelLight; 4327 4329 MoveTo(0, 1); 4328 4330 LineTo(xMidPanel + 7 - 9, 1); 4329 Pen.Color := MainTexture. clBevelShade;4331 Pen.Color := MainTexture.ColorBevelShade; 4330 4332 LineTo(xMidPanel + 7 - 9, PanelHeight - MidPanelHeight + 1); 4331 Pen.Color := MainTexture. clBevelLight;4333 Pen.Color := MainTexture.ColorBevelLight; 4332 4334 LineTo(xRightPanel + 10 - 9, PanelHeight - MidPanelHeight + 1); 4333 Pen.Color := MainTexture. clBevelLight;4335 Pen.Color := MainTexture.ColorBevelLight; 4334 4336 LineTo(xRightPanel + 10 - 9, 1); 4335 4337 LineTo(ClientWidth, 1); … … 4339 4341 MoveTo(0, 2); 4340 4342 LineTo(xMidPanel + 7 - 10, 2); 4341 Pen.Color := MainTexture. clBevelShade;4343 Pen.Color := MainTexture.ColorBevelShade; 4342 4344 LineTo(xMidPanel + 7 - 10, PanelHeight); 4343 4345 Corner(Panel.Canvas, xMidPanel + 7 - 16, 1, 1, MainTexture); … … 4478 4480 ScreenTools.Frame(Panel.Canvas, xTroop + 1 + x, 4479 4481 yTroop + 6 - yyt div 2, xTroop + 2 * xxt - 1 + x, 4480 yTroop + 2 * yyt + 10, MainTexture. clMark, MainTexture.clMark);4482 yTroop + 2 * yyt + 10, MainTexture.ColorMark, MainTexture.ColorMark); 4481 4483 end; 4482 4484 end; … … 4596 4598 else 4597 4599 x := xTroop - 152; 4598 Pen.Color := MainTexture. clBevelShade;4600 Pen.Color := MainTexture.ColorBevelShade; 4599 4601 MoveTo(x - 1, PanelHeight - MidPanelHeight + 2); 4600 4602 LineTo(x - 1, PanelHeight); 4601 Pen.Color := MainTexture. clBevelLight;4603 Pen.Color := MainTexture.ColorBevelLight; 4602 4604 MoveTo(x, PanelHeight - MidPanelHeight + 2); 4603 4605 LineTo(x, PanelHeight); … … 4637 4639 ScreenTools.Frame(Panel.Canvas, xTroop + 3 + x, 4638 4640 yTroop + 2, xTroop + 63 + x, yTroop + 46, 4639 MainTexture. clMark, MainTexture.clMark);4641 MainTexture.ColorMark, MainTexture.ColorMark); 4640 4642 end 4641 4643 else if (unx.Master >= 0) and (unx.Master = UnFocus) then … … 4644 4646 xTroop + 64 + x, yTroop + 47, 8, $000000); 4645 4647 CFrame(Panel.Canvas, xTroop + 3 + x, yTroop + 2, 4646 xTroop + 63 + x, yTroop + 46, 8, MainTexture. clMark);4648 xTroop + 63 + x, yTroop + 46, 8, MainTexture.ColorMark); 4647 4649 end; 4648 4650 NoMapPanel.SetOutput(Panel); … … 4739 4741 RFrame(Panel.Canvas, Left - 1, Top - self.ClientHeight + 4740 4742 (PanelHeight - 1), Left + width, Top + height - self.ClientHeight + 4741 PanelHeight, MainTexture. clBevelShade, MainTexture.clBevelLight)4743 PanelHeight, MainTexture.ColorBevelShade, MainTexture.ColorBevelLight) 4742 4744 end; { if TroopLoc>=0 } 4743 4745 end; … … 4755 4757 RFrame(Panel.Canvas, Left - 1, Top - self.ClientHeight + 4756 4758 (PanelHeight - 1), Left + width, Top + height - self.ClientHeight + 4757 PanelHeight, MainTexture. clBevelShade, MainTexture.clBevelLight);4759 PanelHeight, MainTexture.ColorBevelShade, MainTexture.ColorBevelLight); 4758 4760 end; 4759 4761 end; … … 4769 4771 RFrame(Panel.Canvas, Left - 1, Top - self.ClientHeight + 4770 4772 (PanelHeight - 1), Left + width, Top + height - self.ClientHeight + 4771 PanelHeight, MainTexture. clBevelShade, MainTexture.clBevelLight);4773 PanelHeight, MainTexture.ColorBevelShade, MainTexture.ColorBevelLight); 4772 4774 end; 4773 4775 end; … … 4786 4788 MoveTo(0, TopBarHeight - 1); 4787 4789 LineTo(ClientWidth, TopBarHeight - 1); 4788 Pen.Color := MainTexture. clBevelShade;4790 Pen.Color := MainTexture.ColorBevelShade; 4789 4791 MoveTo(0, TopBarHeight - 2); 4790 4792 LineTo(ClientWidth, TopBarHeight - 2); 4791 4793 MoveTo(0, TopBarHeight - 3); 4792 4794 LineTo(ClientWidth, TopBarHeight - 3); 4793 Pen.Color := MainTexture. clBevelLight;4795 Pen.Color := MainTexture.ColorBevelLight; 4794 4796 ScreenTools.Frame(TopBar.Canvas, 40, -1, xTreasurySection - 1, 4795 TopBarHeight - 7, MainTexture. clBevelShade, MainTexture.clBevelLight);4797 TopBarHeight - 7, MainTexture.ColorBevelShade, MainTexture.ColorBevelLight); 4796 4798 ScreenTools.Frame(TopBar.Canvas, xResearchSection + 332, -1, ClientWidth, 4797 TopBarHeight - 7, MainTexture. clBevelShade, MainTexture.clBevelLight);4799 TopBarHeight - 7, MainTexture.ColorBevelShade, MainTexture.ColorBevelLight); 4798 4800 end; 4799 4801 if GameMode <> cMovie then … … 5230 5232 Frame(Panel.Canvas, xMini + 2 + G.lx - MapWidth div (2 * xxt), 5231 5233 yMini + 2, xMini + 1 + G.lx + MapWidth div (2 * xxt), 5232 yMini + 2 + G.ly - 1, MainTexture. clMark, MainTexture.clMark)5234 yMini + 2 + G.ly - 1, MainTexture.ColorMark, MainTexture.ColorMark) 5233 5235 else 5234 5236 Frame(Panel.Canvas, xMini + 2 + G.lx - MapWidth div (2 * xxt), 5235 5237 yMini + 2 + yw, xMini + 2 + G.lx + MapWidth div (2 * xxt) - 1, 5236 yMini + 2 + yw + MapHeight div yyt - 2, MainTexture. clMark,5237 MainTexture. clMark);5238 yMini + 2 + yw + MapHeight div yyt - 2, MainTexture.ColorMark, 5239 MainTexture.ColorMark); 5238 5240 end; 5239 5241 RectInvalidate(xMini + 2, TopBarHeight + MapHeight - overlap + yMini + 2, … … 7498 7500 Frame(Buffer.Canvas, x - xMini - 2 - MapWidth div (xxt * 2), 0, 7499 7501 x - xMini - 2 + MapWidth div (xxt * 2) - 1, G.ly - 1, 7500 MainTexture. clMark, MainTexture.clMark)7502 MainTexture.ColorMark, MainTexture.ColorMark) 7501 7503 else 7502 7504 Frame(Buffer.Canvas, x - xMini - 2 - MapWidth div (xxt * 2), yw, 7503 7505 x - xMini - 2 + MapWidth div (xxt * 2) - 1, yw + MapHeight div yyt - 7504 2, MainTexture. clMark, MainTexture.clMark);7506 2, MainTexture.ColorMark, MainTexture.ColorMark); 7505 7507 DpiBitCanvas(Panel.Canvas, xMini + 2, yMini + 2, G.lx * 2, G.ly, 7506 7508 Buffer.Canvas, 0, 0); … … 8036 8038 8037 8039 end. 8040 -
branches/highdpi/LocalPlayer/UnitStat.lfm
r210 r361 1 1 object UnitStatDlg: TUnitStatDlg 2 2 Left = 344 3 Height = 3263 Height = 489 4 4 Top = 213 5 Width = 2085 Width = 312 6 6 BorderStyle = bsNone 7 ClientHeight = 3268 ClientWidth = 2087 ClientHeight = 489 8 ClientWidth = 312 9 9 Color = clBtnFace 10 DesignTimePPI = 144 10 11 Font.Color = clWindowText 11 Font.Height = - 1312 Font.Height = -20 12 13 Font.Name = 'MS Sans Serif' 13 14 FormStyle = fsStayOnTop … … 16 17 OnDestroy = FormDestroy 17 18 OnShow = FormShow 18 LCLVersion = ' 1.6.2.0'19 LCLVersion = '2.0.12.0' 19 20 object SwitchBtn: TButtonB 20 Left = 1 221 Height = 2522 Top = 2923 Width = 2521 Left = 18 22 Height = 38 23 Top = 44 24 Width = 38 24 25 Down = False 25 26 Permanent = False … … 28 29 end 29 30 object CloseBtn: TButtonB 30 Left = 17731 Height = 2532 Top = 633 Width = 2531 Left = 266 32 Height = 38 33 Top = 9 34 Width = 38 34 35 Down = False 35 36 Permanent = False … … 38 39 end 39 40 object ConscriptsBtn: TButtonB 40 Left = 4341 Height = 2542 Top = 2943 Width = 2541 Left = 64 42 Height = 38 43 Top = 44 44 Width = 38 44 45 Down = False 45 46 Permanent = False … … 48 49 end 49 50 object HelpBtn: TButtonC 50 Left = 17851 Height = 1 252 Top = 14553 Width = 1 251 Left = 267 52 Height = 18 53 Top = 218 54 Width = 18 54 55 Down = False 55 56 Permanent = False -
branches/highdpi/LocalPlayer/UnitStat.pas
r349 r361 77 77 AgePrepared := -2; 78 78 TitleHeight := DpiScreen.Height; 79 InitButtons ();79 InitButtons; 80 80 81 81 Back := TDpiBitmap.Create; … … 98 98 procedure TUnitStatDlg.CheckAge; 99 99 begin 100 if MainTextureAge <> AgePrepared then 101 begin 102 AgePrepared := MainTextureAge; 100 if MainTexture.Age <> AgePrepared then begin 101 AgePrepared := MainTexture.Age; 103 102 DpiBitCanvas(Back.Canvas, 0, 0, wCommon, hOwnModel, 104 MainTexture.Image.Canvas, ( wMainTexture- wCommon) div 2,105 ( hMainTexture- hOwnModel) div 2);103 MainTexture.Image.Canvas, (MainTexture.Width - wCommon) div 2, 104 (MainTexture.Height - hOwnModel) div 2); 106 105 DpiBitCanvas(Back.Canvas, wCommon, 0, wCommon, hEnemyModel, 107 MainTexture.Image.Canvas, ( wMainTexture- wCommon) div 2,108 ( hMainTexture- hEnemyModel) div 2);106 MainTexture.Image.Canvas, (MainTexture.Width - wCommon) div 2, 107 (MainTexture.Height - hEnemyModel) div 2); 109 108 DpiBitCanvas(Back.Canvas, 2 * wCommon, 0, wCommon, hEnemyUnit, 110 MainTexture.Image.Canvas, ( wMainTexture- wCommon) div 2,111 ( hMainTexture- hEnemyUnit) div 2);109 MainTexture.Image.Canvas, (MainTexture.Width - wCommon) div 2, 110 (MainTexture.Height - hEnemyUnit) div 2); 112 111 DpiBitCanvas(Back.Canvas, 3 * wCommon, 0, wCommon, hEnemyCityDefense, 113 MainTexture.Image.Canvas, ( wMainTexture- wCommon) div 2,114 ( hMainTexture- hEnemyCityDefense) div 2);112 MainTexture.Image.Canvas, (MainTexture.Width - wCommon) div 2, 113 (MainTexture.Height - hEnemyCityDefense) div 2); 115 114 DpiBitCanvas(Back.Canvas, 4 * wCommon, 0, wCommon, hEnemyCity, 116 MainTexture.Image.Canvas, ( wMainTexture- wCommon) div 2,117 ( hMainTexture- hEnemyCity) div 2);115 MainTexture.Image.Canvas, (MainTexture.Width - wCommon) div 2, 116 (MainTexture.Height - hEnemyCity) div 2); 118 117 ImageOp_B(Back, Template, 0, 0, 0, 0, 5 * wCommon, hMax); 119 end 118 end; 120 119 end; 121 120 … … 151 150 dec(ecixShow); 152 151 assert(ecixShow >= 0); 153 end 152 end; 154 153 end; 155 154 case Kind of … … 297 296 result := (PPicture.HGr = PTestPicture.HGr) and 298 297 (PPicture.pix = PTestPicture.pix) and 299 (ModelHash(mox^) = ModelHash(MyRO.EnemyModel[emix])) 298 (ModelHash(mox^) = ModelHash(MyRO.EnemyModel[emix])); 300 299 end 301 300 else 302 301 result := (MyRO.EnemyModel[emix].owner = mox.owner) and 303 (MyRO.EnemyModel[emix].mix = mox.mix) 302 (MyRO.EnemyModel[emix].mix = mox.mix); 304 303 end; 305 304 306 305 procedure FeatureBar(dst: TDpiBitmap; x, y: integer; const mi: TModelInfo; 307 constT: TTexture);306 T: TTexture); 308 307 var 309 308 i, w, dx, num: integer; … … 371 370 end; { featurebar } 372 371 373 procedure NumberBarS(dst: TDpiBitmap; x, y: integer; Cap, s: string; 374 const T: TTexture); 375 begin 376 DLine(dst.Canvas, x - 2, x + 170, y + 16, T.clBevelShade, T.clBevelLight); 372 procedure NumberBarS(dst: TDpiBitmap; x, y: integer; Cap, s: string; T: TTexture); 373 begin 374 DLine(dst.Canvas, x - 2, x + 170, y + 16, T.ColorBevelShade, T.ColorBevelLight); 377 375 LoweredTextOut(dst.Canvas, -1, T, x - 2, y, Cap); 378 376 RisedTextout(dst.Canvas, x + 170 - BiColorTextWidth(dst.Canvas, s), y, s); … … 437 435 begin 438 436 case i of 439 0: 440 j := imWalls; 441 1: 442 j := imCoastalFort; 443 2: 444 j := imMissileBat; 445 3: 446 j := imBunker 437 0: j := imWalls; 438 1: j := imCoastalFort; 439 2: j := imMissileBat; 440 3: j := imBunker 447 441 end; 448 442 Frame(offscreen.Canvas, x - 1, yImp - 1, x + xSizeSmall, 449 yImp + ySizeSmall, MainTexture. clBevelLight,450 MainTexture. clBevelShade);443 yImp + ySizeSmall, MainTexture.ColorBevelLight, 444 MainTexture.ColorBevelShade); 451 445 DpiBitCanvas(offscreen.Canvas, x, yImp, xSizeSmall, ySizeSmall, 452 446 SmallImp.Canvas, j mod 7 * xSizeSmall, 453 447 (j + SystemIconLines * 7) div 7 * ySizeSmall); 454 inc(x, xSizeSmall + 4) 448 inc(x, xSizeSmall + 4); 455 449 end; 456 450 end; … … 469 463 if IsToCount(MyRO.EnemyUn[MyRO.nEnemyUn + uix].emix) then 470 464 inc(Available); 471 end 465 end; 472 466 end 473 467 else // no supervisor -- can only count stack top units … … 512 506 begin 513 507 MakeUnitInfo(me, MyUn[uixShow], ui); 514 MakeModelInfo(me, MyUn[uixShow].mix, MyModel[MyUn[uixShow].mix], mi) 508 MakeModelInfo(me, MyUn[uixShow].mix, MyModel[MyUn[uixShow].mix], mi); 515 509 end 516 510 else … … 518 512 mi := mox^; 519 513 if Kind in [dkEnemyUnit, dkEnemyCityDefense] then 520 ui := MyRO.EnemyUn[euixShow] 514 ui := MyRO.EnemyUn[euixShow]; 521 515 end; 522 516 … … 527 521 begin 528 522 { Frame(offscreen.canvas,xView-1,yView-1,xView+64,yView+48, 529 MainTexture. clBevelShade,MainTexture.clBevelLight);523 MainTexture.ColorBevelShade,MainTexture.ColorBevelLight); 530 524 RFrame(offscreen.canvas,xView-2,yView-2,xView+65,yView+49, 531 MainTexture. clBevelShade,MainTexture.clBevelLight); }525 MainTexture.ColorBevelShade,MainTexture.ColorBevelLight); } 532 526 with offscreen.Canvas do 533 527 begin … … 541 535 begin 542 536 x := 1 + 2 * (xxt * 2 + 1); 543 y := 1 + yyt + 2 * (yyt * 3 + 1) 537 y := 1 + yyt + 2 * (yyt * 3 + 1); 544 538 end 545 539 else 546 540 begin 547 541 x := integer(MyMap[Loc] and fTerrain) * (xxt * 2 + 1) + 1; 548 y := 1 + yyt 542 y := 1 + yyt; 549 543 end; 550 544 for j := -1 to 1 do … … 594 588 (ClientWidth - BiColorTextWidth(offscreen.Canvas, s)) div 2, 595 589 yView + 80, s); 596 end 590 end; 597 591 end 598 592 else … … 615 609 Phrases.Lookup('UNITCOST')); 616 610 DLine(offscreen.Canvas, xTotal - 2, xTotal + 170, yTotal + 57 + 16, 617 MainTexture. clBevelShade, MainTexture.clBevelLight);611 MainTexture.ColorBevelShade, MainTexture.ColorBevelLight); 618 612 if G.Difficulty[me] = 0 then 619 613 s := IntToStr(mi.cost) … … 636 630 (yTotal + StatDown - 19), Phrases.Lookup('UNITINTRO')); 637 631 DLine(offscreen.Canvas, xTotal - 2, xTotal + 170, 638 (yTotal + StatDown - 19) + 16, MainTexture. clTextShade,639 MainTexture. clTextLight);632 (yTotal + StatDown - 19) + 16, MainTexture.ColorTextShade, 633 MainTexture.ColorTextLight); 640 634 s := TurnToString(MyModel[mixShow].IntroTurn); 641 635 RisedTextout(offscreen.Canvas, … … 675 669 ConscriptsBtn.ButtonIndex := 29; 676 670 ConscriptsBtn.Hint := Phrases.Lookup('BTN_ALLOWCONSCRIPTS'); 677 end 671 end; 678 672 end 679 673 else if Kind = dkEnemyModel then … … 685 679 NumberBar(offscreen, xTotal, yTotal + StatDown, 686 680 Phrases.Lookup('UNITKNOWN'), Available, MainTexture); 687 end 681 end; 688 682 end; 689 683 end; … … 705 699 procedure TUnitStatDlg.ModelBoxChange(Sender: TObject); 706 700 begin 707 SmartUpdateContent 701 SmartUpdateContent; 708 702 end; 709 703 … … 720 714 SwitchBtn.ButtonIndex := 11; 721 715 SwitchBtn.Hint := Phrases.Lookup('BTN_NONOBSOLETE'); 722 end 716 end; 723 717 end; 724 718 … … 735 729 ConscriptsBtn.ButtonIndex := 29; 736 730 ConscriptsBtn.Hint := Phrases.Lookup('BTN_ALLOWCONSCRIPTS'); 737 end 731 end; 738 732 end; 739 733 740 734 procedure TUnitStatDlg.HelpBtnClick(Sender: TObject); 741 735 begin 742 HelpDlg.ShowNewContent(wmPersistent, hkModel, 0) 736 HelpDlg.ShowNewContent(wmPersistent, hkModel, 0); 743 737 end; 744 738 -
branches/highdpi/LocalPlayer/Wonders.pas
r349 r361 199 199 200 200 Fill(Offscreen.Canvas, 3, 3, ClientWidth - 6, ClientHeight - 6, 201 ( wMaintexture - ClientWidth) div 2, (hMaintexture- ClientHeight) div 2);201 (Maintexture.Width - ClientWidth) div 2, (Maintexture.Height - ClientHeight) div 2); 202 202 Frame(Offscreen.Canvas, 0, 0, ClientWidth - 1, ClientHeight - 1, 0, 0); 203 203 Frame(Offscreen.Canvas, 1, 1, ClientWidth - 2, ClientHeight - 2, 204 MainTexture. clBevelLight, MainTexture.clBevelShade);204 MainTexture.ColorBevelLight, MainTexture.ColorBevelShade); 205 205 Frame(Offscreen.Canvas, 2, 2, ClientWidth - 3, ClientHeight - 3, 206 MainTexture. clBevelLight, MainTexture.clBevelShade);206 MainTexture.ColorBevelLight, MainTexture.ColorBevelShade); 207 207 Corner(Offscreen.Canvas, 1, 1, 0, MainTexture); 208 208 Corner(Offscreen.Canvas, ClientWidth - 9, 1, 1, MainTexture); … … 230 230 Fill(Offscreen.Canvas, Center.X - xSizeBig div 2 + RingPosition[I].X - 3, 231 231 Center.Y - ySizeBig div 2 + RingPosition[I].Y - 3, xSizeBig + 6, 232 ySizeBig + 6, ( wMaintexture- ClientWidth) div 2,233 ( hMaintexture- ClientHeight) div 2);232 ySizeBig + 6, (Maintexture.Width - ClientWidth) div 2, 233 (Maintexture.Height - ClientHeight) div 2); 234 234 end; 235 235 WonderDestroyed: begin … … 308 308 begin 309 309 Fill(Canvas, 9, ClientHeight - 3 - 46, ClientWidth - 18, 44, 310 ( wMaintexture - ClientWidth) div 2, (hMaintexture- ClientHeight) div 2);310 (Maintexture.Width - ClientWidth) div 2, (Maintexture.Height - ClientHeight) div 2); 311 311 if Selection >= 0 then 312 312 begin … … 318 318 (ClientWidth-BiColorTextWidth(Canvas,S)) div 2+1, 319 319 ClientHeight-3-36+1, S); 320 Canvas.Font.Color:=MainTexture. clBevelLight;320 Canvas.Font.Color:=MainTexture.ColorBevelLight; 321 321 Canvas.TextOut( 322 322 (ClientWidth-BiColorTextWidth(Canvas,S)) div 2, -
branches/highdpi/Messg.pas
r210 r361 12 12 13 13 type 14 TMessageKind = (mkOK, mkOKCancel, mkYesNo, mkYesNoCancel, mkOkCancelRemove, 15 mkOkHelp, mkModel); 16 14 17 TMessgDlg = class(TBaseMessgDlg) 15 18 Button1: TButtonA; … … 22 25 procedure FormKeyPress(Sender: TObject; var Key: char); 23 26 public 24 Kind: integer;27 Kind: TMessageKind; 25 28 OpenSound: string; 26 29 private 27 30 procedure OnPlaySound(var Msg: TMessage); message WM_PLAYSOUND; 28 31 end; 29 30 const31 // message kinds32 mkOK = 1;33 mkOKCancel = 2;34 mkYesNo = 3;35 32 36 33 var -
branches/highdpi/NoTerm.pas
r303 r361 80 80 Canvas.Font.Assign(UniFont[ftSmall]); 81 81 TitleHeight := 36; 82 InitButtons ();82 InitButtons; 83 83 LastShowYearTime := 0; 84 84 end; … … 310 310 Frame(Canvas, 0, 0, ClientWidth - 1, ClientHeight - 1, $000000, $000000); 311 311 Frame(Canvas, 1, 1, ClientWidth - 2, ClientHeight - 2, 312 MainTexture. clBevelLight, MainTexture.clBevelShade);312 MainTexture.ColorBevelLight, MainTexture.ColorBevelShade); 313 313 Frame(Canvas, 2, 2, ClientWidth - 3, ClientHeight - 3, 314 MainTexture. clBevelLight, MainTexture.clBevelShade);314 MainTexture.ColorBevelLight, MainTexture.ColorBevelShade); 315 315 Corner(Canvas, 1, 1, 0, MainTexture); 316 316 Corner(Canvas, ClientWidth - 9, 1, 1, MainTexture); … … 325 325 begin 326 326 Frame(Canvas, xBrain[i] - 24, yBrain[i] - 8 - 16, xBrain[i] - 24 + 111, 327 yBrain[i] - 8 - 16 + 111, MainTexture. clBevelShade,328 MainTexture. clBevelShade);327 yBrain[i] - 8 - 16 + 111, MainTexture.ColorBevelShade, 328 MainTexture.ColorBevelShade); 329 329 FrameImage(Canvas, PlayersBrain[i].Picture, xBrain[i], 330 330 yBrain[i] - 16, 64, 64, 0, 0); -
branches/highdpi/Packages/CevoComponents/BaseWin.pas
r349 r361 292 292 procedure CornerFrame(x0, y0, x1, y1: integer); 293 293 begin 294 Frame(Canvas, x0 + 1, y0 + 1, x1 - 2, y1 - 2, MainTexture. clBevelLight,295 MainTexture. clBevelShade);296 Frame(Canvas, x0 + 2, y0 + 2, x1 - 3, y1 - 3, MainTexture. clBevelLight,297 MainTexture. clBevelShade);294 Frame(Canvas, x0 + 1, y0 + 1, x1 - 2, y1 - 2, MainTexture.ColorBevelLight, 295 MainTexture.ColorBevelShade); 296 Frame(Canvas, x0 + 2, y0 + 2, x1 - 3, y1 - 3, MainTexture.ColorBevelLight, 297 MainTexture.ColorBevelShade); 298 298 Corner(Canvas, x0 + 1, y0 + 1, 0, MainTexture); 299 299 Corner(Canvas, x1 - 9, y0 + 1, 1, MainTexture); … … 318 318 l := BiColorTextWidth(Canvas, Caption); 319 319 Cut := (ClientWidth - l) div 2; 320 xTexOffset := ( wMaintexture- ClientWidth) div 2;321 yTexOffset := ( hMaintexture- ClientHeight) div 2;320 xTexOffset := (Maintexture.Width - ClientWidth) div 2; 321 yTexOffset := (Maintexture.Height - ClientHeight) div 2; 322 322 if WideBottom then 323 323 InnerBottom := ClientHeight - WideFrame … … 345 345 Frame(Canvas, 0, FrameTop, ClientWidth - 1, FrameBottom - 1, 0, 0); 346 346 Frame(Canvas, SideFrame - 1, TitleHeight - 1, ClientWidth - SideFrame, 347 InnerBottom, MainTexture. clBevelShade, MainTexture.clBevelLight);347 InnerBottom, MainTexture.ColorBevelShade, MainTexture.ColorBevelLight); 348 348 // RFrame(Canvas,SideFrame-2,TitleHeight-2,ClientWidth-SideFrame+1, 349 // InnerBottom+1,MainTexture. clBevelShade,MainTexture.clBevelLight);349 // InnerBottom+1,MainTexture.ColorBevelShade,MainTexture.ColorBevelLight); 350 350 if FullCaption then 351 351 begin … … 367 367 4, xTexOffset, yTexOffset); 368 368 CornerFrame(0, FrameTop, ClientWidth, FrameBottom); 369 Pen.Color := MainTexture. clBevelShade;369 Pen.Color := MainTexture.ColorBevelShade; 370 370 MoveTo(3 + ModalFrameIndent, 2); 371 371 LineTo(3 + ModalFrameIndent, TitleHeight); 372 Pen.Color := MainTexture. clBevelShade;372 Pen.Color := MainTexture.ColorBevelShade; 373 373 MoveTo(4 + ModalFrameIndent, TitleHeight - 1); 374 374 LineTo(ClientWidth - 4 - ModalFrameIndent, TitleHeight - 1); 375 375 LineTo(ClientWidth - 4 - ModalFrameIndent, 1); 376 Pen.Color := MainTexture. clBevelLight;376 Pen.Color := MainTexture.ColorBevelLight; 377 377 MoveTo(ClientWidth - 5 - ModalFrameIndent, 2); 378 378 LineTo(4 + ModalFrameIndent, 2); … … 380 380 MoveTo(ClientWidth - 4 - ModalFrameIndent, 1); 381 381 LineTo(3 + ModalFrameIndent, 1); 382 Pen.Color := MainTexture. clBevelLight;382 Pen.Color := MainTexture.ColorBevelLight; 383 383 MoveTo(ClientWidth - 3 - ModalFrameIndent, 3); 384 384 LineTo(ClientWidth - 3 - ModalFrameIndent, TitleHeight); … … 397 397 398 398 Frame(Canvas, CaptionLeft + 1, 0 + 1, ClientWidth - CaptionLeft - 2, 399 TitleHeight - 1, MainTexture. clBevelLight, MainTexture.clBevelShade);399 TitleHeight - 1, MainTexture.ColorBevelLight, MainTexture.ColorBevelShade); 400 400 Frame(Canvas, CaptionLeft + 2, 0 + 2, ClientWidth - CaptionLeft - 3, 401 TitleHeight - 1, MainTexture. clBevelLight, MainTexture.clBevelShade);401 TitleHeight - 1, MainTexture.ColorBevelLight, MainTexture.ColorBevelShade); 402 402 Corner(Canvas, CaptionLeft + 1, 0 + 1, 0, MainTexture); 403 403 Corner(Canvas, ClientWidth - CaptionLeft - 9, 0 + 1, 1, MainTexture); … … 405 405 with Canvas do 406 406 begin 407 Pen.Color := MainTexture. clBevelShade;407 Pen.Color := MainTexture.ColorBevelShade; 408 408 MoveTo(CaptionLeft + 1, FrameTop + 2); 409 409 LineTo(CaptionLeft + 1, TitleHeight); 410 Pen.Color := MainTexture. clBevelLight;410 Pen.Color := MainTexture.ColorBevelLight; 411 411 MoveTo(ClientWidth - CaptionLeft - 2, FrameTop + 2); 412 412 LineTo(ClientWidth - CaptionLeft - 2, TitleHeight); … … 421 421 Frame(Canvas, CaptionLeft + 1, ClientHeight - WideFrame - 1 + 1, 422 422 ClientWidth - CaptionLeft - 2, ClientHeight - 2, 423 MainTexture. clBevelLight, MainTexture.clBevelShade);423 MainTexture.ColorBevelLight, MainTexture.ColorBevelShade); 424 424 Frame(Canvas, CaptionLeft + 2, ClientHeight - WideFrame - 1 + 1, 425 425 ClientWidth - CaptionLeft - 3, ClientHeight - 3, 426 MainTexture. clBevelLight, MainTexture.clBevelShade);426 MainTexture.ColorBevelLight, MainTexture.ColorBevelShade); 427 427 Corner(Canvas, CaptionLeft + 1, ClientHeight - 9, 2, MainTexture); 428 428 Corner(Canvas, ClientWidth - CaptionLeft - 9, ClientHeight - 9, 3, … … 431 431 with Canvas do 432 432 begin 433 Pen.Color := MainTexture. clBevelShade;433 Pen.Color := MainTexture.ColorBevelShade; 434 434 MoveTo(CaptionLeft + 1, ClientHeight - WideFrame); 435 435 LineTo(CaptionLeft + 1, FrameBottom - 2); 436 Pen.Color := MainTexture. clBevelLight;436 Pen.Color := MainTexture.ColorBevelLight; 437 437 MoveTo(ClientWidth - CaptionLeft - 2, ClientHeight - WideFrame); 438 438 LineTo(ClientWidth - CaptionLeft - 2, FrameBottom - 2); … … 486 486 begin 487 487 Fill(Offscreen.Canvas, Left, Top, Width, Height, 488 SideFrame + ( wMaintexture- ClientWidth) div 2,489 TitleHeight + ( hMaintexture- ClientHeight) div 2);488 SideFrame + (Maintexture.Width - ClientWidth) div 2, 489 TitleHeight + (Maintexture.Height - ClientHeight) div 2); 490 490 end; 491 491 -
branches/highdpi/Packages/CevoComponents/ButtonBase.pas
r210 r361 80 80 end; 81 81 if (Button = mbLeft) and (@ClickProc <> nil) then 82 ClickProc(self) 82 ClickProc(self); 83 83 end 84 84 else … … 116 116 if @DownChangedProc <> nil then 117 117 DownChangedProc(self); 118 end 118 end; 119 119 end; 120 120 -
branches/highdpi/Packages/CevoComponents/DrawDlg.pas
r349 r361 258 258 $000000, $000000); 259 259 Frame(Canvas, Border + 1, Border + 1, ClientWidth - (2 + Border), 260 ClientHeight - (2 + Border), MainTexture. clBevelLight,261 MainTexture. clBevelShade);260 ClientHeight - (2 + Border), MainTexture.ColorBevelLight, 261 MainTexture.ColorBevelShade); 262 262 Frame(Canvas, 2 + Border, 2 + Border, ClientWidth - (3 + Border), 263 ClientHeight - (3 + Border), MainTexture. clBevelLight,264 MainTexture. clBevelShade);263 ClientHeight - (3 + Border), MainTexture.ColorBevelLight, 264 MainTexture.ColorBevelShade); 265 265 SplitText(false); 266 266 -
branches/highdpi/Packages/CevoComponents/ScreenTools.pas
r349 r361 11 11 12 12 type 13 TTexture = record 13 14 { TTexture } 15 16 TTexture = class 17 private 18 FAge: Integer; 19 function GetHeight: Integer; 20 function GetWidth: Integer; 21 procedure SetAge(AValue: Integer); 22 public 14 23 Image: TDpiBitmap; 15 clBevelLight: TColor; 16 clBevelShade: TColor; 17 clTextLight: TColor; 18 clTextShade: TColor; 19 clLitText: TColor; 20 clMark: TColor; 21 clPage: TColor; 22 clCover: TColor; 23 end; 24 ColorBevelLight: TColor; 25 ColorBevelShade: TColor; 26 ColorTextLight: TColor; 27 ColorTextShade: TColor; 28 ColorLitText: TColor; 29 ColorMark: TColor; 30 ColorPage: TColor; 31 ColorCover: TColor; 32 constructor Create; 33 destructor Destroy; override; 34 procedure Assign(Source: TTexture); 35 property Age: Integer read FAge write SetAge; 36 property Width: Integer read GetWidth; 37 property Height: Integer read GetHeight; 38 end; 39 24 40 TLoadGraphicFileOption = (gfNoError, gfNoGamma); 25 41 TLoadGraphicFileOptions = set of TLoadGraphicFileOption; … … 35 51 function TurnToString(Turn: integer): string; 36 52 function MovementToString(Movement: integer): string; 37 procedure BtnFrame(ca: TDpiCanvas; p: TRect; constT: TTexture);38 procedure EditFrame(ca: TDpiCanvas; p: TRect; constT: TTexture);53 procedure BtnFrame(ca: TDpiCanvas; p: TRect; T: TTexture); 54 procedure EditFrame(ca: TDpiCanvas; p: TRect; T: TTexture); 39 55 function HexStringToColor(S: string): integer; 40 56 function LoadGraphicFile(Bmp: TDpiBitmap; FileName: string; Options: TLoadGraphicFileOptions = []): boolean; … … 74 90 procedure GlowFrame(Dst: TDpiBitmap; x0, y0, Width, Height: integer; cl: TColor); 75 91 procedure InitOrnament; 76 procedure InitCityMark( constT: TTexture);92 procedure InitCityMark(T: TTexture); 77 93 procedure Fill(ca: TDpiCanvas; Left, Top, Width, Height, xOffset, yOffset: integer); overload; 78 94 procedure Fill(Canvas: TDpiCanvas; Rect: TRect; Offset: TPoint); overload; … … 83 99 const Texture: TDpiBitmap); 84 100 procedure PaintBackground(Form: TDpiForm; Left, Top, Width, Height: integer); 85 procedure Corner(ca: TDpiCanvas; x, y, Kind: integer; constT: TTexture);101 procedure Corner(ca: TDpiCanvas; x, y, Kind: integer; T: TTexture); 86 102 procedure BiColorTextOut(ca: TDpiCanvas; clMain, clBack: TColor; x, y: integer; s: string); 87 procedure LoweredTextOut(ca: TDpiCanvas; cl: TColor; constT: TTexture;103 procedure LoweredTextOut(ca: TDpiCanvas; cl: TColor; T: TTexture; 88 104 x, y: integer; s: string); 89 105 function BiColorTextWidth(ca: TDpiCanvas; s: string): integer; … … 95 111 procedure UnderlinedTitleValue(Canvas: TDpiCanvas; Title, Value: string; X, Y, Width: Integer); 96 112 procedure NumberBar(dst: TDpiBitmap; x, y: integer; Cap: string; val: integer; 97 constT: TTexture);113 T: TTexture); 98 114 procedure CountBar(dst: TDpiBitmap; x, y, w: integer; Kind: integer; 99 Cap: string; val: integer; constT: TTexture);115 Cap: string; val: integer; T: TTexture); 100 116 procedure PaintProgressBar(ca: TDpiCanvas; Kind, x, y, pos, Growth, max: integer; 101 constT: TTexture);117 T: TTexture); 102 118 procedure PaintRelativeProgressBar(ca: TDpiCanvas; 103 119 Kind, x, y, size, pos, Growth, max: integer; IndicateComplete: boolean; 104 constT: TTexture);120 T: TTexture); 105 121 procedure PaintLogo(Canvas: TDpiCanvas; X, Y, LightColor, ShadeColor: integer); 106 function SetMainTextureByAge(Age: integer): boolean;107 122 procedure LoadPhrases; 108 123 procedure Texturize(Dest, Texture: TDpiBitmap; TransparentColor: Cardinal); … … 113 128 TransparentColor1 = $FF00FF; 114 129 TransparentColor2 = $7F007F; 115 116 wMainTexture = 640;117 hMainTexture = 480;118 130 119 131 // template positions in Templates.png … … 165 177 HGrSystem2: TGraphicSet; 166 178 ClickFrameColor: Integer; 167 MainTextureAge: Integer;168 179 MainTexture: TTexture; 169 180 Templates: TGraphicSet; … … 325 336 end; 326 337 327 procedure BtnFrame(ca: TDpiCanvas; p: TRect; constT: TTexture);328 begin 329 RFrame(ca, p.Left - 1, p.Top - 1, p.Right, p.Bottom, T. clBevelShade,330 T. clBevelLight);331 end; 332 333 procedure EditFrame(ca: TDpiCanvas; p: TRect; constT: TTexture);338 procedure BtnFrame(ca: TDpiCanvas; p: TRect; T: TTexture); 339 begin 340 RFrame(ca, p.Left - 1, p.Top - 1, p.Right, p.Bottom, T.ColorBevelShade, 341 T.ColorBevelLight); 342 end; 343 344 procedure EditFrame(ca: TDpiCanvas; p: TRect; T: TTexture); 334 345 begin 335 346 Frame(ca, p.Left - 1, p.Top - 1, p.Right, p.Bottom, $000000, $000000); 336 347 Frame(ca, p.Left - 2, p.Top - 2, p.Right + 1, p.Bottom + 1, $000000, $000000); 337 348 Frame(ca, p.Left - 3, p.Top - 3, p.Right + 2, p.Bottom + 1, $000000, $000000); 338 RFrame(ca, p.Left - 4, p.Top - 4, p.Right + 3, p.Bottom + 2, T. clBevelShade,339 T. clBevelLight);349 RFrame(ca, p.Left - 4, p.Top - 4, p.Right + 3, p.Bottom + 2, T.ColorBevelShade, 350 T.ColorBevelLight); 340 351 end; 341 352 … … 1039 1050 begin 1040 1051 if InitOrnamentDone then Exit; 1041 Light := ColorToColor32(MainTexture. clBevelLight);1042 // and $FCFCFC shr 2*3+MainTexture. clBevelShade and $FCFCFC shr 2;1043 Shade := ColorToColor32(MainTexture. clBevelShade and $FCFCFC shr 2 * 3 +1044 MainTexture. clBevelLight and $FCFCFC shr 2);1052 Light := ColorToColor32(MainTexture.ColorBevelLight); 1053 // and $FCFCFC shr 2*3+MainTexture.ColorBevelShade and $FCFCFC shr 2; 1054 Shade := ColorToColor32(MainTexture.ColorBevelShade and $FCFCFC shr 2 * 3 + 1055 MainTexture.ColorBevelLight and $FCFCFC shr 2); 1045 1056 HGrSystem2.Data.BeginUpdate; 1046 1057 PixelPtr := PixelPointer(HGrSystem2.Data, ScaleToNative(Ornament.Left), ScaleToNative(Ornament.Top)); … … 1070 1081 end; 1071 1082 1072 procedure InitCityMark( constT: TTexture);1083 procedure InitCityMark(T: TTexture); 1073 1084 var 1074 1085 x: Integer; … … 1083 1094 x, CityMark1.Top + y] and $FF; 1084 1095 HGrSystem.Data.Canvas.Pixels[CityMark2.Left + x, CityMark2.Top + y] := 1085 T. clMark and $FF * Intensity div $FF + T.clMark shr 8 and1086 $FF * Intensity div $FF shl 8 + T. clMark shr 16 and1096 T.ColorMark and $FF * Intensity div $FF + T.ColorMark shr 8 and 1097 $FF * Intensity div $FF shl 8 + T.ColorMark shr 16 and 1087 1098 $FF * Intensity div $FF shl 16; 1088 1099 end; … … 1095 1106 procedure Fill(ca: TDpiCanvas; Left, Top, Width, Height, xOffset, yOffset: Integer); 1096 1107 begin 1097 Assert((Left + xOffset >= 0) and (Left + xOffset + Width <= wMainTexture) and1098 (Top + yOffset >= 0) and (Top + yOffset + Height <= hMainTexture));1108 Assert((Left + xOffset >= 0) and (Left + xOffset + Width <= MainTexture.Width) and 1109 (Top + yOffset >= 0) and (Top + yOffset + Height <= MainTexture.Height)); 1099 1110 DpiBitCanvas(ca, Left, Top, Width, Height, MainTexture.Image.Canvas, 1100 1111 Left + xOffset, Top + yOffset); … … 1112 1123 n: integer; 1113 1124 begin 1114 n := (( hMainTexturediv 2) div (y1 - y0)) * 2;1115 while hMainTexture div 2 + (I + 1) * (y1 - y0) > hMainTexturedo1125 n := ((MainTexture.Height div 2) div (y1 - y0)) * 2; 1126 while MainTexture.Height div 2 + (I + 1) * (y1 - y0) > MainTexture.Height do 1116 1127 Dec(I, n); 1117 while hMainTexturediv 2 + I * (y1 - y0) < 0 do1128 while MainTexture.Height div 2 + I * (y1 - y0) < 0 do 1118 1129 Inc(I, n); 1119 1130 Result := I; … … 1123 1134 I: Integer; 1124 1135 begin 1125 for I := 0 to (x1 - xm) div wMainTexture- 1 do1126 DpiBitCanvas(ca, xm + I * wMainTexture, y0, wMainTexture, y1 - y0,1127 MainTexture.Image.Canvas, 0, hMainTexturediv 2 + Band(I) *1136 for I := 0 to (x1 - xm) div MainTexture.Width - 1 do 1137 DpiBitCanvas(ca, xm + I * MainTexture.Width, y0, MainTexture.Width, y1 - y0, 1138 MainTexture.Image.Canvas, 0, MainTexture.Height div 2 + Band(I) * 1128 1139 (y1 - y0)); 1129 DpiBitCanvas(ca, xm + ((x1 - xm) div wMainTexture) * wMainTexture, y0,1130 x1 - (xm + ((x1 - xm) div wMainTexture) * wMainTexture), y1 - y0,1131 MainTexture.Image.Canvas, 0, hMainTexturediv 2 + Band(1132 (x1 - xm) div wMainTexture) * (y1 - y0));1133 for I := 0 to (xm - x0) div wMainTexture- 1 do1134 DpiBitCanvas(ca, xm - (I + 1) * wMainTexture, y0, wMainTexture, y1 - y0,1135 MainTexture.Image.Canvas, 0, hMainTexturediv 2 +1140 DpiBitCanvas(ca, xm + ((x1 - xm) div MainTexture.Width) * MainTexture.Width, y0, 1141 x1 - (xm + ((x1 - xm) div MainTexture.Width) * MainTexture.Width), y1 - y0, 1142 MainTexture.Image.Canvas, 0, MainTexture.Height div 2 + Band( 1143 (x1 - xm) div MainTexture.Width) * (y1 - y0)); 1144 for I := 0 to (xm - x0) div MainTexture.Width - 1 do 1145 DpiBitCanvas(ca, xm - (I + 1) * MainTexture.Width, y0, MainTexture.Width, y1 - y0, 1146 MainTexture.Image.Canvas, 0, MainTexture.Height div 2 + 1136 1147 Band(-I - 1) * (y1 - y0)); 1137 DpiBitCanvas(ca, x0, y0, xm - ((xm - x0) div wMainTexture) *1138 wMainTexture- x0, y1 - y0, MainTexture.Image.Canvas,1139 ((xm - x0) div wMainTexture + 1) * wMainTexture- (xm - x0),1140 hMainTexture div 2 + Band(-(xm - x0) div wMainTexture- 1) * (y1 - y0));1148 DpiBitCanvas(ca, x0, y0, xm - ((xm - x0) div MainTexture.Width) * 1149 MainTexture.Width - x0, y1 - y0, MainTexture.Image.Canvas, 1150 ((xm - x0) div MainTexture.Width + 1) * MainTexture.Width - (xm - x0), 1151 MainTexture.Height div 2 + Band(-(xm - x0) div MainTexture.Width - 1) * (y1 - y0)); 1141 1152 end; 1142 1153 … … 1183 1194 procedure PaintBackground(Form: TDpiForm; Left, Top, Width, Height: Integer); 1184 1195 begin 1185 Fill(Form.Canvas, Left, Top, Width, Height, ( wMainTexture- Form.ClientWidth) div1186 2, ( hMainTexture- Form.ClientHeight) div 2);1187 end; 1188 1189 procedure Corner(ca: TDpiCanvas; x, y, Kind: Integer; constT: TTexture);1196 Fill(Form.Canvas, Left, Top, Width, Height, (MainTexture.Width - Form.ClientWidth) div 1197 2, (MainTexture.Height - Form.ClientHeight) div 2); 1198 end; 1199 1200 procedure Corner(ca: TDpiCanvas; x, y, Kind: Integer; T: TTexture); 1190 1201 begin 1191 1202 { DpiBitCanvas(ca,x,y,8,8,T.HGr.Mask.Canvas, … … 1282 1293 end; 1283 1294 1284 procedure LoweredTextOut(ca: TDpiCanvas; cl: TColor; constT: TTexture;1295 procedure LoweredTextOut(ca: TDpiCanvas; cl: TColor; T: TTexture; 1285 1296 x, y: Integer; s: string); 1286 1297 begin 1287 1298 if cl = -2 then 1288 BiColorTextOut(ca, (T. clBevelShade and $FEFEFE) shr 1,1289 T. clBevelLight, x, y, s)1299 BiColorTextOut(ca, (T.ColorBevelShade and $FEFEFE) shr 1, 1300 T.ColorBevelLight, x, y, s) 1290 1301 else if cl < 0 then 1291 BiColorTextOut(ca, T. clTextShade, T.clTextLight, x, y, s)1302 BiColorTextOut(ca, T.ColorTextShade, T.ColorTextLight, x, y, s) 1292 1303 else 1293 BiColorTextOut(ca, cl, T. clTextLight, x, y, s);1304 BiColorTextOut(ca, cl, T.ColorTextLight, x, y, s); 1294 1305 end; 1295 1306 … … 1366 1377 procedure UnderlinedTitleValue(Canvas: TDpiCanvas; Title, Value: string; X, Y, Width: Integer); 1367 1378 begin 1368 DLine(Canvas, X, X + Width, Y + 19, MainTexture. clBevelLight, MainTexture.clBevelShade);1379 DLine(Canvas, X, X + Width, Y + 19, MainTexture.ColorBevelLight, MainTexture.ColorBevelShade); 1369 1380 RisedTextOut(Canvas, X, Y, Title); 1370 1381 RisedTextOut(Canvas, X + Width - BiColorTextWidth(Canvas, Value), Y, Value); … … 1372 1383 1373 1384 procedure NumberBar(dst: TDpiBitmap; x, y: integer; Cap: string; 1374 val: Integer; constT: TTexture);1385 val: Integer; T: TTexture); 1375 1386 var 1376 1387 s: string; … … 1378 1389 if val > 0 then 1379 1390 begin 1380 DLine(dst.Canvas, x - 2, x + 170, y + 16, T. clBevelShade,1381 T. clBevelLight);1391 DLine(dst.Canvas, x - 2, x + 170, y + 16, T.ColorBevelShade, 1392 T.ColorBevelLight); 1382 1393 LoweredTextOut(dst.Canvas, -1, T, x - 2, y, Cap); 1383 1394 s := IntToStr(val); … … 1388 1399 1389 1400 procedure CountBar(dst: TDpiBitmap; x, y, w: Integer; Kind: Integer; 1390 Cap: string; val: Integer; constT: TTexture);1401 Cap: string; val: Integer; T: TTexture); 1391 1402 var 1392 1403 i, sd, ld, cl, xIcon, yIcon: Integer; … … 1401 1412 // xIcon:=x+100; 1402 1413 // yIcon:=y; 1403 // DLine(dst.Canvas,x-2,x+170+32,y+16,T. clBevelShade,T.clBevelLight);1414 // DLine(dst.Canvas,x-2,x+170+32,y+16,T.ColorBevelShade,T.ColorBevelLight); 1404 1415 1405 1416 xIcon := x - 5; 1406 1417 yIcon := y + 15; 1407 DLine(dst.Canvas, x - 2, xIcon + w + 2, yIcon + 16, T. clBevelShade,1408 T. clBevelLight);1418 DLine(dst.Canvas, x - 2, xIcon + w + 2, yIcon + 16, T.ColorBevelShade, 1419 T.ColorBevelLight); 1409 1420 1410 1421 s := IntToStr(val); … … 1484 1495 1485 1496 procedure PaintProgressBar(ca: TDpiCanvas; Kind, x, y, pos, Growth, max: Integer; 1486 constT: TTexture);1497 T: TTexture); 1487 1498 var 1488 1499 i: Integer; … … 1502 1513 Growth := max - pos; 1503 1514 Frame(ca, x - 1, y - 1, x + max, y + 7, $000000, $000000); 1504 RFrame(ca, x - 2, y - 2, x + max + 1, y + 8, T. clBevelShade,1505 T. clBevelLight);1515 RFrame(ca, x - 2, y - 2, x + max + 1, y + 8, T.ColorBevelShade, 1516 T.ColorBevelLight); 1506 1517 with ca do 1507 1518 begin … … 1538 1549 procedure PaintRelativeProgressBar(ca: TDpiCanvas; 1539 1550 Kind, x, y, size, pos, Growth, max: Integer; IndicateComplete: Boolean; 1540 constT: TTexture);1551 T: TTexture); 1541 1552 begin 1542 1553 if Growth > 0 then … … 1557 1568 LightColor, ShadeColor); 1558 1569 DpiBitCanvas(Canvas, X, Y, Logo.Width, Logo.Height, LogoBuffer.Canvas, 0, 0); 1559 end;1560 1561 function SetMainTextureByAge(Age: Integer): Boolean;1562 begin1563 if Age <> MainTextureAge then1564 with MainTexture do begin1565 MainTextureAge := Age;1566 LoadGraphicFile(Image, GetGraphicsDir + DirectorySeparator +1567 'Texture' + IntToStr(Age + 1) + '.jpg');1568 clBevelLight := Colors.Canvas.Pixels[clkAge0 + Age, cliBevelLight];1569 clBevelShade := Colors.Canvas.Pixels[clkAge0 + Age, cliBevelShade];1570 clTextLight := Colors.Canvas.Pixels[clkAge0 + Age, cliTextLight];1571 clTextShade := Colors.Canvas.Pixels[clkAge0 + Age, cliTextShade];1572 clLitText := Colors.Canvas.Pixels[clkAge0 + Age, cliLitText];1573 clMark := Colors.Canvas.Pixels[clkAge0 + Age, cliMark];1574 clPage := Colors.Canvas.Pixels[clkAge0 + Age, cliPage];1575 clCover := Colors.Canvas.Pixels[clkAge0 + Age, cliCover];1576 Result := True;1577 end1578 else1579 Result := False;1580 1570 end; 1581 1571 … … 1786 1776 BigImp := TDpiBitmap.Create; 1787 1777 BigImp.PixelFormat := pf24bit; 1788 MainTexture.Image := TDpiBitmap.Create; 1789 MainTextureAge := -2; 1778 MainTexture := TTexture.Create; 1790 1779 ClickFrameColor := HGrSystem.Data.Canvas.Pixels[187, 175]; 1791 1780 InitOrnamentDone := False; … … 1810 1799 FreeAndNil(Paper); 1811 1800 FreeAndNil(Colors); 1812 FreeAndNil(MainTexture.Image); 1801 FreeAndNil(MainTexture); 1802 end; 1803 1804 { TTexture } 1805 1806 procedure TTexture.SetAge(AValue: Integer); 1807 begin 1808 if FAge = AValue then Exit; 1809 FAge := AValue; 1810 LoadGraphicFile(Image, GetGraphicsDir + DirectorySeparator + 1811 'Texture' + IntToStr(Age + 1) + '.jpg'); 1812 ColorBevelLight := Colors.Canvas.Pixels[clkAge0 + Age, cliBevelLight]; 1813 ColorBevelShade := Colors.Canvas.Pixels[clkAge0 + Age, cliBevelShade]; 1814 ColorTextLight := Colors.Canvas.Pixels[clkAge0 + Age, cliTextLight]; 1815 ColorTextShade := Colors.Canvas.Pixels[clkAge0 + Age, cliTextShade]; 1816 ColorLitText := Colors.Canvas.Pixels[clkAge0 + Age, cliLitText]; 1817 ColorMark := Colors.Canvas.Pixels[clkAge0 + Age, cliMark]; 1818 ColorPage := Colors.Canvas.Pixels[clkAge0 + Age, cliPage]; 1819 ColorCover := Colors.Canvas.Pixels[clkAge0 + Age, cliCover]; 1820 end; 1821 1822 function TTexture.GetHeight: Integer; 1823 begin 1824 Result := Image.Height; 1825 end; 1826 1827 function TTexture.GetWidth: Integer; 1828 begin 1829 Result := Image.Width; 1830 end; 1831 1832 constructor TTexture.Create; 1833 begin 1834 Image := TDpiBitmap.Create; 1835 FAge := -2; 1836 end; 1837 1838 destructor TTexture.Destroy; 1839 begin 1840 FreeAndNil(Image); 1841 inherited; 1842 end; 1843 1844 procedure TTexture.Assign(Source: TTexture); 1845 begin 1846 FAge := Source.FAge; 1847 Image.Assign(Image); 1848 ColorBevelLight := Source.ColorBevelLight; 1849 ColorBevelShade := Source.ColorBevelShade; 1850 ColorTextLight := Source.ColorTextLight; 1851 ColorTextShade := Source.ColorTextShade; 1852 ColorLitText := Source.ColorLitText; 1853 ColorMark := Source.ColorMark; 1854 ColorPage := Source.ColorPage; 1855 ColorCover := Source.ColorCover; 1813 1856 end; 1814 1857 -
branches/highdpi/Settings.pas
r349 r361 141 141 Frame(Canvas, 0, 0, ClientWidth - 1, ClientHeight - 1, 0, 0); 142 142 Frame(Canvas, 1, 1, ClientWidth - 2, ClientHeight - 2, 143 MainTexture. clBevelLight, MainTexture.clBevelShade);143 MainTexture.ColorBevelLight, MainTexture.ColorBevelShade); 144 144 Frame(Canvas, 2, 2, ClientWidth - 3, ClientHeight - 3, 145 MainTexture. clBevelLight, MainTexture.clBevelShade);145 MainTexture.ColorBevelLight, MainTexture.ColorBevelShade); 146 146 EditFrame(Canvas, List.BoundsRect, MainTexture); 147 147 BtnFrame(Canvas, OKBtn.BoundsRect, MainTexture); … … 149 149 150 150 RFrame(Canvas, ButtonFullscreen.Left - 1, ButtonFullscreen.Top - 1, 151 ButtonFullscreen.Left + 12, ButtonFullscreen.Top + 12, MainTexture. clBevelShade,152 MainTexture. clBevelLight);151 ButtonFullscreen.Left + 12, ButtonFullscreen.Top + 12, MainTexture.ColorBevelShade, 152 MainTexture.ColorBevelLight); 153 153 154 154 S := Phrases.Lookup('SETTINGS', 0); … … 164 164 begin 165 165 Languages.LoadToStrings(List.Items); 166 List.Font.Color := MainTexture. clMark;166 List.Font.Color := MainTexture.ColorMark; 167 167 LoadData; 168 168 end; -
branches/highdpi/Start.pas
r349 r361 537 537 begin 538 538 Frame(Canvas, 328, yMain + 112 - 15, ClientWidth, Up2Btn.top + 38, 539 MainTexture. clBevelShade, MainTexture.clBevelLight);539 MainTexture.ColorBevelShade, MainTexture.ColorBevelLight); 540 540 if AutoDiff > 0 then 541 541 begin … … 543 543 yMain + 112 - 15 { Up1Btn.Top-12 }{ y0Brain-dyBrain } , 544 544 x0Brain + dxBrain + 64, Up2Btn.top + 38 { y0Brain+dyBrain+64 } , 545 MainTexture. clBevelShade, MainTexture.clBevelLight);545 MainTexture.ColorBevelShade, MainTexture.ColorBevelLight); 546 546 end; 547 547 end 548 548 else if Page <> pgMain then 549 549 Frame(Canvas, 328, Up1Btn.top - 15, ClientWidth, Up2Btn.top + 38, 550 MainTexture. clBevelShade, MainTexture.clBevelLight);550 MainTexture.ColorBevelShade, MainTexture.ColorBevelLight); 551 551 Frame(Canvas, 0, 0, ClientWidth - 1, ClientHeight - 1, 0, 0); 552 552 553 553 // draw tabs 554 554 Frame(Canvas, 2, 2 + 2 * integer(Tab <> tbMain), TabOffset + (0 + 1) * TabSize - 1, 555 TabHeight, MainTexture. clBevelLight, MainTexture.clBevelShade);555 TabHeight, MainTexture.ColorBevelLight, MainTexture.ColorBevelShade); 556 556 Frame(Canvas, 1, 1 + 2 * integer(Tab <> tbMain), TabOffset + (0 + 1) * TabSize, 557 TabHeight, MainTexture. clBevelLight, MainTexture.clBevelShade);558 Canvas.Pixels[1, 1 + 2 * integer(Tab <> tbMain)] := MainTexture. clBevelShade;557 TabHeight, MainTexture.ColorBevelLight, MainTexture.ColorBevelShade); 558 Canvas.Pixels[1, 1 + 2 * integer(Tab <> tbMain)] := MainTexture.ColorBevelShade; 559 559 for Tab2 := tbMap to tbPrevious do 560 560 begin 561 561 Frame(Canvas, TabOffset + Integer(Tab2) * TabSize + 2, 2 + 2 * integer(Tab <> Tab2), 562 TabOffset + (Integer(Tab2) + 1) * TabSize - 1, TabHeight, MainTexture. clBevelLight,563 MainTexture. clBevelShade);562 TabOffset + (Integer(Tab2) + 1) * TabSize - 1, TabHeight, MainTexture.ColorBevelLight, 563 MainTexture.ColorBevelShade); 564 564 Frame(Canvas, TabOffset + Integer(Tab2) * TabSize + 1, 1 + 2 * integer(Tab <> Tab2), 565 TabOffset + (Integer(Tab2) + 1) * TabSize, TabHeight, MainTexture. clBevelLight,566 MainTexture. clBevelShade);565 TabOffset + (Integer(Tab2) + 1) * TabSize, TabHeight, MainTexture.ColorBevelLight, 566 MainTexture.ColorBevelShade); 567 567 Canvas.Pixels[TabOffset + Integer(Tab2) * TabSize + 1, 1 + 2 * integer(Tab <> Tab2)] := 568 MainTexture. clBevelShade;568 MainTexture.ColorBevelShade; 569 569 end; 570 570 Canvas.Font.Assign(UniFont[ftNormal]); … … 579 579 $000000, $000000); 580 580 Frame(Canvas, 1, TabHeight + 1, ClientWidth - 2, ClientHeight - 2, 581 MainTexture. clBevelLight, MainTexture.clBevelShade);581 MainTexture.ColorBevelLight, MainTexture.ColorBevelShade); 582 582 Frame(Canvas, 2, TabHeight + 2, ClientWidth - 3, ClientHeight - 3, 583 MainTexture. clBevelLight, MainTexture.clBevelShade);583 MainTexture.ColorBevelLight, MainTexture.ColorBevelShade); 584 584 if Tab = tbMain then 585 585 begin 586 586 PaintBackground(self, 3, TabHeight - 1, TabSize - 4 - 3 + TabOffset + 3, 4); 587 Canvas.Pixels[2, TabHeight] := MainTexture. clBevelLight;587 Canvas.Pixels[2, TabHeight] := MainTexture.ColorBevelLight; 588 588 end 589 589 else … … 592 592 TabSize - 4, 4); 593 593 Canvas.Pixels[TabOffset + Integer(Tab) * TabSize + 2, TabHeight] := 594 MainTexture. clBevelLight;594 MainTexture.ColorBevelLight; 595 595 end; 596 596 Canvas.Pixels[TabOffset + (Integer(Tab) + 1) * TabSize - 1, TabHeight + 1] := 597 MainTexture. clBevelShade;597 MainTexture.ColorBevelShade; 598 598 if Tab < tbPrevious then 599 599 Frame(Canvas, TabOffset + (Integer(Tab) + 1) * TabSize + 1, 3, 600 TabOffset + (Integer(Tab) + 1) * TabSize + 2, TabHeight, MainTexture. clBevelShade,601 MainTexture. clBevelShade); // Tab shadow600 TabOffset + (Integer(Tab) + 1) * TabSize + 2, TabHeight, MainTexture.ColorBevelShade, 601 MainTexture.ColorBevelShade); // Tab shadow 602 602 603 603 // Paint menu logo … … 685 685 HGrSystem2.Data.Canvas, Ornament.Left, Ornament.Top, SRCPAINT); 686 686 end; 687 PaintLogo(Canvas, 69 + 11 * 27, yLogo, MainTexture. clBevelLight,688 MainTexture. clBevelShade);687 PaintLogo(Canvas, 69 + 11 * 27, yLogo, MainTexture.ColorBevelLight, 688 MainTexture.ColorBevelShade); 689 689 690 690 for i := 0 to nPlOffered - 1 do … … 706 706 RFrame(Canvas, PlayerSlots[i].DiffUpBtn.left - 1, PlayerSlots[i].DiffUpBtn.top - 1, 707 707 PlayerSlots[i].DiffUpBtn.left + 12, PlayerSlots[i].DiffUpBtn.top + 24, 708 MainTexture. clBevelShade, MainTexture.clBevelLight);708 MainTexture.ColorBevelShade, MainTexture.ColorBevelLight); 709 709 with Canvas do 710 710 begin … … 718 718 RFrame(Canvas, PlayerSlots[I].MultiBtn.left - 1, PlayerSlots[I].MultiBtn.top - 1, 719 719 PlayerSlots[I].MultiBtn.left + 12, PlayerSlots[I].MultiBtn.top + 12, 720 MainTexture. clBevelShade, MainTexture.clBevelLight);720 MainTexture.ColorBevelShade, MainTexture.ColorBevelLight); 721 721 DpiBitCanvas(Canvas, xBrain[i] - 31, yBrain[i], 13, 12, 722 722 HGrSystem.Data.Canvas, 88, 47); … … 733 733 else 734 734 begin 735 DLine(Canvas, 24, 198, yMain + 140 + 19, MainTexture. clBevelLight,736 MainTexture. clBevelShade);735 DLine(Canvas, 24, 198, yMain + 140 + 19, MainTexture.ColorBevelLight, 736 MainTexture.ColorBevelShade); 737 737 RisedTextOut(Canvas, 24 { x0Brain+32-BiColorTextWidth(Canvas,s) div 2 } , 738 738 yMain + 140 { y0Mini-77 } , Phrases.Lookup('STARTCONTROLS', 15)); … … 746 746 747 747 DLine(Canvas, 24, xDefault - 6, yMain + 164 + 19, 748 MainTexture. clBevelLight, MainTexture.clBevelShade);748 MainTexture.ColorBevelLight, MainTexture.ColorBevelShade); 749 749 RisedTextOut(Canvas, 24 { x0Brain+32-BiColorTextWidth(Canvas,s) div 2 } , 750 750 yMain + 164 { y0Mini-77 } , Phrases.Lookup('STARTCONTROLS', 16)); … … 755 755 FrameImage(Canvas, BrainDefault.Picture, xDefault, yDefault, 64, 64, 756 756 0, 0, true); 757 DLine(Canvas, 56, 272, y0Mini + 61 + 19, MainTexture. clBevelLight,758 MainTexture. clBevelShade);757 DLine(Canvas, 56, 272, y0Mini + 61 + 19, MainTexture.ColorBevelLight, 758 MainTexture.ColorBevelShade); 759 759 760 760 RisedTextOut(Canvas, 56, y0Mini + 61, … … 771 771 HGrSystem2.Data.Canvas, Ornament.Left, Ornament.Top, SRCPAINT); 772 772 end; 773 PaintLogo(Canvas, 69, yLogo, MainTexture. clBevelLight,774 MainTexture. clBevelShade);773 PaintLogo(Canvas, 69, yLogo, MainTexture.ColorBevelLight, 774 MainTexture.ColorBevelShade); 775 775 end; 776 776 end … … 788 788 end 789 789 else 790 DLine(Canvas, 344, 514, y0Mini + 61 + 19, MainTexture. clBevelLight,791 MainTexture. clBevelShade);790 DLine(Canvas, 344, 514, y0Mini + 61 + 19, MainTexture.ColorBevelLight, 791 MainTexture.ColorBevelShade); 792 792 RisedTextOut(Canvas, 344, y0Mini + 61, Phrases.Lookup('STARTCONTROLS', 8)); 793 793 s := TurnToString(LoadTurn); … … 805 805 else if Page = pgEditMap then 806 806 begin 807 // DLine(Canvas,344,514,y0Mini+61+19,MainTexture. clBevelLight,MainTexture.clBevelShade);807 // DLine(Canvas,344,514,y0Mini+61+19,MainTexture.ColorBevelLight,MainTexture.ColorBevelShade); 808 808 s := Format(Phrases2.Lookup('MAPPROP'), 809 809 [(nMapLandTiles * 100 + 556) div 1112, … … 818 818 if Up2Btn.Visible then 819 819 RFrame(Canvas, Up2Btn.left - 1, Up2Btn.top - 1, Up2Btn.left + 12, 820 Up2Btn.top + 24, MainTexture. clBevelShade, MainTexture.clBevelLight);820 Up2Btn.top + 24, MainTexture.ColorBevelShade, MainTexture.ColorBevelLight); 821 821 if Up1Btn.Visible then 822 822 RFrame(Canvas, Up1Btn.left - 1, Up1Btn.top - 1, Up1Btn.left + 12, 823 Up1Btn.top + 24, MainTexture. clBevelShade, MainTexture.clBevelLight);823 Up1Btn.top + 24, MainTexture.ColorBevelShade, MainTexture.ColorBevelLight); 824 824 if AutoDiffUpBtn.Visible then 825 825 RFrame(Canvas, AutoDiffUpBtn.left - 1, AutoDiffUpBtn.top - 1, 826 AutoDiffUpBtn.left + 12, AutoDiffUpBtn.top + 24, MainTexture. clBevelShade,827 MainTexture. clBevelLight);826 AutoDiffUpBtn.left + 12, AutoDiffUpBtn.top + 24, MainTexture.ColorBevelShade, 827 MainTexture.ColorBevelLight); 828 828 if AutoEnemyUpBtn.Visible then 829 829 RFrame(Canvas, AutoEnemyUpBtn.left - 1, AutoEnemyUpBtn.top - 1, 830 830 AutoEnemyUpBtn.left + 12, AutoEnemyUpBtn.top + 24, 831 MainTexture. clBevelShade, MainTexture.clBevelLight);831 MainTexture.ColorBevelShade, MainTexture.ColorBevelLight); 832 832 if CustomizeBtn.Visible then 833 833 RFrame(Canvas, CustomizeBtn.left - 1, CustomizeBtn.top - 1, 834 CustomizeBtn.left + 12, CustomizeBtn.top + 12, MainTexture. clBevelShade,835 MainTexture. clBevelLight);834 CustomizeBtn.left + 12, CustomizeBtn.top + 12, MainTexture.ColorBevelShade, 835 MainTexture.ColorBevelLight); 836 836 if List.Visible then 837 837 EditFrame(Canvas, List.BoundsRect, MainTexture); … … 848 848 yMini := y0Mini - MiniMap.Size.Y div 2; 849 849 Frame(Canvas, xMini, yMini, xMini + 3 + MiniMap.Size.X * 2, 850 yMini + 3 + MiniMap.Size.Y, MainTexture. clBevelLight,851 MainTexture. clBevelShade);850 yMini + 3 + MiniMap.Size.Y, MainTexture.ColorBevelLight, 851 MainTexture.ColorBevelShade); 852 852 Frame(Canvas, xMini + 1, yMini + 1, xMini + 2 + MiniMap.Size.X * 2, 853 yMini + 2 + MiniMap.Size.Y, MainTexture. clBevelShade,854 MainTexture. clBevelLight);853 yMini + 2 + MiniMap.Size.Y, MainTexture.ColorBevelShade, 854 MainTexture.ColorBevelLight); 855 855 856 856 s := ''; … … 878 878 procedure TStartDlg.FormShow(Sender: TObject); 879 879 begin 880 SetMainTextureByAge(-1);881 List.Font.Color := MainTexture. clMark;880 MainTexture.Age := -1; 881 List.Font.Color := MainTexture.ColorMark; 882 882 883 883 Fill(EmptyPicture.Canvas, Bounds(0, 0, 64, 64), 884 Point(( wMaintexture - 64) div 2, (hMaintexture- 64) div 2));884 Point((Maintexture.Width - 64) div 2, (Maintexture.Height - 64) div 2)); 885 885 886 886 DarkenImage(EmptyPicture, 28); … … 1114 1114 begin // turn all local players off 1115 1115 for I := 1 to PlayerSlots.Count - 1 do 1116 if PlayersBrain[I].Kind = btTermthen begin1116 if Assigned(PlayersBrain[I]) and (PlayersBrain[I].Kind = btTerm) then begin 1117 1117 PlayersBrain[I] := nil; 1118 1118 PlayerSlots[I].DiffUpBtn.Visible := false;
Note:
See TracChangeset
for help on using the changeset viewer.