Mercurial > might-and-magic-trilogy
comparison Game.cpp @ 68:fdacbc653945
BLV render: first image
author | Nomad |
---|---|
date | Sat, 27 Oct 2012 19:23:06 +0200 |
parents | 5159d2e6f559 |
children | 8be5293b6b33 |
comparison
equal
deleted
inserted
replaced
63:427b6c3b4e0f | 68:fdacbc653945 |
---|---|
665 return result; | 665 return result; |
666 } | 666 } |
667 | 667 |
668 | 668 |
669 //----- (0044EDE4) -------------------------------------------------------- | 669 //----- (0044EDE4) -------------------------------------------------------- |
670 bool Game::_44EDE4(BLVFace *pFace, int *a3) | 670 bool Game::AlterGamma(BLVFace *pFace, unsigned int *pColor) |
671 { | 671 { |
672 bool result; // eax@1 | 672 if (pGame->uFlags2 & 2 && pFace->uAttributes & 2) |
673 | 673 { |
674 result = (bool)pGame; | 674 *pColor = ReplaceHSV(*pColor, 1.0, fSaturation, -1.0); |
675 if ( pGame->uFlags2 & 2 && (result = (bool)pFace, pFace->uAttributes & 2) ) | 675 return true; |
676 { | 676 } |
677 result = sub_48A959(*a3, 1.0, this->_E28_timed_gamma_strength, -1.0); | 677 else |
678 *a3 = result; | 678 return false; |
679 LOBYTE(result) = 1; | |
680 } | |
681 else | |
682 { | |
683 LOBYTE(result) = 0; | |
684 } | |
685 return result; | |
686 } | 679 } |
687 | 680 |
688 //----- (0044EE30) -------------------------------------------------------- | 681 //----- (0044EE30) -------------------------------------------------------- |
689 bool Game::_44EE30(ODMFace *a2, int a3) | 682 bool Game::_44EE30(ODMFace *a2, int a3) |
690 { | 683 { |
691 if (uFlags2 & 0x2 && a2->uAttributes & 0x02) | 684 if (uFlags2 & 0x2 && a2->uAttributes & 0x02) |
692 { | 685 { |
693 *(int *)a3 = sub_48A959(*(int *)a3, 1.0, _E28_timed_gamma_strength, -1.0); | 686 *(int *)a3 = ReplaceHSV(*(int *)a3, 1.0, fSaturation, -1.0); |
694 return true; | 687 return true; |
695 } | 688 } |
696 else | 689 else |
697 return false; | 690 return false; |
698 } | 691 } |
761 if ( this->uFlags2 & 2 && a2->field_59 == 5 && a2->pODMFace->uAttributes & 2 ) | 754 if ( this->uFlags2 & 2 && a2->field_59 == 5 && a2->pODMFace->uAttributes & 2 ) |
762 { | 755 { |
763 v4 = (double)a4; | 756 v4 = (double)a4; |
764 a2a = v4; | 757 a2a = v4; |
765 *a3 |= 2u; | 758 *a3 |= 2u; |
766 a3a = (1.0 - this->_E28_timed_gamma_strength) * v4; | 759 a3a = (1.0 - this->fSaturation) * v4; |
767 //v5 = a3a + 6.7553994e15; | 760 //v5 = a3a + 6.7553994e15; |
768 //if ( SLODWORD(v5) >= 0 ) | 761 //if ( SLODWORD(v5) >= 0 ) |
769 if (floorf(a3a + 0.5f) >= 0 ) | 762 if (floorf(a3a + 0.5f) >= 0 ) |
770 { | 763 { |
771 a3b = (1.0 - this->_E28_timed_gamma_strength) * a2a; | 764 a3b = (1.0 - this->fSaturation) * a2a; |
772 //v7 = a3b + 6.7553994e15; | 765 //v7 = a3b + 6.7553994e15; |
773 //v6 = LODWORD(v7); | 766 //v6 = LODWORD(v7); |
774 v6 = floorf(a3b + 0.5f); | 767 v6 = floorf(a3b + 0.5f); |
775 } | 768 } |
776 else | 769 else |
777 { | 770 { |
778 v6 = 0; | 771 v6 = 0; |
779 } | 772 } |
780 if ( a4 >= v6 ) | 773 if ( a4 >= v6 ) |
781 { | 774 { |
782 a4a = (1.0 - _E28_timed_gamma_strength) * a2a; | 775 a4a = (1.0 - fSaturation) * a2a; |
783 //v9 = a4a + 6.7553994e15; | 776 //v9 = a4a + 6.7553994e15; |
784 //if ( SLODWORD(v9) >= 0 ) | 777 //if ( SLODWORD(v9) >= 0 ) |
785 if (floorf(a4a + 0.5f) >= 0) | 778 if (floorf(a4a + 0.5f) >= 0) |
786 { | 779 { |
787 a4b = (1.0 - _E28_timed_gamma_strength) * a2a; | 780 a4b = (1.0 - fSaturation) * a2a; |
788 //v10 = a4b + 6.7553994e15; | 781 //v10 = a4b + 6.7553994e15; |
789 //result = LODWORD(v10); | 782 //result = LODWORD(v10); |
790 result = floorf(a4b + 0.5f); | 783 result = floorf(a4b + 0.5f); |
791 } | 784 } |
792 else | 785 else |
841 if ( this->uFlags2 & 2 && a2->uAttributes & 2 ) | 834 if ( this->uFlags2 & 2 && a2->uAttributes & 2 ) |
842 { | 835 { |
843 v4 = (double)a4; | 836 v4 = (double)a4; |
844 v11 = v4; | 837 v11 = v4; |
845 *a3 |= 2u; | 838 *a3 |= 2u; |
846 v12 = (1.0 - this->_E28_timed_gamma_strength) * v4; | 839 v12 = (1.0 - this->fSaturation) * v4; |
847 //v5 = v12 + 6.7553994e15; | 840 //v5 = v12 + 6.7553994e15; |
848 if (floorf(v12 + 0.5f)/* SLODWORD(v5)*/ >= 0 ) | 841 if (floorf(v12 + 0.5f)/* SLODWORD(v5)*/ >= 0 ) |
849 { | 842 { |
850 v13 = (1.0 - this->_E28_timed_gamma_strength) * v11; | 843 v13 = (1.0 - this->fSaturation) * v11; |
851 //v7 = v13 + 6.7553994e15; | 844 //v7 = v13 + 6.7553994e15; |
852 //v6 = LODWORD(v7); | 845 //v6 = LODWORD(v7); |
853 v6 = floorf(v13 + 0.5f); | 846 v6 = floorf(v13 + 0.5f); |
854 } | 847 } |
855 else | 848 else |
856 { | 849 { |
857 v6 = 0; | 850 v6 = 0; |
858 } | 851 } |
859 if ( a4 >= v6 ) | 852 if ( a4 >= v6 ) |
860 { | 853 { |
861 v14 = (1.0 - _E28_timed_gamma_strength) * v11; | 854 v14 = (1.0 - fSaturation) * v11; |
862 //v9 = v14 + 6.7553994e15; | 855 //v9 = v14 + 6.7553994e15; |
863 if (floorf(v14 + 0.5f)/* SLODWORD(v9)*/ >= 0 ) | 856 if (floorf(v14 + 0.5f)/* SLODWORD(v9)*/ >= 0 ) |
864 { | 857 { |
865 v15 = (1.0 - _E28_timed_gamma_strength) * v11; | 858 v15 = (1.0 - fSaturation) * v11; |
866 //v10 = v15 + 6.7553994e15; | 859 //v10 = v15 + 6.7553994e15; |
867 //result = LODWORD(v10); | 860 //result = LODWORD(v10); |
868 result = floorf(v15 + 0.5f); | 861 result = floorf(v15 + 0.5f); |
869 } | 862 } |
870 else | 863 else |
1016 else | 1009 else |
1017 { | 1010 { |
1018 v7 = 1.0; | 1011 v7 = 1.0; |
1019 } | 1012 } |
1020 if ( pRenderer->pRenderD3D ) | 1013 if ( pRenderer->pRenderD3D ) |
1021 _E28_timed_gamma_strength = v7; | 1014 fSaturation = v7; |
1022 else | 1015 else |
1023 _E28_timed_gamma_strength = (1.0 - 0.5) * v7 + 0.5; | 1016 fSaturation = (1.0 - 0.5) * v7 + 0.5; |
1024 } | 1017 } |
1025 | 1018 |
1026 //----- (0044EA17) -------------------------------------------------------- | 1019 //----- (0044EA17) -------------------------------------------------------- |
1027 bool Game::InitializeGammaController() | 1020 bool Game::InitializeGammaController() |
1028 { | 1021 { |