Changeset 537 for trunk/LocalPlayer
- Timestamp:
- Apr 16, 2024, 10:35:07 AM (7 months ago)
- Location:
- trunk/LocalPlayer
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LocalPlayer/IsoEngine.pas
r536 r537 78 78 procedure TextOut(X, Y, Color: Integer; const S: string); 79 79 procedure Sprite(HGr: TGraphicSet; xDst, yDst, Width, Height, xGr, yGr: Integer); 80 procedure T Sprite(xDst, yDst, grix: Integer; PureBlack: Boolean = False);80 procedure TerrainSprite(xDst, yDst, grix: Integer; PureBlack: Boolean = False); 81 81 procedure ApplyTileSize(ATileSize: TTileSize); 82 82 public … … 115 115 Borders: TBitmap; 116 116 BordersOk: Integer; 117 T SpriteSize: TTerrainSpriteSize;117 TerrainSpriteSize: TTerrainSpriteSize; 118 118 HGrTerrain: TGraphicSet; 119 119 HGrCities: TGraphicSet; … … 210 210 IsoMap.LandPatch := LandPatch; 211 211 IsoMap.OceanPatch := OceanPatch; 212 IsoMap.TerrainSpriteSize := T SpriteSize;212 IsoMap.TerrainSpriteSize := TerrainSpriteSize; 213 213 IsoMap.CitiesPictures := CitiesPictures; 214 214 end; … … 224 224 HGrTerrain := nil; 225 225 HGrCities := nil; 226 SetLength(T SpriteSize, TerrainIconLines * TerrainIconCols);226 SetLength(TerrainSpriteSize, TerrainIconLines * TerrainIconCols); 227 227 CitiesPictures := TCitiesPictures.Create; 228 228 end; … … 618 618 end; 619 619 620 procedure TIsoMap.T Sprite(xDst, yDst, grix: Integer;620 procedure TIsoMap.TerrainSprite(xDst, yDst, grix: Integer; 621 621 PureBlack: Boolean = False); 622 622 var … … 709 709 { DataCanvas := HGrTerrain.Data.Canvas; 710 710 MaskCanvas := HGrTerrain.Mask.Canvas; 711 T Sprite(X, Y + 16, 12 * 9 + 7); }711 TerrainSprite(X, Y + 16, 12 * 9 + 7); } 712 712 Sprite(HGrStdUnits, X, Y, xxu * 2, yyu * 2, 1 + 6 * (xxu * 2 + 1), 1); 713 713 end; … … 961 961 then 962 962 Conn := Conn and not 9; // no connection to north 963 T Sprite(X, Y, yGr + Conn mod 8 + (Conn div 8) * TerrainIconCols);963 TerrainSprite(X, Y, yGr + Conn mod 8 + (Conn div 8) * TerrainIconCols); 964 964 end 965 965 else if Tile and fTerrain in [fHills, fMountains, fForest] then … … 967 967 yGr := 3 + 2 * (Tile and fTerrain - fForest); 968 968 Conn := Connection4(Loc, fTerrain, Tile and fTerrain); 969 T Sprite(X, Y, Conn mod 8 + (yGr + Conn div 8) * TerrainIconCols);969 TerrainSprite(X, Y, Conn mod 8 + (yGr + Conn div 8) * TerrainIconCols); 970 970 end 971 971 else if Tile and fDeadLands <> 0 then 972 T Sprite(X, Y, spRow2);972 TerrainSprite(X, Y, spRow2); 973 973 974 974 if ShowObjects then 975 975 begin 976 976 if Tile and fTerImp = tiFarm then 977 T Sprite(X, Y, spFarmLand)977 TerrainSprite(X, Y, spFarmLand) 978 978 else if Tile and fTerImp = tiIrrigation then 979 T Sprite(X, Y, spIrrigation);979 TerrainSprite(X, Y, spIrrigation); 980 980 end; 981 981 if Tile and fRiver <> 0 then … … 984 984 Connection4(Loc, fTerrain, fShore) or Connection4(Loc, fTerrain, 985 985 fUNKNOWN); 986 T Sprite(X, Y, spRiver + Conn mod 8 + (Conn div 8) * TerrainIconCols);986 TerrainSprite(X, Y, spRiver + Conn mod 8 + (Conn div 8) * TerrainIconCols); 987 987 end; 988 988 … … 992 992 for Dir := 0 to 3 do 993 993 if Conn and (1 shl Dir) <> 0 then { river mouths } 994 T Sprite(X, Y, spRiverMouths + Dir);994 TerrainSprite(X, Y, spRiverMouths + Dir); 995 995 if ShowObjects then 996 996 begin … … 998 998 for Dir := 0 to 7 do 999 999 if Conn and (1 shl Dir) <> 0 then { canal mouths } 1000 T Sprite(X, Y, spCanalMouths + 1 + Dir);1000 TerrainSprite(X, Y, spCanalMouths + 1 + Dir); 1001 1001 end; 1002 1002 end; … … 1010 1010 if Conn = 0 then begin 1011 1011 if Tile and fCanal <> 0 then 1012 T Sprite(X, Y, spCanal);1012 TerrainSprite(X, Y, spCanal); 1013 1013 end 1014 1014 else 1015 1015 for Dir := 0 to 7 do 1016 1016 if (1 shl Dir) and Conn <> 0 then 1017 T Sprite(X, Y, spCanal + 1 + Dir);1017 TerrainSprite(X, Y, spCanal + 1 + Dir); 1018 1018 end; 1019 1019 … … 1027 1027 Conn := Connection8(Loc, fRoad or fRR or fCity) and not RRConn; 1028 1028 if (Conn = 0) and (Tile and (fRR or fCity) = 0) then 1029 T Sprite(X, Y, spRoad)1029 TerrainSprite(X, Y, spRoad) 1030 1030 else if Conn > 0 then 1031 1031 for Dir := 0 to 7 do 1032 1032 if (1 shl Dir) and Conn <> 0 then 1033 T Sprite(X, Y, spRoad + 1 + Dir);1033 TerrainSprite(X, Y, spRoad + 1 + Dir); 1034 1034 end; 1035 1035 1036 1036 // Paint railroad connections 1037 1037 if (Tile and fRR <> 0) and (RRConn = 0) then 1038 T Sprite(X, Y, spRailRoad)1038 TerrainSprite(X, Y, spRailRoad) 1039 1039 else if RRConn > 0 then begin 1040 1040 for Dir := 0 to 7 do 1041 1041 if (1 shl Dir) and RRConn <> 0 then 1042 T Sprite(X, Y, spRailRoad + 1 + Dir);1042 TerrainSprite(X, Y, spRailRoad + 1 + Dir); 1043 1043 end; 1044 1044 end; … … 1087 1087 if ShowObjects and not (moEditMode in MapOptions) and 1088 1088 (Tile and fCity <> 0) and (CityInfo.Flags and ciSpacePort <> 0) then 1089 T Sprite(X + xxt, Y - 6, spSpacePort);1089 TerrainSprite(X + xxt, Y - 6, spSpacePort); 1090 1090 end; 1091 1091 … … 1156 1156 1157 1157 if (Loc >= 0) and (Loc < G.lx * G.ly) and (Loc = FAdviceLoc) then 1158 T Sprite(X, Y, spPlain);1158 TerrainSprite(X, Y, spPlain); 1159 1159 1160 1160 if (Loc >= 0) and (Loc < G.lx * G.ly) and (Tile and fSpecial <> 0) … … 1165 1165 SpecialRow := Tile and fSpecial shr 5; 1166 1166 if SpecialCol < fForest then 1167 T Sprite(X, Y, SpecialCol + SpecialRow * TerrainIconCols)1167 TerrainSprite(X, Y, SpecialCol + SpecialRow * TerrainIconCols) 1168 1168 else if (SpecialCol = fForest) and IsJungle(dy) then 1169 T Sprite(X, Y, spJungle - 1 + SpecialRow * TerrainIconCols)1169 TerrainSprite(X, Y, spJungle - 1 + SpecialRow * TerrainIconCols) 1170 1170 else 1171 T Sprite(X, Y, spForest - 1 + ((SpecialCol - fForest) * 2 + SpecialRow) * TerrainIconCols);1171 TerrainSprite(X, Y, spForest - 1 + ((SpecialCol - fForest) * 2 + SpecialRow) * TerrainIconCols); 1172 1172 end; 1173 1173 … … 1175 1175 begin 1176 1176 if Tile and fTerImp = tiMine then 1177 T Sprite(X, Y, spMine);1177 TerrainSprite(X, Y, spMine); 1178 1178 if Tile and fTerImp = tiBase then 1179 T Sprite(X, Y, spBase);1179 TerrainSprite(X, Y, spBase); 1180 1180 if Tile and fPoll <> 0 then 1181 T Sprite(X, Y, spPollution);1181 TerrainSprite(X, Y, spPollution); 1182 1182 if Tile and fTerImp = tiFort then 1183 1183 begin 1184 T Sprite(X, Y, spFortBack);1184 TerrainSprite(X, Y, spFortBack); 1185 1185 if Tile and fObserved = 0 then 1186 T Sprite(X, Y, spFortFront);1186 TerrainSprite(X, Y, spFortFront); 1187 1187 end; 1188 1188 end; 1189 1189 if (Tile and fDeadLands) <> 0 then 1190 T Sprite(X, Y, spMinerals + (Tile shr 25 and 3) * TerrainIconCols);1190 TerrainSprite(X, Y, spMinerals + (Tile shr 25 and 3) * TerrainIconCols); 1191 1191 1192 1192 if moEditMode in MapOptions then … … 1206 1206 1 + yyt + 15 * (yyt * 3 + 1)) 1207 1207 else 1208 T Sprite(X, Y, spGrid, xxt <> 33);1208 TerrainSprite(X, Y, spGrid, xxt <> 33); 1209 1209 1210 1210 if FoW and (Tile and fObserved = 0) then … … 1219 1219 if (Destination = Loc) and (Destination <> MyUn[UnFocus].Loc) then 1220 1220 if not UseBlink or BlinkOn then 1221 T Sprite(X, Y, spBlink1)1221 TerrainSprite(X, Y, spBlink1) 1222 1222 else 1223 T Sprite(X, Y, spBlink2)1223 TerrainSprite(X, Y, spBlink2) 1224 1224 end; 1225 1225 {$ENDIF} … … 1227 1227 begin 1228 1228 if Tile and fPrefStartPos <> 0 then 1229 T Sprite(X, Y, spPrefStartPos)1229 TerrainSprite(X, Y, spPrefStartPos) 1230 1230 else if Tile and fStartPos <> 0 then 1231 T Sprite(X, Y, spStartPos);1231 TerrainSprite(X, Y, spStartPos); 1232 1232 end 1233 1233 else if ShowObjects then 1234 1234 begin 1235 1235 { if (CityLoc < 0) and (UnFocus >= 0) and (Loc = MyUn[UnFocus].Loc) then 1236 if BlinkOn then T Sprite(X, Y, 8 + 9 * 0)1237 else T Sprite(X, Y, 8 + 9 * 1); }1236 if BlinkOn then TerrainSprite(X, Y, 8 + 9 * 0) 1237 else TerrainSprite(X, Y, 8 + 9 * 1); } 1238 1238 1239 1239 NameCity; … … 1286 1286 if ShowObjects and (Tile and fTerImp = tiFort) and (Tile and fObserved <> 0) 1287 1287 then 1288 T Sprite(X, Y, spFortFront);1288 TerrainSprite(X, Y, spFortFront); 1289 1289 1290 1290 if (Loc >= 0) and (Loc < G.lx * G.ly) then -
trunk/LocalPlayer/Term.pas
r535 r537 995 995 procedure TMainScreen.PaintZoomedTile(Dst: TBitmap; X, Y, Loc: Integer); 996 996 997 procedure T Sprite(xDst, yDst, xSrc, ySrc: Integer);997 procedure TerrainSprite(xDst, yDst, xSrc, ySrc: Integer); 998 998 begin 999 999 with NoMapPanel do … … 1002 1002 end; 1003 1003 1004 procedure T Sprite4(xSrc, ySrc: Integer);1004 procedure TerrainSprite4(xSrc, ySrc: Integer); 1005 1005 begin 1006 1006 with NoMapPanel do begin … … 1042 1042 1043 1043 if Tile and fTerrain >= fForest then 1044 T Sprite4(2, 2)1044 TerrainSprite4(2, 2) 1045 1045 else 1046 T Sprite4(Tile and fTerrain, 0);1046 TerrainSprite4(Tile and fTerrain, 0); 1047 1047 if Tile and fTerrain >= fForest then 1048 1048 begin … … 1051 1051 else 1052 1052 ySrc := 3 + 2 * (Tile and fTerrain - fForest); 1053 T Sprite(xxt, 0, 6, ySrc);1054 T Sprite(0, yyt, 3, ySrc);1055 T Sprite((xxt * 2), yyt, 4, ySrc + 1);1056 T Sprite(xxt, (yyt * 2), 1, ySrc + 1);1053 TerrainSprite(xxt, 0, 6, ySrc); 1054 TerrainSprite(0, yyt, 3, ySrc); 1055 TerrainSprite((xxt * 2), yyt, 4, ySrc + 1); 1056 TerrainSprite(xxt, (yyt * 2), 1, ySrc + 1); 1057 1057 end; 1058 1058 … … 1060 1060 case Tile and fTerImp of 1061 1061 tiIrrigation: begin 1062 T Sprite(xxt, 0, 0, 12);1063 T Sprite(xxt * 2, yyt, 0, 12);1062 TerrainSprite(xxt, 0, 0, 12); 1063 TerrainSprite(xxt * 2, yyt, 0, 12); 1064 1064 end; 1065 1065 tiFarm: begin 1066 T Sprite(xxt, 0, 1, 12);1067 T Sprite(xxt * 2, yyt, 1, 12);1066 TerrainSprite(xxt, 0, 1, 12); 1067 TerrainSprite(xxt * 2, yyt, 1, 12); 1068 1068 end; 1069 1069 end; … … 1071 1071 // river/canal/road/railroad 1072 1072 if Tile and fRiver <> 0 then begin 1073 T Sprite(0, yyt, 2, 14);1074 T Sprite(xxt, (yyt * 2), 2, 14);1073 TerrainSprite(0, yyt, 2, 14); 1074 TerrainSprite(xxt, (yyt * 2), 2, 14); 1075 1075 end; 1076 1076 if Tile and fCanal <> 0 then begin 1077 T Sprite(xxt, 0, 7, 11);1078 T Sprite(xxt, 0, 3, 11);1079 T Sprite(xxt * 2, yyt, 7, 11);1080 T Sprite(xxt * 2, yyt, 3, 11);1077 TerrainSprite(xxt, 0, 7, 11); 1078 TerrainSprite(xxt, 0, 3, 11); 1079 TerrainSprite(xxt * 2, yyt, 7, 11); 1080 TerrainSprite(xxt * 2, yyt, 3, 11); 1081 1081 end; 1082 1082 if Tile and fRR <> 0 then begin 1083 T Sprite((xxt * 2), yyt, 1, 10);1084 T Sprite((xxt * 2), yyt, 5, 10);1085 T Sprite(xxt, (yyt * 2), 1, 10);1086 T Sprite(xxt, (yyt * 2), 5, 10);1083 TerrainSprite((xxt * 2), yyt, 1, 10); 1084 TerrainSprite((xxt * 2), yyt, 5, 10); 1085 TerrainSprite(xxt, (yyt * 2), 1, 10); 1086 TerrainSprite(xxt, (yyt * 2), 5, 10); 1087 1087 end 1088 1088 else if Tile and fRoad <> 0 then begin 1089 T Sprite((xxt * 2), yyt, 8, 9);1090 T Sprite((xxt * 2), yyt, 5, 9);1091 T Sprite(xxt, (yyt * 2), 1, 9);1092 T Sprite(xxt, (yyt * 2), 5, 9);1089 TerrainSprite((xxt * 2), yyt, 8, 9); 1090 TerrainSprite((xxt * 2), yyt, 5, 9); 1091 TerrainSprite(xxt, (yyt * 2), 1, 9); 1092 TerrainSprite(xxt, (yyt * 2), 5, 9); 1093 1093 end; 1094 1094 1095 1095 if Tile and fPoll <> 0 then 1096 T Sprite(xxt, (yyt * 2), 6, 12);1096 TerrainSprite(xxt, (yyt * 2), 6, 12); 1097 1097 1098 1098 // special 1099 if Tile and (fTerrain or fSpecial) = fGrass or fSpecial1 then T Sprite4(2, 1)1099 if Tile and (fTerrain or fSpecial) = fGrass or fSpecial1 then TerrainSprite4(2, 1) 1100 1100 else if Tile and fSpecial <> 0 then 1101 1101 if Tile and fTerrain < fForest then 1102 T Sprite(0, yyt, Tile and fTerrain, Tile and fSpecial shr 5)1102 TerrainSprite(0, yyt, Tile and fTerrain, Tile and fSpecial shr 5) 1103 1103 else if (Tile and fTerrain = fForest) and IsJungle(Loc div G.lx) then 1104 T Sprite(0, yyt, 8, 17 + Tile and fSpecial shr 5)1104 TerrainSprite(0, yyt, 8, 17 + Tile and fSpecial shr 5) 1105 1105 else 1106 T Sprite(0, yyt, 8, 2 + (Tile and fTerrain - fForest) * 2 + Tile and1106 TerrainSprite(0, yyt, 8, 2 + (Tile and fTerrain - fForest) * 2 + Tile and 1107 1107 fSpecial shr 5) 1108 1108 else if Tile and fDeadLands <> 0 then begin 1109 T Sprite4(6, 2);1110 T Sprite(xxt, yyt, 8, 12 + Tile shr 25 and 3);1109 TerrainSprite4(6, 2); 1110 TerrainSprite(xxt, yyt, 8, 12 + Tile shr 25 and 3); 1111 1111 end; 1112 1112 1113 1113 // other improvements 1114 1114 case Tile and fTerImp of 1115 tiMine: T Sprite(xxt, 0, 2, 12);1115 tiMine: TerrainSprite(xxt, 0, 2, 12); 1116 1116 tiFort: begin 1117 T Sprite(xxt, 0, 7, 12);1118 T Sprite(xxt, 0, 3, 12);1119 end; 1120 tiBase: T Sprite(xxt, 0, 4, 12);1117 TerrainSprite(xxt, 0, 7, 12); 1118 TerrainSprite(xxt, 0, 3, 12); 1119 end; 1120 tiBase: TerrainSprite(xxt, 0, 4, 12); 1121 1121 end; 1122 1122 end;
Note:
See TracChangeset
for help on using the changeset viewer.