|
80 | 80 | #define VISUAL_AREA_MASK c_tileRoundedSquareMask |
81 | 81 |
|
82 | 82 | #define LAND_SKY_MASK c_tileSolidSquareMask |
83 | | -#define LAND_SKY_MASK_SCARE_RATIO 1.5f |
84 | | -#define LAND_SKY_MASK_BOARDER_WIDTH 5 |
| 83 | +#define LAND_SKY_MASK_SCARE_RATIO 3.6f |
| 84 | +#define LAND_SKY_MASK_BOARDER_WIDTH 0.5f |
85 | 85 |
|
86 | 86 | #define HORIZON_MASK c_tileSolidLineMask |
87 | 87 |
|
@@ -261,32 +261,32 @@ static void __on_scene_flight_attitude_instrument_frame_start(arm_2d_scene_t *pt |
261 | 261 | this.bTransformSky = this.iPitchScale > 0; |
262 | 262 |
|
263 | 263 | if (this.bTransformSky) { |
264 | | - spin_zoom_widget_set_source(&this.Roll.tLand, |
| 264 | + spin_zoom_widget_set_source_f32(&this.Roll.tLand, |
265 | 265 | NULL, |
266 | 266 | &LAND_SKY_MASK, |
267 | | - (arm_2d_location_t) { |
268 | | - LAND_SKY_MASK.tRegion.tSize.iWidth >> 1, |
269 | | - (LAND_SKY_MASK.tRegion.tSize.iHeight - 1) |
270 | | - - LAND_SKY_MASK_BOARDER_WIDTH |
271 | | - + reinterpret_s16_q16( |
272 | | - mul_n_q16( this.Roll.q16PitchRatio, |
273 | | - this.iPitchScale)) |
| 267 | + (arm_2d_point_float_t) { |
| 268 | + .fX = LAND_SKY_MASK.tRegion.tSize.iWidth / 2.0f, |
| 269 | + .fY = (LAND_SKY_MASK.tRegion.tSize.iHeight - 1) |
| 270 | + - LAND_SKY_MASK_BOARDER_WIDTH |
| 271 | + + this.Roll.fPitchRatio |
| 272 | + * (float)this.iPitchScale, |
274 | 273 | }); |
275 | 274 | spin_zoom_widget_set_colour(&this.Roll.tLand, SKY_COLOUR); |
276 | 275 |
|
277 | 276 | this.Roll.tLand.tHelper.SourceReference.ptPoints = s_tHorizonReferencePoints[HORIZON_SKY]; |
278 | 277 | this.Roll.tLand.tHelper.SourceReference.chCount = dimof(s_tHorizonReferencePoints[HORIZON_SKY]); |
279 | 278 | } else { |
280 | | - spin_zoom_widget_set_source(&this.Roll.tLand, |
281 | | - NULL, |
282 | | - &LAND_SKY_MASK, |
283 | | - (arm_2d_location_t) { |
284 | | - LAND_SKY_MASK.tRegion.tSize.iWidth >> 1, |
285 | | - LAND_SKY_MASK_BOARDER_WIDTH + |
286 | | - reinterpret_s16_q16( |
287 | | - mul_n_q16( this.Roll.q16PitchRatio, |
288 | | - this.iPitchScale)) |
289 | | - }); |
| 279 | + |
| 280 | + spin_zoom_widget_set_source_f32(&this.Roll.tLand, |
| 281 | + NULL, |
| 282 | + &LAND_SKY_MASK, |
| 283 | + (arm_2d_point_float_t) { |
| 284 | + .fX = LAND_SKY_MASK.tRegion.tSize.iWidth / 2.0f, |
| 285 | + .fY = LAND_SKY_MASK_BOARDER_WIDTH |
| 286 | + + this.Roll.fPitchRatio |
| 287 | + * (float)this.iPitchScale, |
| 288 | + }); |
| 289 | + |
290 | 290 | spin_zoom_widget_set_colour(&this.Roll.tLand, LAND_COLOUR); |
291 | 291 | this.Roll.tLand.tHelper.SourceReference.ptPoints = s_tHorizonReferencePoints[HORIZON_LAND]; |
292 | 292 | this.Roll.tLand.tHelper.SourceReference.chCount = dimof(s_tHorizonReferencePoints[HORIZON_LAND]); |
@@ -586,7 +586,7 @@ user_scene_flight_attitude_instrument_t *__arm_2d_scene_flight_attitude_instrume |
586 | 586 |
|
587 | 587 | float fPitchHeight = ((float)VISUAL_AREA_MASK.tRegion.tSize.iHeight / LAND_SKY_MASK_SCARE_RATIO) / 2.0f; |
588 | 588 |
|
589 | | - this.Roll.q16PitchRatio = reinterpret_q16_f32(fPitchHeight / 900.0f); |
| 589 | + this.Roll.fPitchRatio = fPitchHeight / 900.0f; |
590 | 590 |
|
591 | 591 | /* update reference points*/ |
592 | 592 | do { |
|
0 commit comments