comparison mm7_1.cpp @ 242:578b4a1e58ba

MonsterPopup remove goto
author zipi
date Sun, 17 Feb 2013 23:04:07 +0000
parents f305a0ece6ab
children a6a8fa73b4ec
comparison
equal deleted inserted replaced
241:f305a0ece6ab 242:578b4a1e58ba
3041 ErrD3D(pRenderer->pBackBuffer4->Blt(&v84, 0, 0, 16778240u, &Dst)); 3041 ErrD3D(pRenderer->pBackBuffer4->Blt(&v84, 0, 0, 16778240u, &Dst));
3042 if ( pRenderer->uTargetGBits == 5 ) 3042 if ( pRenderer->uTargetGBits == 5 )
3043 { 3043 {
3044 memset(&pDesc, 0, 0x7Cu); 3044 memset(&pDesc, 0, 0x7Cu);
3045 pDesc.dwSize = 124; 3045 pDesc.dwSize = 124;
3046 if ( !pRenderer->LockSurface_DDraw4((IDirectDrawSurface4 *)v222, &pDesc, DDLOCK_WAIT)) 3046 if ( pRenderer->LockSurface_DDraw4((IDirectDrawSurface4 *)v222, &pDesc, DDLOCK_WAIT))
3047 goto LABEL_51; 3047 {
3048 v20 = (char *)v124; 3048 v20 = (char *)v124;
3049 v110 = pDesc.lpSurface; 3049 v110 = pDesc.lpSurface;
3050 a2 = (Player *)v124; 3050 a2 = (Player *)v124;
3051 if ( v124 < v119 ) 3051 if ( v124 < v119 )
3052 { 3052 {
3053 v111 = 2 * pRenderer->uTargetSurfacePitch; 3053 v111 = 2 * pRenderer->uTargetSurfacePitch;
3054 v21 = (int)a4; 3054 v21 = (int)a4;
3055 v22 = &pRenderer->pTargetSurface[(int)&a4[v124 * pRenderer->uTargetSurfacePitch]]; 3055 v22 = &pRenderer->pTargetSurface[(int)&a4[v124 * pRenderer->uTargetSurfacePitch]];
3056 v23 = i - v124; 3056 v23 = i - v124;
3057 v120 = (SpellBuff *)&pRenderer->pTargetSurface[(int)&a4[v124 * pRenderer->uTargetSurfacePitch]]; 3057 v120 = (SpellBuff *)&pRenderer->pTargetSurface[(int)&a4[v124 * pRenderer->uTargetSurfacePitch]];
3058 v115 = i - v124; 3058 v115 = i - v124;
3059 while ( 1 ) 3059 while ( 1 )
3060 { 3060 {
3061 v124 = v21; 3061 v124 = v21;
3062 if ( v21 < (signed int)v116 ) 3062 if ( v21 < (signed int)v116 )
3063 { 3063 {
3064 v24 = (int)&v20[v23]; 3064 v24 = (int)&v20[v23];
3065 v25 = v107 - v21; 3065 v25 = v107 - v21;
3066 v109 = v24; 3066 v109 = v24;
3067 for ( i = v107 - v21; ; v25 = i ) 3067 for ( i = v107 - v21; ; v25 = i )
3068 { 3068 {
3069 v108 = (unsigned __int16 *)((pDesc.lPitch >> 1) * pDesc.dwHeight * v109 / v13->uAreaHeight); 3069 v108 = (unsigned __int16 *)((pDesc.lPitch >> 1) * pDesc.dwHeight * v109 / v13->uAreaHeight);
3070 v26 = (char *)v108 + pDesc.dwWidth * (v25 + v124++) / v13->uAreaWidth; 3070 v26 = (char *)v108 + pDesc.dwWidth * (v25 + v124++) / v13->uAreaWidth;
3071 *v22 = *((short *)v110 + (int)v26); 3071 *v22 = *((short *)v110 + (int)v26);
3072 ++v22; 3072 ++v22;
3073 if ( v124 >= (signed int)v116 ) 3073 if ( v124 >= (signed int)v116 )
3074 break; 3074 break;
3075 } 3075 }
3076 v23 = v115; 3076 v23 = v115;
3077 } 3077 }
3078 v22 = (unsigned __int16 *)((char *)v120 + v111); 3078 v22 = (unsigned __int16 *)((char *)v120 + v111);
3079 v20 = (char *)&a2->pConditions[0] + 1; 3079 v20 = (char *)&a2->pConditions[0] + 1;
3080 v28 = __OFSUB__((int)&a2->pConditions[0] + 1, v119); 3080 v28 = __OFSUB__((int)&a2->pConditions[0] + 1, v119);
3081 v27 = (signed int)((char *)&a2->pConditions[0] + -v119 + 1) < 0; 3081 v27 = (signed int)((char *)&a2->pConditions[0] + -v119 + 1) < 0;
3082 a2 = (Player *)((char *)a2 + 1); 3082 a2 = (Player *)((char *)a2 + 1);
3083 v120 = (SpellBuff *)((char *)v120 + v111); 3083 v120 = (SpellBuff *)((char *)v120 + v111);
3084 if ( !(v27 ^ v28) ) 3084 if ( !(v27 ^ v28) )
3085 break; 3085 break;
3086 v21 = (int)a4; 3086 v21 = (int)a4;
3087 } 3087 }
3088 } 3088 }
3089 goto LABEL_37; 3089 v222->Unlock(0);
3090 } 3090 }
3091 memset(&pDesc, 0, 0x7Cu); 3091 }
3092 pDesc.dwSize = 124; 3092 else
3093 if ( pRenderer->LockSurface_DDraw4((IDirectDrawSurface4 *)v222, &pDesc, DDLOCK_WAIT) ) 3093 {
3094 { 3094 memset(&pDesc, 0, 0x7Cu);
3095 v108 = (unsigned __int16 *)pDesc.lpSurface; 3095 pDesc.dwSize = 124;
3096 a2 = (Player *)v124; 3096 if ( pRenderer->LockSurface_DDraw4((IDirectDrawSurface4 *)v222, &pDesc, DDLOCK_WAIT) )
3097 if ( v124 < v119 ) 3097 {
3098 { 3098 v108 = (unsigned __int16 *)pDesc.lpSurface;
3099 v109 = 2 * pRenderer->uTargetSurfacePitch; 3099 a2 = (Player *)v124;
3100 v29 = (int)a4; 3100 if ( v124 < v119 )
3101 v30 = (char *)&pRenderer->pTargetSurface[(int)&a4[v124 * pRenderer->uTargetSurfacePitch]]; 3101 {
3102 v31 = i - v124; 3102 v109 = 2 * pRenderer->uTargetSurfacePitch;
3103 v120 = (SpellBuff *)&pRenderer->pTargetSurface[(int)&a4[v124 * pRenderer->uTargetSurfacePitch]]; 3103 v29 = (int)a4;
3104 v115 = i - v124; 3104 v30 = (char *)&pRenderer->pTargetSurface[(int)&a4[v124 * pRenderer->uTargetSurfacePitch]];
3105 while ( 1 ) 3105 v31 = i - v124;
3106 { 3106 v120 = (SpellBuff *)&pRenderer->pTargetSurface[(int)&a4[v124 * pRenderer->uTargetSurfacePitch]];
3107 v124 = v29; 3107 v115 = i - v124;
3108 if ( v29 < (signed int)v116 ) 3108 while ( 1 )
3109 { 3109 {
3110 v32 = v107 - (int)a4; 3110 v124 = v29;
3111 v111 = (unsigned int)((char *)a2 + v31); 3111 if ( v29 < (signed int)v116 )
3112 for ( i = v107 - (int)a4; ; v32 = i ) 3112 {
3113 { 3113 v32 = v107 - (int)a4;
3114 v110 = (LPVOID)((pDesc.lPitch >> 1) * pDesc.dwHeight * v111 / v13->uAreaHeight); 3114 v111 = (unsigned int)((char *)a2 + v31);
3115 v33 = v108[(int)((char *)v110 + pDesc.dwWidth * (v32 + v124) / v13->uAreaWidth)]; 3115 for ( i = v107 - (int)a4; ; v32 = i )
3116 v34 = v33 & 0x1F | 2 3116 {
3117 * (unsigned __int16)(v108[(int)((char *)v110 3117 v110 = (LPVOID)((pDesc.lPitch >> 1) * pDesc.dwHeight * v111 / v13->uAreaHeight);
3118 + pDesc.dwWidth * (v32 + v124++) / v13->uAreaWidth)] & 0xFFE0); 3118 v33 = v108[(int)((char *)v110 + pDesc.dwWidth * (v32 + v124) / v13->uAreaWidth)];
3119 v35 = v124; 3119 v34 = v33 & 0x1F | 2
3120 *(short *)v30 = v34; 3120 * (unsigned __int16)(v108[(int)((char *)v110
3121 v30 += 2; 3121 + pDesc.dwWidth * (v32 + v124++) / v13->uAreaWidth)] & 0xFFE0);
3122 if ( v35 >= (signed int)v116 ) 3122 v35 = v124;
3123 break; 3123 *(short *)v30 = v34;
3124 } 3124 v30 += 2;
3125 v31 = v115; 3125 if ( v35 >= (signed int)v116 )
3126 } 3126 break;
3127 a2 = (Player *)((char *)a2 + 1); 3127 }
3128 v30 = (char *)v120 + v109; 3128 v31 = v115;
3129 v120 = (SpellBuff *)((char *)v120 + v109); 3129 }
3130 if ( (signed int)a2 >= v119 ) 3130 a2 = (Player *)((char *)a2 + 1);
3131 break; 3131 v30 = (char *)v120 + v109;
3132 v29 = (int)a4; 3132 v120 = (SpellBuff *)((char *)v120 + v109);
3133 } 3133 if ( (signed int)a2 >= v119 )
3134 } 3134 break;
3135 LABEL_37: 3135 v29 = (int)a4;
3136 v222->Unlock(0); 3136 }
3137 goto LABEL_51; 3137 }
3138 } 3138 v222->Unlock(0);
3139 }
3140 }
3139 } 3141 }
3140 else 3142 else
3141 { 3143 {
3142 pRenderer->FillRectFast( 3144 pRenderer->FillRectFast(
3143 v106.uViewportX, 3145 v106.uViewportX,
3147 0); 3149 0);
3148 v36 = v10->pHwSpriteIDs[0]; 3150 v36 = v10->pHwSpriteIDs[0];
3149 if ( v36 >= 0 ) 3151 if ( v36 >= 0 )
3150 pSprites_LOD->pSpriteHeaders[v36]._4ACC38(&v106, 0); 3152 pSprites_LOD->pSpriteHeaders[v36]._4ACC38(&v106, 0);
3151 } 3153 }
3152 LABEL_51:
3153 if ( v121->uNPC_ID ) 3154 if ( v121->uNPC_ID )
3154 { 3155 {
3155 v37 = v112[6]; 3156 v37 = v112[6];
3156 if ( v37 ) 3157 if ( v37 )
3157 { 3158 {
3158 sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[429], *v112, aNPCProfessionNames[(signed int)v37]); 3159 sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[429], *v112, aNPCProfessionNames[(signed int)v37]);
3159 goto LABEL_59; 3160 }
3160 } 3161 else
3161 v77 = 2000; 3162 {
3162 v72 = *v112; 3163 v77 = 2000;
3164 v72 = *v112;
3165 }
3163 } 3166 }
3164 else 3167 else
3165 { 3168 {
3166 v38 = v121->dword_000334_unique_name; 3169 v38 = v121->dword_000334_unique_name;
3167 v77 = 2000; 3170 v77 = 2000;
3168 if ( v38 ) 3171 if ( v38 )
3169 v72 = pMonsterStats->pPlaceStrings[v38]; 3172 v72 = pMonsterStats->pPlaceStrings[v38];
3170 else 3173 else
3171 v72 = pMonsterStats->pInfos[v121->pMonsterInfo.uID].pName; 3174 v72 = pMonsterStats->pInfos[v121->pMonsterInfo.uID].pName;
3172 } 3175 }
3173 strncpy(pTmpBuf, v72, v77); 3176 if(!v121->uNPC_ID || (v121->uNPC_ID && !v37))
3174 LABEL_59: 3177 strncpy(pTmpBuf, v72, v77);
3175 v39 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0x9Bu); 3178 v39 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0x9Bu);
3176 a1->DrawTitleText(pFontComic, 0, 0xCu, v39, pTmpBuf, 3u); 3179 a1->DrawTitleText(pFontComic, 0, 0xCu, v39, pTmpBuf, 3u);
3177 Actor::DrawHealthBar(v121, a1); 3180 Actor::DrawHealthBar(v121, a1);
3178 v119 = 0; 3181 v119 = 0;
3179 pMonsterInfoUI_Doll.uCurrentActionTime += pMiscTimer->uTimeElapsed; 3182 pMonsterInfoUI_Doll.uCurrentActionTime += pMiscTimer->uTimeElapsed;
3182 i = 0; 3185 i = 0;
3183 v112 = 0; 3186 v112 = 0;
3184 if ( !uActiveCharacter ) 3187 if ( !uActiveCharacter )
3185 { 3188 {
3186 v45 = 1; 3189 v45 = 1;
3187 goto LABEL_84; 3190 }
3188 } 3191 else
3189 LOBYTE(v40) = pPlayers[uActiveCharacter]->GetActualSkillLevel(PLAYER_SKILL_MONSTER_ID); 3192 {
3190 v120 = v40; 3193 LOBYTE(v40) = pPlayers[uActiveCharacter]->GetActualSkillLevel(PLAYER_SKILL_MONSTER_ID);
3191 if ( !v40 ) 3194 v120 = v40;
3192 goto LABEL_72; 3195 if ( !v40 )
3193 v41 = (unsigned __int8)v40 & 0x3F; 3196 v45 = 1;
3194 v42 = SkillToMastery((unsigned __int16)v40) - 1; 3197 else
3195 if ( !v42 ) 3198 {
3196 { 3199 v41 = (unsigned __int8)v40 & 0x3F;
3197 if ( v41 + 10 >= v121->pMonsterInfo.uLevel ) 3200 v42 = SkillToMastery((unsigned __int16)v40) - 1;
3198 { 3201 if ( !v42 )
3199 v45 = 1; 3202 {
3200 v119 = 1; 3203 if ( v41 + 10 >= v121->pMonsterInfo.uLevel )
3201 goto LABEL_73; 3204 {
3202 } 3205 v45 = 1;
3203 goto LABEL_72; 3206 v119 = 1;
3204 } 3207 }
3205 v43 = v42 - 1; 3208 else
3206 if ( !v43 ) 3209 v45 = 1;
3207 { 3210 }
3208 if ( 2 * v41 + 10 >= v121->pMonsterInfo.uLevel ) 3211 else
3209 { 3212 {
3210 v45 = 1; 3213 v43 = v42 - 1;
3211 v119 = 1; 3214 if ( !v43 )
3212 v116 = 1; 3215 {
3213 goto LABEL_73; 3216 if ( 2 * v41 + 10 >= v121->pMonsterInfo.uLevel )
3214 } 3217 {
3215 goto LABEL_72; 3218 v45 = 1;
3216 } 3219 v119 = 1;
3217 v44 = v43 - 1; 3220 v116 = 1;
3218 if ( !v44 ) 3221 }
3219 { 3222 else
3220 if ( 3 * v41 + 10 >= v121->pMonsterInfo.uLevel ) 3223 v45 = 1;
3221 { 3224 }
3222 v45 = 1; 3225 else
3223 v119 = 1; 3226 {
3224 v116 = 1; 3227 v44 = v43 - 1;
3225 i = 1; 3228 if ( !v44 )
3226 goto LABEL_73; 3229 {
3227 } 3230 if ( 3 * v41 + 10 >= v121->pMonsterInfo.uLevel )
3228 LABEL_72: 3231 {
3229 v45 = 1; 3232 v45 = 1;
3230 goto LABEL_73; 3233 v119 = 1;
3231 } 3234 v116 = 1;
3232 if ( v44 != 1 ) 3235 i = 1;
3233 goto LABEL_72; 3236 }
3234 v45 = 1; 3237 else
3235 v119 = 1; 3238 {
3236 v116 = 1; 3239 v45 = 1;
3237 i = 1; 3240 }
3238 v112 = (char **)1; 3241 }
3239 LABEL_73: 3242 else
3240 v46 = v121->uAIState; 3243 {
3241 if ( v46 != 5 && v46 != 4 && !dword_507BF0_is_there_popup_onscreen && v120 ) 3244 if ( v44 != 1 )
3242 { 3245 v45 = 1;
3243 v47 = pPlayers[uActiveCharacter]; 3246 else
3244 if ( v119 | v116 | i | (unsigned int)v112 ) 3247 {
3245 { 3248 v45 = 1;
3246 if ( v121->pMonsterInfo.uLevel >= v47->uLevel - 5 ) 3249 v119 = 1;
3247 v73 = SPEECH_105; 3250 v116 = 1;
3248 else 3251 i = 1;
3249 v73 = SPEECH_104; 3252 v112 = (char **)1;
3250 } 3253 }
3251 else 3254 }
3252 { 3255 }
3253 v73 = SPEECH_106; 3256 }
3254 } 3257 }
3255 v47->PlaySound((PlayerSpeech)v73, 0); 3258 // LABEL_73:
3256 } 3259 v46 = v121->uAIState;
3257 LABEL_84: 3260 if ( v46 != 5 && v46 != 4 && !dword_507BF0_is_there_popup_onscreen && v120 )
3261 {
3262 v47 = pPlayers[uActiveCharacter];
3263 if ( v119 | v116 | i | (unsigned int)v112 )
3264 {
3265 if ( v121->pMonsterInfo.uLevel >= v47->uLevel - 5 )
3266 v73 = SPEECH_105;
3267 else
3268 v73 = SPEECH_104;
3269 }
3270 else
3271 {
3272 v73 = SPEECH_106;
3273 }
3274 v47->PlaySound((PlayerSpeech)v73, 0);
3275 }
3276 }
3258 a2 = pParty->pPlayers; 3277 a2 = pParty->pPlayers;
3259 do 3278 do
3260 { 3279 {
3261 LOBYTE(v48) = a2->GetActualSkillLevel(PLAYER_SKILL_MONSTER_ID); 3280 LOBYTE(v48) = a2->GetActualSkillLevel(PLAYER_SKILL_MONSTER_ID);
3262 v111 = v48; 3281 v111 = v48;