Mercurial > mm7
diff Render.cpp @ 2425:d922225a6081
Hot key for mm7 main menu
author | Ritor1 |
---|---|
date | Wed, 23 Jul 2014 16:06:17 +0600 |
parents | bb1273b1b9b6 |
children | 22ac062b40f7 |
line wrap: on
line diff
--- a/Render.cpp Tue Jul 22 23:07:24 2014 +0200 +++ b/Render.cpp Wed Jul 23 16:06:17 2014 +0600 @@ -272,7 +272,7 @@ } } //-------(Отсечение невидимой части карты)------------------------------------------------------------------------------------------ - float direction = pGame->pIndoorCameraD3D->sRotationY / 256;//direction of the camera(напрвление камеры) + float direction = (float)(pGame->pIndoorCameraD3D->sRotationY / 256);//direction of the camera(напрвление камеры) //0-East(B) //1-NorthEast(CB) //2-North(C) @@ -281,7 +281,7 @@ //5-SouthWest(ЮЗ) //6-South(Ю) //7-SouthEast(ЮВ) - int Start_X, End_X, Start_Z, End_Z; + unsigned int Start_X, End_X, Start_Z, End_Z; if ( direction >= 0 && direction < 1.0 )//East(B) - NorthEast(CB) { Start_X = pODMRenderParams->uMapGridCellX - 2, End_X = 127; @@ -507,7 +507,7 @@ billboard.uViewportW = pViewport->uViewportBR_Y; pODMRenderParams->uNumBillboards = uNumBillboardsToDraw; - for (int i = 0; i < ::uNumBillboardsToDraw; ++i) + for (unsigned int i = 0; i < ::uNumBillboardsToDraw; ++i) { billboard.uScreenSpaceX = pBillboardRenderList[i].uScreenSpaceX; billboard.uScreenSpaceY = pBillboardRenderList[i].uScreenSpaceY; @@ -574,7 +574,7 @@ signed __int16 v46; // [sp+3Ch] [bp-4h]@12 //v41 = 0; - for (int i = 0; i < uNumSpriteObjects; ++i) + for (unsigned int i = 0; i < uNumSpriteObjects; ++i) { SpriteObject* object = &pSpriteObjects[i]; //auto v0 = (char *)&pSpriteObjects[i].uSectorID; @@ -949,7 +949,7 @@ int v42; // [sp+98h] [bp-Ch]@9 int b; // [sp+A0h] [bp-4h]@22 - for (int i = 0; i < uNumLevelDecorations; ++i) + for (unsigned int i = 0; i < uNumLevelDecorations; ++i) { //LevelDecoration* decor = &pLevelDecorations[i]; if ((!(pLevelDecorations[i].uFlags & LEVEL_DECORATION_OBELISK_CHEST) @@ -2191,9 +2191,6 @@ //----- (0049EB79) -------------------------------------------------------- Render::~Render() { - Render *v1; // esi@1 - - //v1 = this; free(this->pDefaultZBuffer); this->pD3DBitmaps.Release(); this->pD3DSprites.Release(); @@ -2341,7 +2338,7 @@ PCXHeader_2 header2; // [sp+140h] [bp-24h]@10 char *lineRGB; // [sp+148h] [bp-1Ch]@10 void *surface; // [sp+14Ch] [bp-18h]@8 - int image_width; // [sp+150h] [bp-14h]@4 + unsigned int image_width; // [sp+150h] [bp-14h]@4 int pitch; // [sp+154h] [bp-10h]@4 char v31; // [sp+15Ah] [bp-Ah]@25 unsigned char pict_byte; // [sp+15Bh] [bp-9h]@17 @@ -2419,7 +2416,7 @@ image_width = 3 * pitch; //v24 = 2 * v5; v8 = (unsigned short *)surface; - for ( int y = 0; y < this->GetRenderHeight(); y++ ) + for ( unsigned int y = 0; y < this->GetRenderHeight(); y++ ) { line_picture_data = v8; if ( GetRenderWidth() > 0 ) @@ -4974,7 +4971,7 @@ v5 = 31 - (pSkyPolygon->dimming_level & 0x1F); if ( v5 < pOutdoor->max_terrain_dimming_level ) v5 = pOutdoor->max_terrain_dimming_level; - for (uint i = 0; i < uNumVertices; ++i) + for (uint i = 0; i < (unsigned int)uNumVertices; ++i) { d3d_vertex_buffer[i].pos.x = array_507D30[i].vWorldViewProjX; d3d_vertex_buffer[i].pos.y = array_507D30[i].vWorldViewProjY; @@ -5000,7 +4997,6 @@ signed __int64 v6; // qax@3 int v12; // edx@7 int v13; // eax@7 -// void *v15; // ecx@9 int v17; // edi@9 double v18; // st7@9 signed int v19; // ebx@9 @@ -5008,16 +5004,8 @@ int v21; // ebx@11 int v22; // eax@14 signed __int64 v23; // qtt@16 -// double v24; // st7@16 -// unsigned __int8 v25; // sf@16 -// unsigned __int8 v26; // of@16 double v28; // st7@20 -// char *v29; // ebx@20 -// char *v30; // edx@20 -// unsigned __int8 v31; // c0@21 -// unsigned __int8 v32; // c3@21 double v33; // st6@23 -// char *v34; // esi@30 const void *v35; // ecx@31 int v36; // eax@31 const void *v37; // edi@31 @@ -5027,24 +5015,12 @@ int v41; // eax@36 signed __int64 v42; // qtt@39 int v43; // eax@39 -// char v44; // zf@39 -// double v45; // st7@39 -// double v46; // st7@39 -// unsigned int v47; // edx@40 double v48; // st7@41 -// RenderVertexSoft *v49; // ebx@41 -// void *v50; // edi@43 double v51; // st7@46 -// RenderVertexSoft *v52; // edx@46 -// void *v53; // edi@48 -// signed int v59; // [sp-4h] [bp-178h]@17 -// struct Polygon *v60; // [sp+0h] [bp-174h]@17 -// IDirect3DTexture2 *v61; // [sp+4h] [bp-170h]@17 struct Polygon pSkyPolygon; // [sp+14h] [bp-160h]@6 unsigned int v63; // [sp+120h] [bp-54h]@7 unsigned int v65; // [sp+128h] [bp-4Ch]@1 unsigned int v66; // [sp+12Ch] [bp-48h]@7 - //float v67; // [sp+130h] [bp-44h]@7 __int64 v69; // [sp+13Ch] [bp-38h]@3 int v70; // [sp+144h] [bp-30h]@3 int X; // [sp+148h] [bp-2Ch]@9 @@ -6229,7 +6205,6 @@ void Render::_4A4CC9_AddSomeBillboard(stru6_stru1_indoor_sw_billboard *a1, int diffuse) { unsigned int v5; // eax@7 -// char *v7; // edx@8 double v10; // st6@9 double v11; // st6@10 int v12; // ebx@13 @@ -6238,7 +6213,7 @@ return; float depth = 1000000.0; - for (uint i = 0; i < a1->uNumVertices; ++i) + for (uint i = 0; i < (unsigned int)a1->uNumVertices; ++i) { if (a1->field_104[i].z < depth) depth = a1->field_104[i * 4].z; @@ -6252,7 +6227,7 @@ pBillboardRenderListD3D[v5].uNumVertices = a1->uNumVertices; pBillboardRenderListD3D[v5].z_order = depth; - for (uint i = 0; i < a1->uNumVertices; ++i) + for (uint i = 0; i < (unsigned int)a1->uNumVertices; ++i) { pBillboardRenderListD3D[v5].pQuads[i].pos.x = a1->field_104[i].x; pBillboardRenderListD3D[v5].pQuads[i].pos.y = a1->field_104[i].y; @@ -6336,7 +6311,7 @@ bMipMaps = 0; v13 = pHWLTexture->pPixels; v14 = (unsigned __int16 *)desc.lpSurface; - for(int bMipMaps = 0; bMipMaps < desc.dwHeight; bMipMaps++) + for(uint bMipMaps = 0; bMipMaps < desc.dwHeight; bMipMaps++) { for (v15 = 0; v15 < desc.dwWidth; v15++) { @@ -6381,9 +6356,9 @@ { v9 = sprite_texture->pPixels; v10 = Dst.lpSurface; - for (int i=0; i<sprite_texture->uHeight; ++i) - { - for (int j=0; j<sprite_texture->uWidth/2; ++j) + for (uint i=0; i<sprite_texture->uHeight; ++i) + { + for (uint j=0; j<sprite_texture->uWidth/2; ++j) { *(int *)v10 = *(int *)v9; v9 += 2; @@ -6934,7 +6909,7 @@ } } - for (int y = 0; y < v6; ++y) + for (uint y = 0; y < v6; ++y) { for (int x = 0; x < v5; ++x) { @@ -7121,9 +7096,9 @@ } } - for (int y = 0; y < v10; ++y) - { - for (int x = 0; x < v9; ++x) + for (uint y = 0; y < v10; ++y) + { + for (uint x = 0; x < v9; ++x) { if (*v24) { @@ -7238,7 +7213,7 @@ if ( a8 ) { v28 = 0x7FF; // 16bit pRenderer->uTargetGMask | pRenderer->uTargetBMask; - for (int dy = 0; dy < v9; ++dy) + for (uint dy = 0; dy < v9; ++dy) { for (int dx = 0; dx < v8; ++dx) { @@ -7286,7 +7261,7 @@ } else { - for (int dy = 0; dy < v9; ++dy) + for (uint dy = 0; dy < v9; ++dy) { for (int dx = 0; dx < v8; ++dx) { @@ -7513,7 +7488,7 @@ } v16 = v19; - for (int y = 0; y < v5; ++y) + for (uint y = 0; y < v5; ++y) { for (int x = 0; x < v20; ++x) { @@ -7612,7 +7587,7 @@ } } - for (int dy = 0; dy < uHeight; ++dy) + for (uint dy = 0; dy < uHeight; ++dy) { for (int dx = 0; dx < Width; ++dx) { @@ -8259,7 +8234,7 @@ pPaletteManager->RecalculateAll(); pBitmaps_LOD->SetupPalettes(pRenderer->uTargetRBits, pRenderer->uTargetGBits, pRenderer->uTargetBBits); pIcons_LOD->SetupPalettes(pRenderer->uTargetRBits, pRenderer->uTargetGBits, pRenderer->uTargetBBits); - for (int i = 0; i < pObjectList->uNumObjects; i++) + for (uint i = 0; i < pObjectList->uNumObjects; i++) { BYTE3(v4) = 0; v5 = &pObjectList->pObjects[i]; @@ -8446,7 +8421,7 @@ v5 = this->pFile; this->uDataOffset = v4; fwrite(&this->uNumItems, 4u, 1u, v5); - for (int i = 0; i < this->uNumItems; i++) + for (uint i = 0; i < this->uNumItems; i++) { fwrite(this->pSpriteNames[i], 1u, 0x14u, this->pFile); fprintf(File, "D3D texture name: %s\t\toffset: %x\n", this->pSpriteNames[i], *(unsigned int *)(&(this->pSpriteNames[i]) + 200000/sizeof(char*))); @@ -8460,7 +8435,7 @@ else { fclose(this->pFile); - for (int i = 0; i < this->uNumItems; i++) + for (uint i = 0; i < this->uNumItems; i++) { free(this->pSpriteNames[i]); } @@ -8664,7 +8639,7 @@ // v2 v1 int out_num_vertices = 0; - for (int i = 0; i < num_vertices; ++i) + for (uint i = 0; i < num_vertices; ++i) { next_vertices_flag = array_50AC10[i + 1].vWorldViewPosition.x <= 8.0;// if ( current_vertices_flag ^ next_vertices_flag ) @@ -8812,7 +8787,7 @@ unused = 0; if ( (signed int)pOutdoor->uNumBModels > 0 ) { - for ( uint model_id = 0; model_id < pOutdoor->uNumBModels; model_id++ ) + for ( uint model_id = 0; model_id < (unsigned int)pOutdoor->uNumBModels; model_id++ ) { if ( IsBModelVisible(model_id, &unused) ) { @@ -9190,9 +9165,9 @@ if ( LockSurface_DDraw4(pBackBuffer4, &Dst, DDLOCK_WAIT) ) { - for (uint y = 0; y < height; ++y) - { - for (uint x = 0; x < width; ++x) + for (uint y = 0; y < (unsigned int)height; ++y) + { + for (uint x = 0; x < (unsigned int)width; ++x) { //*v3 = pRenderer->ReadPixel16((int)(x* interval_x + 8.0), (int)(y * interval_y + 8.0));//screen_data[screen_y + (int)(x* interval_x + 8.0)]; /* @@ -9547,7 +9522,7 @@ else color_mult = pDecal->field_C18->_43B570_get_color_mult_by_time(); - for (uint i = 0; i < pDecal->uNumVertices; ++i) + for (uint i = 0; i < (unsigned int)pDecal->uNumVertices; ++i) { uint uTint = Render::GetActorTintColor(pDecal->pVertices[i].vWorldViewPosition.x, pDecal->field_C14, 0, 0, nullptr);