Mercurial > mm7
comparison Render.cpp @ 2193:4842f58715ea
sub_47C3D7_get_fog_related_stuff to sub_47C3D7_get_fog_specular cleanup, IsTerrainSlopeTooHigh restoring commented out min,min/max,max implementation, some small changes in OnMapLoad, sub_4465DF_check_season attempted to pick the best readabilty/maintainability tradeoff
author | Grumpy7 |
---|---|
date | Thu, 30 Jan 2014 22:09:10 +0100 |
parents | e1e4a8a20b5f |
children | d0e321190c86 |
comparison
equal
deleted
inserted
replaced
2188:0ae56373cc35 | 2193:4842f58715ea |
---|---|
1915 d3d_vertex_buffer[i].diffuse = ::GetActorTintColor(a3->dimming_level, 0, array_50AC10[i].vWorldViewPosition.x, 0, 0); | 1915 d3d_vertex_buffer[i].diffuse = ::GetActorTintColor(a3->dimming_level, 0, array_50AC10[i].vWorldViewPosition.x, 0, 0); |
1916 pGame->AlterGamma_ODM(a4, &d3d_vertex_buffer[i].diffuse); | 1916 pGame->AlterGamma_ODM(a4, &d3d_vertex_buffer[i].diffuse); |
1917 | 1917 |
1918 if ( this->bUsingSpecular ) | 1918 if ( this->bUsingSpecular ) |
1919 { | 1919 { |
1920 d3d_vertex_buffer[i].specular = sub_47C3D7_get_fog_related_stuff(0, 0, array_50AC10[i].vWorldViewPosition.x); | 1920 d3d_vertex_buffer[i].specular = sub_47C3D7_get_fog_specular(0, 0, array_50AC10[i].vWorldViewPosition.x); |
1921 } | 1921 } |
1922 else | 1922 else |
1923 { | 1923 { |
1924 d3d_vertex_buffer[i].specular = 0; | 1924 d3d_vertex_buffer[i].specular = 0; |
1925 } | 1925 } |
1956 d3d_vertex_buffer[i].pos.z = 1.0 - 1.0 / ((array_50AC10[i].vWorldViewPosition.x * 1000) / (double)pODMRenderParams->shading_dist_mist); | 1956 d3d_vertex_buffer[i].pos.z = 1.0 - 1.0 / ((array_50AC10[i].vWorldViewPosition.x * 1000) / (double)pODMRenderParams->shading_dist_mist); |
1957 d3d_vertex_buffer[i].rhw = 1.0 / (array_50AC10[i].vWorldViewPosition.x + 0.0000001); | 1957 d3d_vertex_buffer[i].rhw = 1.0 / (array_50AC10[i].vWorldViewPosition.x + 0.0000001); |
1958 d3d_vertex_buffer[i].diffuse = GetActorTintColor(a3->dimming_level, 0, array_50AC10[i].vWorldViewPosition.x, 0, 0); | 1958 d3d_vertex_buffer[i].diffuse = GetActorTintColor(a3->dimming_level, 0, array_50AC10[i].vWorldViewPosition.x, 0, 0); |
1959 if ( this->bUsingSpecular ) | 1959 if ( this->bUsingSpecular ) |
1960 { | 1960 { |
1961 d3d_vertex_buffer[i].specular = sub_47C3D7_get_fog_related_stuff(0, 0, array_50AC10[i].vWorldViewPosition.x); | 1961 d3d_vertex_buffer[i].specular = sub_47C3D7_get_fog_specular(0, 0, array_50AC10[i].vWorldViewPosition.x); |
1962 } | 1962 } |
1963 else | 1963 else |
1964 { | 1964 { |
1965 d3d_vertex_buffer[i].specular = 0; | 1965 d3d_vertex_buffer[i].specular = 0; |
1966 } | 1966 } |
4689 d3d_vertex_buffer[i].pos.z = 1.0 - 1.0 / ((array_50AC10[i].vWorldViewPosition.x * 1000) / (double)pODMRenderParams->shading_dist_mist); | 4689 d3d_vertex_buffer[i].pos.z = 1.0 - 1.0 / ((array_50AC10[i].vWorldViewPosition.x * 1000) / (double)pODMRenderParams->shading_dist_mist); |
4690 d3d_vertex_buffer[i].rhw = 1.0 / (array_50AC10[i].vWorldViewPosition.x + 0.0000001); | 4690 d3d_vertex_buffer[i].rhw = 1.0 / (array_50AC10[i].vWorldViewPosition.x + 0.0000001); |
4691 d3d_vertex_buffer[i].diffuse = ::GetActorTintColor(a4->dimming_level, 0, array_50AC10[i].vWorldViewPosition.x, 0, 0); | 4691 d3d_vertex_buffer[i].diffuse = ::GetActorTintColor(a4->dimming_level, 0, array_50AC10[i].vWorldViewPosition.x, 0, 0); |
4692 if ( this->bUsingSpecular ) | 4692 if ( this->bUsingSpecular ) |
4693 { | 4693 { |
4694 d3d_vertex_buffer[i].specular = sub_47C3D7_get_fog_related_stuff(0, 0, array_50AC10[i].vWorldViewPosition.x); | 4694 d3d_vertex_buffer[i].specular = sub_47C3D7_get_fog_specular(0, 0, array_50AC10[i].vWorldViewPosition.x); |
4695 } | 4695 } |
4696 else | 4696 else |
4697 { | 4697 { |
4698 d3d_vertex_buffer[i].specular = 0; | 4698 d3d_vertex_buffer[i].specular = 0; |
4699 } | 4699 } |
4720 d3d_vertex_buffer[i].pos.z = 1.0 - 1.0 / ((array_50AC10[i].vWorldViewPosition.x * 1000) / (double)pODMRenderParams->shading_dist_mist); | 4720 d3d_vertex_buffer[i].pos.z = 1.0 - 1.0 / ((array_50AC10[i].vWorldViewPosition.x * 1000) / (double)pODMRenderParams->shading_dist_mist); |
4721 d3d_vertex_buffer[i].rhw = 1.0 / (array_50AC10[i].vWorldViewPosition.x + 0.0000001); | 4721 d3d_vertex_buffer[i].rhw = 1.0 / (array_50AC10[i].vWorldViewPosition.x + 0.0000001); |
4722 d3d_vertex_buffer[i].diffuse = GetActorTintColor(a4->dimming_level, 0, array_50AC10[i].vWorldViewPosition.x, 0, 0); | 4722 d3d_vertex_buffer[i].diffuse = GetActorTintColor(a4->dimming_level, 0, array_50AC10[i].vWorldViewPosition.x, 0, 0); |
4723 if ( this->bUsingSpecular ) | 4723 if ( this->bUsingSpecular ) |
4724 { | 4724 { |
4725 d3d_vertex_buffer[i].specular = sub_47C3D7_get_fog_related_stuff(0, 0, array_50AC10[i].vWorldViewPosition.x); | 4725 d3d_vertex_buffer[i].specular = sub_47C3D7_get_fog_specular(0, 0, array_50AC10[i].vWorldViewPosition.x); |
4726 } | 4726 } |
4727 else | 4727 else |
4728 { | 4728 { |
4729 d3d_vertex_buffer[i].specular = 0; | 4729 d3d_vertex_buffer[i].specular = 0; |
4730 } | 4730 } |
4828 pVertices[i].rhw = array_50AC10[i]._rhw; | 4828 pVertices[i].rhw = array_50AC10[i]._rhw; |
4829 | 4829 |
4830 pVertices[i].diffuse = ::GetActorTintColor(31, 0, array_50AC10[i].vWorldViewPosition.x, 1, 0); | 4830 pVertices[i].diffuse = ::GetActorTintColor(31, 0, array_50AC10[i].vWorldViewPosition.x, 1, 0); |
4831 v7 = 0; | 4831 v7 = 0; |
4832 if (this->bUsingSpecular) | 4832 if (this->bUsingSpecular) |
4833 v7 = sub_47C3D7_get_fog_related_stuff(0, 1, array_50AC10[i].vWorldViewPosition.x); | 4833 v7 = sub_47C3D7_get_fog_specular(0, 1, array_50AC10[i].vWorldViewPosition.x); |
4834 pVertices[i].specular = v7; | 4834 pVertices[i].specular = v7; |
4835 pVertices[i].texcoord.x = array_50AC10[i].u; | 4835 pVertices[i].texcoord.x = array_50AC10[i].u; |
4836 pVertices[i].texcoord.y = array_50AC10[i].v; | 4836 pVertices[i].texcoord.y = array_50AC10[i].v; |
4837 } | 4837 } |
4838 pRenderer->pRenderD3D->pDevice->SetTexture(0, pTexture); | 4838 pRenderer->pRenderD3D->pDevice->SetTexture(0, pTexture); |
5936 diffuse = 0x007F7F7F & ((unsigned int)diffuse >> 1); | 5936 diffuse = 0x007F7F7F & ((unsigned int)diffuse >> 1); |
5937 } | 5937 } |
5938 | 5938 |
5939 unsigned int specular = 0; | 5939 unsigned int specular = 0; |
5940 if (bUsingSpecular) | 5940 if (bUsingSpecular) |
5941 specular = sub_47C3D7_get_fog_related_stuff(0, 0, a2->zbuffer_depth); | 5941 specular = sub_47C3D7_get_fog_specular(0, 0, a2->zbuffer_depth); |
5942 | 5942 |
5943 v14 = (double)((int)pSprite->uBufferWidth / 2 - pSprite->uAreaX); | 5943 v14 = (double)((int)pSprite->uBufferWidth / 2 - pSprite->uAreaX); |
5944 v15 = (double)((int)pSprite->uBufferHeight - pSprite->uAreaY); | 5944 v15 = (double)((int)pSprite->uBufferHeight - pSprite->uAreaY); |
5945 if (a2->uFlags & 4) | 5945 if (a2->uFlags & 4) |
5946 v14 *= -1.0; | 5946 v14 *= -1.0; |