Mercurial > mm7
comparison Render.cpp @ 1542:7d986a396092
Merge
author | Nomad |
---|---|
date | Sat, 07 Sep 2013 13:03:18 +0200 |
parents | 86cb7398d2a8 af57b3b76fe4 |
children | 499761153844 |
comparison
equal
deleted
inserted
replaced
1541:86cb7398d2a8 | 1542:7d986a396092 |
---|---|
913 for (int i = 0; i < uNumLevelDecorations; ++i) | 913 for (int i = 0; i < uNumLevelDecorations; ++i) |
914 { | 914 { |
915 auto decor = &pLevelDecorations[i]; | 915 auto decor = &pLevelDecorations[i]; |
916 auto v0 = (char *)&pLevelDecorations[i].vPosition.y; | 916 auto v0 = (char *)&pLevelDecorations[i].vPosition.y; |
917 | 917 |
918 if ( (!(decor->field_2 & 0x40) || decor->_47A825()) && !(decor->field_2 & 0x20) ) | 918 if ((!(decor->uFlags & LEVEL_DECORATION_OBELISK_CHEST) || decor->IsObeliskChestActive()) && !(decor->uFlags & LEVEL_DECORATION_INVISIBLE)) |
919 { | 919 { |
920 //v1 = &pDecorationList->pDecorations[decor->uDecorationDescID]; | 920 //v1 = &pDecorationList->pDecorations[decor->uDecorationDescID]; |
921 auto decor_desc = pDecorationList->pDecorations + decor->uDecorationDescID; | 921 auto decor_desc = pDecorationList->pDecorations + decor->uDecorationDescID; |
922 v2 = decor_desc->uFlags; | 922 v2 = decor_desc->uFlags; |
923 if ( (char)v2 >= 0 ) | 923 if ( (char)v2 >= 0 ) |
924 { | |
925 if ( !(v2 & 0x22) ) | |
924 { | 926 { |
925 if ( !(v2 & 0x22) ) | 927 //v4 = decor->vPosition.x; |
928 //v5 = decor->vPosition.z; | |
929 v6 = pMiscTimer->uTotalGameTimeElapsed; | |
930 //y = decor->vPosition.y; | |
931 //x = decor->vPosition.x; | |
932 //v36 = decor->vPosition.z; | |
933 v7 = abs(decor->vPosition.x + decor->vPosition.y); | |
934 | |
935 | |
936 #pragma region "New: seasons change" | |
937 extern bool change_seasons; | |
938 if (change_seasons) | |
939 switch (pParty->uCurrentMonth) | |
940 { | |
941 // case 531 (tree60), 536 (tree65), 537 (tree66) have no autumn/winter sprites | |
942 case 11: case 0: case 1: // winter | |
943 switch (decor_desc->uSpriteID) | |
944 { | |
945 //case 468: //bush02 grows on swamps, which are evergreeen actually | |
946 case 548: // flower10 | |
947 case 547: // flower09 | |
948 case 541: // flower03 | |
949 case 539: continue; // flower01 | |
950 | |
951 case 483: // tree01 | |
952 case 486: // tree04 | |
953 case 492: // tree10 | |
954 pSpriteFrameTable->InitializeSprite(decor_desc->uSpriteID + 2); | |
955 v8 = pSpriteFrameTable->GetFrame(decor_desc->uSpriteID + 2, v6 + v7); | |
956 break; | |
957 | |
958 default: | |
959 v8 = pSpriteFrameTable->GetFrame(decor_desc->uSpriteID, v6 + v7); | |
960 } | |
961 break; | |
962 | |
963 case 2: case 3: case 4: // spring | |
964 switch (decor_desc->uSpriteID) | |
965 { | |
966 } | |
967 v8 = pSpriteFrameTable->GetFrame(decor_desc->uSpriteID, v6 + v7); | |
968 break; | |
969 | |
970 case 8: case 9: case 10: // autumn | |
971 switch (decor_desc->uSpriteID) | |
972 { | |
973 //case 468: //bush02 grows on swamps, which are evergreeen actually | |
974 case 548: // flower10 | |
975 case 547: // flower09 | |
976 case 541: // flower03 | |
977 case 539: continue; // flower01 | |
978 | |
979 case 483: // tree01 | |
980 case 486: // tree04 | |
981 case 492: // tree10 | |
982 pSpriteFrameTable->InitializeSprite(decor_desc->uSpriteID + 1); | |
983 v8 = pSpriteFrameTable->GetFrame(decor_desc->uSpriteID + 1, v6 + v7); | |
984 break; | |
985 | |
986 default: | |
987 v8 = pSpriteFrameTable->GetFrame(decor_desc->uSpriteID, v6 + v7); | |
988 } | |
989 break; | |
990 | |
991 case 5: case 6: case 7: // summer | |
992 //all green by default | |
993 v8 = pSpriteFrameTable->GetFrame(decor_desc->uSpriteID, v6 + v7); | |
994 break; | |
995 | |
996 default: assert(pParty->uCurrentMonth >= 0 && pParty->uCurrentMonth < 12); | |
997 } | |
998 else | |
999 v8 = pSpriteFrameTable->GetFrame(decor_desc->uSpriteID, v6 + v7); | |
1000 #pragma endregion | |
1001 //v8 = pSpriteFrameTable->GetFrame(decor_desc->uSpriteID, v6 + v7); | |
1002 | |
1003 //v9 = v8; | |
1004 v42 = v8->uFlags; | |
1005 a5 = v8->uGlowRadius; | |
1006 v10 = (unsigned __int16 *)stru_5C6E00->Atan2(decor->vPosition.x - pIndoorCamera->pos.x, | |
1007 decor->vPosition.y - pIndoorCamera->pos.y); | |
1008 v11 = *((int *)v0 + 2); | |
1009 v37 = v10; | |
1010 v12 = v42; | |
1011 v38 = 0; | |
1012 v13 = ((signed int)(stru_5C6E00->uIntegerPi | |
1013 + ((signed int)stru_5C6E00->uIntegerPi >> 3) | |
1014 + v11 | |
1015 - (signed int)v37) >> 8) & 7; | |
1016 v37 = (unsigned __int16 *)v13; | |
1017 if ( v42 & 2 ) | |
1018 v38 = 2; | |
1019 if ( (256 << v13) & v42 ) | |
1020 v38 |= 4u; | |
1021 if ( v12 & 0x40000 ) | |
1022 v38 |= 0x40u; | |
1023 if ( v12 & 0x20000 ) | |
1024 LOBYTE(v38) = v38 | 0x80; | |
1025 if ( a5 ) | |
926 { | 1026 { |
927 //v4 = decor->vPosition.x; | 1027 if ( pRenderer->pRenderD3D && pRenderer->bUseColoredLights ) |
928 //v5 = decor->vPosition.z; | |
929 v6 = pMiscTimer->uTotalGameTimeElapsed; | |
930 //y = decor->vPosition.y; | |
931 //x = decor->vPosition.x; | |
932 //v36 = decor->vPosition.z; | |
933 v7 = abs(decor->vPosition.x + decor->vPosition.y); | |
934 | |
935 | |
936 #pragma region "New: seasons change" | |
937 extern bool change_seasons; | |
938 if (change_seasons) | |
939 switch (pParty->uCurrentMonth) | |
940 { | |
941 // case 531 (tree60), 536 (tree65), 537 (tree66) have no autumn/winter sprites | |
942 case 11: case 0: case 1: // winter | |
943 switch (decor_desc->uSpriteID) | |
944 { | |
945 //case 468: //bush02 grows on swamps, which are evergreeen actually | |
946 case 548: // flower10 | |
947 case 547: // flower09 | |
948 case 541: // flower03 | |
949 case 539: continue; // flower01 | |
950 | |
951 case 483: // tree01 | |
952 case 486: // tree04 | |
953 case 492: // tree10 | |
954 pSpriteFrameTable->InitializeSprite(decor_desc->uSpriteID + 2); | |
955 v8 = pSpriteFrameTable->GetFrame(decor_desc->uSpriteID + 2, v6 + v7); | |
956 break; | |
957 | |
958 default: | |
959 v8 = pSpriteFrameTable->GetFrame(decor_desc->uSpriteID, v6 + v7); | |
960 } | |
961 break; | |
962 | |
963 case 2: case 3: case 4: // spring | |
964 switch (decor_desc->uSpriteID) | |
965 { | |
966 } | |
967 v8 = pSpriteFrameTable->GetFrame(decor_desc->uSpriteID, v6 + v7); | |
968 break; | |
969 | |
970 case 8: case 9: case 10: // autumn | |
971 switch (decor_desc->uSpriteID) | |
972 { | |
973 //case 468: //bush02 grows on swamps, which are evergreeen actually | |
974 case 548: // flower10 | |
975 case 547: // flower09 | |
976 case 541: // flower03 | |
977 case 539: continue; // flower01 | |
978 | |
979 case 483: // tree01 | |
980 case 486: // tree04 | |
981 case 492: // tree10 | |
982 pSpriteFrameTable->InitializeSprite(decor_desc->uSpriteID + 1); | |
983 v8 = pSpriteFrameTable->GetFrame(decor_desc->uSpriteID + 1, v6 + v7); | |
984 break; | |
985 | |
986 default: | |
987 v8 = pSpriteFrameTable->GetFrame(decor_desc->uSpriteID, v6 + v7); | |
988 } | |
989 break; | |
990 | |
991 case 5: case 6: case 7: // summer | |
992 //all green by default | |
993 v8 = pSpriteFrameTable->GetFrame(decor_desc->uSpriteID, v6 + v7); | |
994 break; | |
995 | |
996 default: assert(pParty->uCurrentMonth >= 0 && pParty->uCurrentMonth < 12); | |
997 } | |
998 else | |
999 v8 = pSpriteFrameTable->GetFrame(decor_desc->uSpriteID, v6 + v7); | |
1000 #pragma endregion | |
1001 //v8 = pSpriteFrameTable->GetFrame(decor_desc->uSpriteID, v6 + v7); | |
1002 | |
1003 //v9 = v8; | |
1004 v42 = v8->uFlags; | |
1005 a5 = v8->uGlowRadius; | |
1006 v10 = (unsigned __int16 *)stru_5C6E00->Atan2(decor->vPosition.x - pIndoorCamera->pos.x, | |
1007 decor->vPosition.y - pIndoorCamera->pos.y); | |
1008 v11 = *((int *)v0 + 2); | |
1009 v37 = v10; | |
1010 v12 = v42; | |
1011 v38 = 0; | |
1012 v13 = ((signed int)(stru_5C6E00->uIntegerPi | |
1013 + ((signed int)stru_5C6E00->uIntegerPi >> 3) | |
1014 + v11 | |
1015 - (signed int)v37) >> 8) & 7; | |
1016 v37 = (unsigned __int16 *)v13; | |
1017 if ( v42 & 2 ) | |
1018 v38 = 2; | |
1019 if ( (256 << v13) & v42 ) | |
1020 v38 |= 4u; | |
1021 if ( v12 & 0x40000 ) | |
1022 v38 |= 0x40u; | |
1023 if ( v12 & 0x20000 ) | |
1024 LOBYTE(v38) = v38 | 0x80; | |
1025 if ( a5 ) | |
1026 { | 1028 { |
1027 if ( pRenderer->pRenderD3D && pRenderer->bUseColoredLights ) | 1029 v14 = decor_desc->uColoredLightRed; |
1028 { | 1030 v15 = decor_desc->uColoredLightGreen; |
1029 v14 = decor_desc->uColoredLightRed; | 1031 v16 = decor_desc->uColoredLightBlue; |
1030 v15 = decor_desc->uColoredLightGreen; | |
1031 v16 = decor_desc->uColoredLightBlue; | |
1032 } | |
1033 else | |
1034 { | |
1035 v16 = 255; | |
1036 v14 = 255; | |
1037 v15 = 255; | |
1038 } | |
1039 b = v16; | |
1040 pStationaryLightsStack->AddLight( | |
1041 decor->vPosition.x, | |
1042 decor->vPosition.y, | |
1043 decor->vPosition.z + decor_desc->uDecorationHeight / 2, | |
1044 a5, | |
1045 v14, | |
1046 v15, | |
1047 v16, | |
1048 byte_4E94D0); | |
1049 } | |
1050 v17 = (decor->vPosition.x - pIndoorCamera->pos.x) << 16; | |
1051 if ( pIndoorCamera->sRotationX ) | |
1052 { | |
1053 v40 = (decor->vPosition.y - pIndoorCamera->pos.y) << 16; | |
1054 v18 = ((unsigned __int64)(v17 * (signed __int64)pOutdoorCamera->camera_rotation_y_int_cosine) >> 16) | |
1055 + ((unsigned __int64)(v40 * (signed __int64)pOutdoorCamera->camera_rotation_y_int_sine) >> 16); | |
1056 v42 = v18; | |
1057 b = (unsigned __int64)(v17 * (signed __int64)pOutdoorCamera->camera_rotation_y_int_sine) >> 16; | |
1058 a5 = (unsigned __int64)(v40 * (signed __int64)pOutdoorCamera->camera_rotation_y_int_cosine) >> 16; | |
1059 v40 = (decor->vPosition.z - pIndoorCamera->pos.z) << 16; | |
1060 v41 = (unsigned __int64)(v40 * (signed __int64)pOutdoorCamera->camera_rotation_x_int_sine) >> 16; | |
1061 v19 = (unsigned __int64)(v18 * (signed __int64)pOutdoorCamera->camera_rotation_x_int_cosine) >> 16; | |
1062 v20 = v19 + ((unsigned __int64)(v40 * (signed __int64)pOutdoorCamera->camera_rotation_x_int_sine) >> 16); | |
1063 v39 = v19 + ((unsigned __int64)(v40 * (signed __int64)pOutdoorCamera->camera_rotation_x_int_sine) >> 16); | |
1064 if ( v20 >= 262144 && v20 <= pOutdoorCamera->shading_dist_mist << 16 ) | |
1065 { | |
1066 v21 = a5 - b; | |
1067 v41 = a5 - b; | |
1068 a5 = (unsigned __int64)(v42 * (signed __int64)pOutdoorCamera->camera_rotation_x_int_sine) >> 16; | |
1069 b = (unsigned __int64)(v40 * (signed __int64)pOutdoorCamera->camera_rotation_x_int_cosine) >> 16; | |
1070 v22 = ((unsigned __int64)(v40 * (signed __int64)pOutdoorCamera->camera_rotation_x_int_cosine) >> 16) - a5; | |
1071 LABEL_30: | |
1072 v42 = v22; | |
1073 v40 = 2 * abs(v20); | |
1074 v23 = abs(v21); | |
1075 if ( v40 >= v23 ) | |
1076 { | |
1077 LODWORD(v24) = 0; | |
1078 HIDWORD(v24) = SLOWORD(pOutdoorCamera->int_fov_rad); | |
1079 a5 = v24 / v39; | |
1080 v25 = pViewport->uScreenCenterX | |
1081 - ((signed int)(((unsigned __int64)(v24 / v39 * v41) >> 16) + 32768) >> 16); | |
1082 b = (unsigned __int64)(a5 * (signed __int64)v42) >> 16; | |
1083 v41 = v24 / v39; | |
1084 v40 = pViewport->uScreenCenterY | |
1085 - ((signed int)(((unsigned __int64)(a5 * (signed __int64)v42) >> 16) + 32768) >> 16); | |
1086 v42 = v8->scale; | |
1087 v41 = (unsigned __int64)(v42 * v24 / v39) >> 16; | |
1088 v37 = (unsigned __int16 *)&v8->pHwSpriteIDs[(int)v37]; | |
1089 if ( pRenderer->pRenderD3D ) | |
1090 { | |
1091 v26 = v41; | |
1092 v42 = pSprites_LOD->pHardwareSprites[(signed __int16)*v37].uBufferWidth >> 1; | |
1093 b = (unsigned __int64)(v42 * (signed __int64)v41) >> 16; | |
1094 } | |
1095 else | |
1096 { | |
1097 v26 = v41; | |
1098 v42 = pSprites_LOD->pSpriteHeaders[(signed __int16)*v37].uWidth >> 1; | |
1099 b = (unsigned __int64)(v42 * (signed __int64)v41) >> 16; | |
1100 } | |
1101 if ( b + v25 >= (signed int)pViewport->uViewportTL_X && v25 - b <= (signed int)pViewport->uViewportBR_X ) | |
1102 { | |
1103 if (::uNumBillboardsToDraw >= 500) | |
1104 return; | |
1105 v27 = &pBillboardRenderList[::uNumBillboardsToDraw++]; | |
1106 ++uNumDecorationsDrawnThisFrame; | |
1107 v27->uHwSpriteID = *v37; | |
1108 v28 = v8->uPaletteIndex; | |
1109 v27->_screenspace_x_scaler_packedfloat = v26; | |
1110 v27->_screenspace_y_scaler_packedfloat = v26; | |
1111 v29 = v38; | |
1112 v27->uScreenSpaceX = v25; | |
1113 HIBYTE(v29) |= 2u; | |
1114 v27->uPalette = v28; | |
1115 v27->field_1E = v29; | |
1116 v27->world_x = decor->vPosition.x; | |
1117 v27->world_y = decor->vPosition.y; | |
1118 v27->world_z = decor->vPosition.z; | |
1119 v27->uScreenSpaceY = v40; | |
1120 HIWORD(v30) = HIWORD(v39); | |
1121 v31 = PID(OBJECT_Decoration,i); | |
1122 LOWORD(v30) = 0; | |
1123 v27->uIndoorSectorID = 0; | |
1124 v27->sZValue = v30 + v31; | |
1125 v27->dimming_level = 0; | |
1126 v27->pSpriteFrame = v8; | |
1127 v27->uTintColor = 0; | |
1128 } | |
1129 } | |
1130 goto LABEL_38; | |
1131 } | |
1132 } | 1032 } |
1133 else | 1033 else |
1134 { | 1034 { |
1135 v42 = (decor->vPosition.x - pIndoorCamera->pos.x) << 16; | 1035 v16 = 255; |
1136 v40 = (decor->vPosition.y - pIndoorCamera->pos.y) << 16; | 1036 v14 = 255; |
1137 b = (unsigned __int64)(v17 * (signed __int64)pOutdoorCamera->camera_rotation_y_int_cosine) >> 16; | 1037 v15 = 255; |
1138 a5 = (unsigned __int64)(v40 * (signed __int64)pOutdoorCamera->camera_rotation_y_int_sine) >> 16; | 1038 } |
1139 v20 = b + ((unsigned __int64)(v40 * (signed __int64)pOutdoorCamera->camera_rotation_y_int_sine) >> 16); | 1039 b = v16; |
1140 v39 = b + ((unsigned __int64)(v40 * (signed __int64)pOutdoorCamera->camera_rotation_y_int_sine) >> 16); | 1040 pStationaryLightsStack->AddLight( |
1141 if ( v20 >= 262144 && v20 <= pOutdoorCamera->shading_dist_mist << 16 ) | 1041 decor->vPosition.x, |
1042 decor->vPosition.y, | |
1043 decor->vPosition.z + decor_desc->uDecorationHeight / 2, | |
1044 a5, | |
1045 v14, | |
1046 v15, | |
1047 v16, | |
1048 byte_4E94D0); | |
1049 } | |
1050 v17 = (decor->vPosition.x - pIndoorCamera->pos.x) << 16; | |
1051 if ( pIndoorCamera->sRotationX ) | |
1052 { | |
1053 v40 = (decor->vPosition.y - pIndoorCamera->pos.y) << 16; | |
1054 v18 = ((unsigned __int64)(v17 * (signed __int64)pOutdoorCamera->camera_rotation_y_int_cosine) >> 16) | |
1055 + ((unsigned __int64)(v40 * (signed __int64)pOutdoorCamera->camera_rotation_y_int_sine) >> 16); | |
1056 v42 = v18; | |
1057 b = (unsigned __int64)(v17 * (signed __int64)pOutdoorCamera->camera_rotation_y_int_sine) >> 16; | |
1058 a5 = (unsigned __int64)(v40 * (signed __int64)pOutdoorCamera->camera_rotation_y_int_cosine) >> 16; | |
1059 v40 = (decor->vPosition.z - pIndoorCamera->pos.z) << 16; | |
1060 v41 = (unsigned __int64)(v40 * (signed __int64)pOutdoorCamera->camera_rotation_x_int_sine) >> 16; | |
1061 v19 = (unsigned __int64)(v18 * (signed __int64)pOutdoorCamera->camera_rotation_x_int_cosine) >> 16; | |
1062 v20 = v19 + ((unsigned __int64)(v40 * (signed __int64)pOutdoorCamera->camera_rotation_x_int_sine) >> 16); | |
1063 v39 = v19 + ((unsigned __int64)(v40 * (signed __int64)pOutdoorCamera->camera_rotation_x_int_sine) >> 16); | |
1064 if ( v20 >= 262144 && v20 <= pOutdoorCamera->shading_dist_mist << 16 ) | |
1065 { | |
1066 v21 = a5 - b; | |
1067 v41 = a5 - b; | |
1068 a5 = (unsigned __int64)(v42 * (signed __int64)pOutdoorCamera->camera_rotation_x_int_sine) >> 16; | |
1069 b = (unsigned __int64)(v40 * (signed __int64)pOutdoorCamera->camera_rotation_x_int_cosine) >> 16; | |
1070 v22 = ((unsigned __int64)(v40 * (signed __int64)pOutdoorCamera->camera_rotation_x_int_cosine) >> 16) - a5; | |
1071 LABEL_30: | |
1072 v42 = v22; | |
1073 v40 = 2 * abs(v20); | |
1074 v23 = abs(v21); | |
1075 if ( v40 >= v23 ) | |
1142 { | 1076 { |
1143 a5 = (unsigned __int64)(v42 * (signed __int64)pOutdoorCamera->camera_rotation_y_int_sine) >> 16; | 1077 LODWORD(v24) = 0; |
1144 b = (unsigned __int64)(v40 * (signed __int64)pOutdoorCamera->camera_rotation_y_int_cosine) >> 16; | 1078 HIDWORD(v24) = SLOWORD(pOutdoorCamera->int_fov_rad); |
1145 v21 = ((unsigned __int64)(v40 * (signed __int64)pOutdoorCamera->camera_rotation_y_int_cosine) >> 16) - a5; | 1079 a5 = v24 / v39; |
1146 v41 = ((unsigned __int64)(v40 * (signed __int64)pOutdoorCamera->camera_rotation_y_int_cosine) >> 16) - a5; | 1080 v25 = pViewport->uScreenCenterX |
1147 v22 = (decor->vPosition.z - pIndoorCamera->pos.z) << 16; | 1081 - ((signed int)(((unsigned __int64)(v24 / v39 * v41) >> 16) + 32768) >> 16); |
1148 goto LABEL_30; | 1082 b = (unsigned __int64)(a5 * (signed __int64)v42) >> 16; |
1083 v41 = v24 / v39; | |
1084 v40 = pViewport->uScreenCenterY | |
1085 - ((signed int)(((unsigned __int64)(a5 * (signed __int64)v42) >> 16) + 32768) >> 16); | |
1086 v42 = v8->scale; | |
1087 v41 = (unsigned __int64)(v42 * v24 / v39) >> 16; | |
1088 v37 = (unsigned __int16 *)&v8->pHwSpriteIDs[(int)v37]; | |
1089 if ( pRenderer->pRenderD3D ) | |
1090 { | |
1091 v26 = v41; | |
1092 v42 = pSprites_LOD->pHardwareSprites[(signed __int16)*v37].uBufferWidth >> 1; | |
1093 b = (unsigned __int64)(v42 * (signed __int64)v41) >> 16; | |
1094 } | |
1095 else | |
1096 { | |
1097 v26 = v41; | |
1098 v42 = pSprites_LOD->pSpriteHeaders[(signed __int16)*v37].uWidth >> 1; | |
1099 b = (unsigned __int64)(v42 * (signed __int64)v41) >> 16; | |
1100 } | |
1101 if ( b + v25 >= (signed int)pViewport->uViewportTL_X && v25 - b <= (signed int)pViewport->uViewportBR_X ) | |
1102 { | |
1103 if (::uNumBillboardsToDraw >= 500) | |
1104 return; | |
1105 v27 = &pBillboardRenderList[::uNumBillboardsToDraw++]; | |
1106 ++uNumDecorationsDrawnThisFrame; | |
1107 v27->uHwSpriteID = *v37; | |
1108 v28 = v8->uPaletteIndex; | |
1109 v27->_screenspace_x_scaler_packedfloat = v26; | |
1110 v27->_screenspace_y_scaler_packedfloat = v26; | |
1111 v29 = v38; | |
1112 v27->uScreenSpaceX = v25; | |
1113 HIBYTE(v29) |= 2u; | |
1114 v27->uPalette = v28; | |
1115 v27->field_1E = v29; | |
1116 v27->world_x = decor->vPosition.x; | |
1117 v27->world_y = decor->vPosition.y; | |
1118 v27->world_z = decor->vPosition.z; | |
1119 v27->uScreenSpaceY = v40; | |
1120 HIWORD(v30) = HIWORD(v39); | |
1121 v31 = PID(OBJECT_Decoration,i); | |
1122 LOWORD(v30) = 0; | |
1123 v27->uIndoorSectorID = 0; | |
1124 v27->sZValue = v30 + v31; | |
1125 v27->dimming_level = 0; | |
1126 v27->pSpriteFrame = v8; | |
1127 v27->uTintColor = 0; | |
1128 } | |
1149 } | 1129 } |
1130 goto LABEL_38; | |
1131 } | |
1132 } | |
1133 else | |
1134 { | |
1135 v42 = (decor->vPosition.x - pIndoorCamera->pos.x) << 16; | |
1136 v40 = (decor->vPosition.y - pIndoorCamera->pos.y) << 16; | |
1137 b = (unsigned __int64)(v17 * (signed __int64)pOutdoorCamera->camera_rotation_y_int_cosine) >> 16; | |
1138 a5 = (unsigned __int64)(v40 * (signed __int64)pOutdoorCamera->camera_rotation_y_int_sine) >> 16; | |
1139 v20 = b + ((unsigned __int64)(v40 * (signed __int64)pOutdoorCamera->camera_rotation_y_int_sine) >> 16); | |
1140 v39 = b + ((unsigned __int64)(v40 * (signed __int64)pOutdoorCamera->camera_rotation_y_int_sine) >> 16); | |
1141 if ( v20 >= 262144 && v20 <= pOutdoorCamera->shading_dist_mist << 16 ) | |
1142 { | |
1143 a5 = (unsigned __int64)(v42 * (signed __int64)pOutdoorCamera->camera_rotation_y_int_sine) >> 16; | |
1144 b = (unsigned __int64)(v40 * (signed __int64)pOutdoorCamera->camera_rotation_y_int_cosine) >> 16; | |
1145 v21 = ((unsigned __int64)(v40 * (signed __int64)pOutdoorCamera->camera_rotation_y_int_cosine) >> 16) - a5; | |
1146 v41 = ((unsigned __int64)(v40 * (signed __int64)pOutdoorCamera->camera_rotation_y_int_cosine) >> 16) - a5; | |
1147 v22 = (decor->vPosition.z - pIndoorCamera->pos.z) << 16; | |
1148 goto LABEL_30; | |
1150 } | 1149 } |
1151 } | 1150 } |
1152 } | 1151 } |
1153 else | 1152 } |
1154 { | 1153 else |
1155 memset(&local_0, 0, 0x68u); | 1154 { |
1156 v3 = (double)*((signed int *)v0 - 1); | 1155 memset(&local_0, 0, 0x68u); |
1157 local_0.type = ParticleType_Bitmap | ParticleType_Rotating | ParticleType_8; | 1156 v3 = (double)*((signed int *)v0 - 1); |
1158 local_0.uDiffuse = 0xFF3C1E; | 1157 local_0.type = ParticleType_Bitmap | ParticleType_Rotating | ParticleType_8; |
1159 local_0.x = v3; | 1158 local_0.uDiffuse = 0xFF3C1E; |
1160 local_0.y = (double)*(signed int *)v0; | 1159 local_0.x = v3; |
1161 local_0.z = (double)*((signed int *)v0 + 1); | 1160 local_0.y = (double)*(signed int *)v0; |
1162 local_0.r = 0.0; | 1161 local_0.z = (double)*((signed int *)v0 + 1); |
1163 local_0.g = 0.0; | 1162 local_0.r = 0.0; |
1164 local_0.b = 0.0; | 1163 local_0.g = 0.0; |
1165 local_0.flt_28 = 1.0; | 1164 local_0.b = 0.0; |
1166 local_0.timeToLive = (rand() & 0x80) + 128; | 1165 local_0.flt_28 = 1.0; |
1167 local_0.uTextureID = pBitmaps_LOD->LoadTexture("effpar01"); | 1166 local_0.timeToLive = (rand() & 0x80) + 128; |
1168 pGame->pParticleEngine->AddParticle(&local_0); | 1167 local_0.uTextureID = pBitmaps_LOD->LoadTexture("effpar01"); |
1169 } | 1168 pGame->pParticleEngine->AddParticle(&local_0); |
1170 } | 1169 } |
1170 } | |
1171 LABEL_38: | 1171 LABEL_38: |
1172 ; | 1172 ; |
1173 //++v35; | 1173 //++v35; |
1174 //v0 += 32; | 1174 //v0 += 32; |
1175 } | 1175 } |
2101 | 2101 |
2102 hd_water_tile_id = -1; | 2102 hd_water_tile_id = -1; |
2103 hd_water_current_frame = 0; | 2103 hd_water_current_frame = 0; |
2104 } | 2104 } |
2105 | 2105 |
2106 bool Render::Initialize(bool bWindowed, uint uDefaultDevice, bool bColoredLights, uint uDetailLevel, uint bTinting) | 2106 bool Render::Initialize(bool bWindowed, uint32_t uDefaultDevice, bool bColoredLights, uint32_t uDetailLevel, bool bTinting) |
2107 { | 2107 { |
2108 bUserDirect3D = true;//ReadWindowsRegistryInt("Use D3D", 0); | 2108 bUserDirect3D = true;//ReadWindowsRegistryInt("Use D3D", 0); |
2109 bStartInWindow = bWindowed; | 2109 bStartInWindow = bWindowed; |
2110 | 2110 |
2111 uDesiredDirect3DDevice = uDefaultDevice;//ReadWindowsRegistryInt("D3D Device", 1); | 2111 uDesiredDirect3DDevice = uDefaultDevice;//ReadWindowsRegistryInt("D3D Device", 1); |
7357 } | 7357 } |
7358 } | 7358 } |
7359 } | 7359 } |
7360 | 7360 |
7361 //----- (004A6A68) -------------------------------------------------------- | 7361 //----- (004A6A68) -------------------------------------------------------- |
7362 void Render::_4A6A68(unsigned int a2, unsigned int a3, Texture *a4, __int16 height) | 7362 void Render::GetLeather(unsigned int a2, unsigned int a3, Texture *a4, __int16 height) |
7363 { | 7363 { |
7364 Render *v5; // ebx@1 | |
7365 unsigned __int16 v6; // ax@1 | |
7366 | |
7367 v5 = this; | |
7368 | |
7369 Texture tex; // [sp+Ch] [bp-48h]@1 | 7364 Texture tex; // [sp+Ch] [bp-48h]@1 |
7370 //Texture::Texture(&tex); | 7365 |
7371 | |
7372 v6 = a4->uTextureHeight - height; | |
7373 memcpy(&tex, a4, sizeof(tex)); | 7366 memcpy(&tex, a4, sizeof(tex)); |
7374 tex.uTextureHeight = v6; | 7367 tex.uTextureHeight = a4->uTextureHeight - height; |
7375 if ( (signed __int16)v6 > 0 ) | 7368 if ( (signed __int16)tex.uTextureHeight > 0 ) |
7376 DrawTextureIndexed(a2, a3, &tex); | 7369 DrawTextureIndexed(a2, a3, &tex); |
7377 } | 7370 } |
7378 | 7371 |
7379 //----- (004A6AB1) -------------------------------------------------------- | 7372 //----- (004A6AB1) -------------------------------------------------------- |
7380 void Render::DrawTextPalette( int x, int y, unsigned char* font_pixels, int a5, unsigned int uFontHeight, unsigned __int16 *pPalette, int a8 ) | 7373 void Render::DrawTextPalette( int x, int y, unsigned char* font_pixels, int a5, unsigned int uFontHeight, unsigned __int16 *pPalette, int a8 ) |