319 ty:= round(ly) |
319 ty:= round(ly) |
320 end; |
320 end; |
321 // reached edge of land. assume infinite beam. Extend it way out past camera |
321 // reached edge of land. assume infinite beam. Extend it way out past camera |
322 if ((ty and LAND_HEIGHT_MASK) <> 0) or ((tx and LAND_WIDTH_MASK) <> 0) then |
322 if ((ty and LAND_HEIGHT_MASK) <> 0) or ((tx and LAND_WIDTH_MASK) <> 0) then |
323 begin |
323 begin |
324 tx:= round(lx + ax * (LAND_WIDTH div 2)); |
324 tx:= round(lx + ax * (max(LAND_WIDTH,4096) div 2)); |
325 ty:= round(ly + ay * (LAND_WIDTH div 2)); |
325 ty:= round(ly + ay * (max(LAND_WIDTH,4096) div 2)); |
326 end; |
326 end; |
327 |
327 |
328 //if (abs(lx-tx)>8) or (abs(ly-ty)>8) then |
328 //if (abs(lx-tx)>8) or (abs(ly-ty)>8) then |
329 begin |
329 begin |
330 DrawLine(hx, hy, tx, ty, 1.0, $FF, $00, $00, $C0); |
330 DrawLine(hx, hy, tx, ty, 1.0, $FF, $00, $00, $C0); |
1084 if Gear^.State and gstTmpFlag = 0 then // Appearing |
1084 if Gear^.State and gstTmpFlag = 0 then // Appearing |
1085 begin |
1085 begin |
1086 endX:= x - WorldDx; |
1086 endX:= x - WorldDx; |
1087 endY:= y - WorldDy; |
1087 endY:= y - WorldDy; |
1088 if Gear^.Tag < 0 then |
1088 if Gear^.Tag < 0 then |
1089 startX:= max(LAND_WIDTH + 1024, endX + 2048) |
1089 startX:= max(max(LAND_WIDTH,4096) + 1024, endX + 2048) |
1090 else |
1090 else |
1091 startX:= max(-LAND_WIDTH - 1024, endX - 2048); |
1091 startX:= max(-max(LAND_WIDTH,4096) - 1024, endX - 2048); |
1092 startY:= endY - 256; |
1092 startY:= endY - 256; |
1093 DrawTextureF(SpritesData[sprBirdy].Texture, 1, startX + WorldDx + LongInt(round((endX - startX) * (-power(2, -10 * LongInt(Gear^.Timer)/2000) + 1))), startY + WorldDy + LongInt(round((endY - startY) * sqrt(1 - power((LongInt(Gear^.Timer)/2000)-1, 2)))), ((Gear^.Pos shr 6) or (RealTicks shr 8)) mod 2, Gear^.Tag, 75, 75); |
1093 DrawTextureF(SpritesData[sprBirdy].Texture, 1, startX + WorldDx + LongInt(round((endX - startX) * (-power(2, -10 * LongInt(Gear^.Timer)/2000) + 1))), startY + WorldDy + LongInt(round((endY - startY) * sqrt(1 - power((LongInt(Gear^.Timer)/2000)-1, 2)))), ((Gear^.Pos shr 6) or (RealTicks shr 8)) mod 2, Gear^.Tag, 75, 75); |
1094 end |
1094 end |
1095 else // Disappearing |
1095 else // Disappearing |
1096 begin |
1096 begin |
1097 startX:= x - WorldDx; |
1097 startX:= x - WorldDx; |
1098 startY:= y - WorldDy; |
1098 startY:= y - WorldDy; |
1099 if Gear^.Tag > 0 then |
1099 if Gear^.Tag > 0 then |
1100 endX:= max(LAND_WIDTH + 1024, startX + 2048) |
1100 endX:= max(max(LAND_WIDTH,4096) + 1024, startX + 2048) |
1101 else |
1101 else |
1102 endX:= max(-LAND_WIDTH - 1024, startX - 2048); |
1102 endX:= max(-max(LAND_WIDTH,4096) - 1024, startX - 2048); |
1103 endY:= startY + 256; |
1103 endY:= startY + 256; |
1104 DrawTextureF(SpritesData[sprBirdy].Texture, 1, startX + WorldDx + LongInt(round((endX - startX) * power(2, 10 * (LongInt(Gear^.Timer)/2000 - 1)))) + hwRound(Gear^.dX * Gear^.Timer), startY + WorldDy + LongInt(round((endY - startY) * cos(LongInt(Gear^.Timer)/2000 * (Pi/2)) - (endY - startY))) + hwRound(Gear^.dY * Gear^.Timer), ((Gear^.Pos shr 6) or (RealTicks shr 8)) mod 2, Gear^.Tag, 75, 75); |
1104 DrawTextureF(SpritesData[sprBirdy].Texture, 1, startX + WorldDx + LongInt(round((endX - startX) * power(2, 10 * (LongInt(Gear^.Timer)/2000 - 1)))) + hwRound(Gear^.dX * Gear^.Timer), startY + WorldDy + LongInt(round((endY - startY) * cos(LongInt(Gear^.Timer)/2000 * (Pi/2)) - (endY - startY))) + hwRound(Gear^.dY * Gear^.Timer), ((Gear^.Pos shr 6) or (RealTicks shr 8)) mod 2, Gear^.Tag, 75, 75); |
1105 end; |
1105 end; |
1106 end |
1106 end |
1107 else |
1107 else |