Mercurial > mm7
comparison Indoor.cpp @ 871:710cf848ad24
Particle engine made working.
author | Nomad |
---|---|
date | Mon, 01 Apr 2013 13:39:19 +0200 |
parents | dfd683c4f538 |
children | 2db21a810d48 |
comparison
equal
deleted
inserted
replaced
838:d061180f2b42 | 871:710cf848ad24 |
---|---|
371 _this.uFlags |= INDOOR_CAMERA_DRAW_SW_OUTLINES; | 371 _this.uFlags |= INDOOR_CAMERA_DRAW_SW_OUTLINES; |
372 //INDOOR_CAMERA_DRAW_TERRAIN_OUTLINES | 372 //INDOOR_CAMERA_DRAW_TERRAIN_OUTLINES |
373 | 373 |
374 _this.field_0_timer = pEventTimer->uTotalGameTimeElapsed; | 374 _this.field_0_timer = pEventTimer->uTotalGameTimeElapsed; |
375 _this.field_1C_mb_fov = 65; | 375 _this.field_1C_mb_fov = 65; |
376 _this.vPosition.x = pParty->vPosition.x - fixpoint_mul(stru_5C6E00->Cos(pParty->sRotationY), pParty->y_rotation_granularity); | 376 _this.vPosition.x = pParty->vPosition.x - fixpoint_sub0(stru_5C6E00->Cos(pParty->sRotationY), pParty->y_rotation_granularity); |
377 _this.vPosition.y = pParty->vPosition.y - fixpoint_mul(stru_5C6E00->Sin(pParty->sRotationY), pParty->y_rotation_granularity); | 377 _this.vPosition.y = pParty->vPosition.y - fixpoint_sub0(stru_5C6E00->Sin(pParty->sRotationY), pParty->y_rotation_granularity); |
378 _this.vPosition.z = pParty->vPosition.z + pParty->sEyelevel; | 378 _this.vPosition.z = pParty->vPosition.z + pParty->sEyelevel; |
379 _this.sRotationX = pParty->sRotationX; | 379 _this.sRotationX = pParty->sRotationX; |
380 _this.sRotationY = pParty->sRotationY; | 380 _this.sRotationY = pParty->sRotationY; |
381 _this.pRenderTarget = pRenderer->pTargetSurface; | 381 _this.pRenderTarget = pRenderer->pTargetSurface; |
382 _this.uViewportX = pViewport->uScreen_TL_X; | 382 _this.uViewportX = pViewport->uScreen_TL_X; |
3169 v32 = v1->x - v2->x; | 3169 v32 = v1->x - v2->x; |
3170 LODWORD(v33) = v32 << 16; | 3170 LODWORD(v33) = v32 << 16; |
3171 HIDWORD(v33) = v32 >> 16;*/ | 3171 HIDWORD(v33) = v32 >> 16;*/ |
3172 //fixpoint_div(v1->x - v2->x, v1->y - v2->y); | 3172 //fixpoint_div(v1->x - v2->x, v1->y - v2->y); |
3173 //_a58 = v33 / (v1->y - v2->y); | 3173 //_a58 = v33 / (v1->y - v2->y); |
3174 //_a59 = fixpoint_mul(_a58, sY - v2->y); | 3174 //_a59 = fixpoint_sub0(_a58, sY - v2->y); |
3175 auto x_div_y = fixpoint_div(v1->x - v2->x, v1->y - v2->y); | 3175 auto x_div_y = fixpoint_div(v1->x - v2->x, v1->y - v2->y); |
3176 auto res = fixpoint_mul(x_div_y, sY - v2->y); // a / b * c - looks like projection | 3176 auto res = fixpoint_sub0(x_div_y, sY - v2->y); // a / b * c - looks like projection |
3177 if (res + v2->x > sX) | 3177 if (res + v2->x > sX) |
3178 ++v54; | 3178 ++v54; |
3179 } | 3179 } |
3180 else | 3180 else |
3181 { | 3181 { |
3182 auto x_div_y = fixpoint_div(v2->x - v1->x, v2->y - v1->y); | 3182 auto x_div_y = fixpoint_div(v2->x - v1->x, v2->y - v1->y); |
3183 auto res = fixpoint_mul(x_div_y, sY - v1->y); | 3183 auto res = fixpoint_sub0(x_div_y, sY - v1->y); |
3184 | 3184 |
3185 if (res + v1->x > sX) | 3185 if (res + v1->x > sX) |
3186 ++v54; | 3186 ++v54; |
3187 | 3187 |
3188 /*int _a58; | 3188 /*int _a58; |
3189 int _a59; | 3189 int _a59; |
3190 auto v32 = v2->x - v1->x; | 3190 auto v32 = v2->x - v1->x; |
3191 LODWORD(v33) = v32 << 16; | 3191 LODWORD(v33) = v32 << 16; |
3192 HIDWORD(v33) = v32 >> 16; | 3192 HIDWORD(v33) = v32 >> 16; |
3193 _a58 = v33 / (v2->y - v1->y); | 3193 _a58 = v33 / (v2->y - v1->y); |
3194 _a59 = fixpoint_mul(_a58, sY - v1->y); | 3194 _a59 = fixpoint_sub0(_a58, sY - v1->y); |
3195 | 3195 |
3196 if (_a59 + pVertices[k].x > sX) | 3196 if (_a59 + pVertices[k].x > sX) |
3197 ++v54;*/ | 3197 ++v54;*/ |
3198 } | 3198 } |
3199 } | 3199 } |