87 procedure SetLand(var LandWord: Word; Pixel: LongWord); inline; |
87 procedure SetLand(var LandWord: Word; Pixel: LongWord); inline; |
88 begin |
88 begin |
89 // this an if instead of masking colours to avoid confusing map creators |
89 // this an if instead of masking colours to avoid confusing map creators |
90 if ((AMask and Pixel) = 0) then |
90 if ((AMask and Pixel) = 0) then |
91 LandWord:= 0 |
91 LandWord:= 0 |
92 else if Pixel = $FFFFFFFF then // white |
92 else if (Pixel and AMask > 0) and (Pixel and RMask > 0) and (Pixel and GMask > 0) and (Pixel and BMask > 0) then // whiteish |
93 LandWord:= lfObject |
93 LandWord:= lfObject |
94 else if Pixel = AMask then // black |
94 else if (Pixel and AMask > 0) and (Pixel and RMask = 0) and (Pixel and GMask = 0) and (Pixel and BMask = 0) then // blackish |
95 begin |
95 begin |
96 LandWord:= lfBasic; |
96 LandWord:= lfBasic; |
97 disableLandBack:= false |
97 disableLandBack:= false |
98 end |
98 end |
99 else if Pixel = (AMask or RMask) then // red |
99 else if (Pixel and AMask > 0) and (Pixel and RMask > 0) and (Pixel and GMask = 0) and (Pixel and BMask = 0) then // reddish |
100 LandWord:= lfIndestructible |
100 LandWord:= lfIndestructible |
101 else if Pixel = (AMask or BMask) then // blue |
101 else if (Pixel and AMask > 0) and (Pixel and RMask = 0) and (Pixel and GMask = 0) and (Pixel and BMask > 0) then // blueish |
102 LandWord:= lfObject or lfIce |
102 LandWord:= lfObject or lfIce |
103 else if Pixel = (AMask or GMask) then // green |
103 else if (Pixel and AMask > 0) and (Pixel and RMask = 0) and (Pixel and GMask > 0) and (Pixel and BMask = 0) then // greenish |
104 LandWord:= lfObject or lfBouncy |
104 LandWord:= lfObject or lfBouncy |
105 end; |
105 end; |
106 |
106 |
107 procedure BlitImageAndGenerateCollisionInfo(cpX, cpY, Width: Longword; Image: PSDL_Surface); inline; |
107 procedure BlitImageAndGenerateCollisionInfo(cpX, cpY, Width: Longword; Image: PSDL_Surface); inline; |
108 begin |
108 begin |