mirror of
				https://github.com/TES3MP/openmw-tes3mp.git
				synced 2025-11-04 12:26:42 +00:00 
			
		
		
		
	Merge remote-tracking branch 'scrawl/map'
This commit is contained in:
		
						commit
						7076ea9467
					
				
					 1 changed files with 4 additions and 7 deletions
				
			
		| 
						 | 
					@ -370,8 +370,8 @@ void LocalMap::updatePlayer (const Ogre::Vector3& position, const Ogre::Quaterni
 | 
				
			||||||
    MWBase::Environment::get().getWindowManager()->setPlayerDir(playerdirection.x, playerdirection.y);
 | 
					    MWBase::Environment::get().getWindowManager()->setPlayerDir(playerdirection.x, playerdirection.y);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    // explore radius (squared)
 | 
					    // explore radius (squared)
 | 
				
			||||||
    const float sqrExploreRadius = (mInterior ? 0.01 : 0.09) * sFogOfWarResolution*sFogOfWarResolution;
 | 
					    const float exploreRadius = (mInterior ? 0.1 : 0.3) * (sFogOfWarResolution-1); // explore radius from 0 to sFogOfWarResolution-1
 | 
				
			||||||
    const float exploreRadius = (mInterior ? 0.1 : 0.3) * sFogOfWarResolution; // explore radius from 0 to sFogOfWarResolution
 | 
					    const float sqrExploreRadius = Math::Sqr(exploreRadius);
 | 
				
			||||||
    const float exploreRadiusUV = exploreRadius / sFogOfWarResolution; // explore radius from 0 to 1 (UV space)
 | 
					    const float exploreRadiusUV = exploreRadius / sFogOfWarResolution; // explore radius from 0 to 1 (UV space)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    // change the affected fog of war textures (in a 3x3 grid around the player)
 | 
					    // change the affected fog of war textures (in a 3x3 grid around the player)
 | 
				
			||||||
| 
						 | 
					@ -406,11 +406,8 @@ void LocalMap::updatePlayer (const Ogre::Vector3& position, const Ogre::Quaterni
 | 
				
			||||||
                {
 | 
					                {
 | 
				
			||||||
                    for (int texU = 0; texU<sFogOfWarResolution; ++texU)
 | 
					                    for (int texU = 0; texU<sFogOfWarResolution; ++texU)
 | 
				
			||||||
                    {
 | 
					                    {
 | 
				
			||||||
                        // fix into range of 0 ... sFogOfWarResolution
 | 
					                        float sqrDist = Math::Sqr((texU + mx*(sFogOfWarResolution-1)) - u*(sFogOfWarResolution-1))
 | 
				
			||||||
                        int _texU = texU * (float(sFogOfWarResolution+1) / float(sFogOfWarResolution));
 | 
					                                + Math::Sqr((texV + my*(sFogOfWarResolution-1)) - v*(sFogOfWarResolution-1));
 | 
				
			||||||
                        int _texV = texV * (float(sFogOfWarResolution+1) / float(sFogOfWarResolution));
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                        float sqrDist = Math::Sqr((_texU + mx*sFogOfWarResolution) - u*sFogOfWarResolution) + Math::Sqr((_texV + my*sFogOfWarResolution) - v*sFogOfWarResolution);
 | 
					 | 
				
			||||||
                        uint32 clr = mBuffers[texName][i];
 | 
					                        uint32 clr = mBuffers[texName][i];
 | 
				
			||||||
                        uint8 alpha = (clr >> 24);
 | 
					                        uint8 alpha = (clr >> 24);
 | 
				
			||||||
                        alpha = std::min( alpha, (uint8) (std::max(0.f, std::min(1.f, (sqrDist/sqrExploreRadius)))*255) );
 | 
					                        alpha = std::min( alpha, (uint8) (std::max(0.f, std::min(1.f, (sqrDist/sqrExploreRadius)))*255) );
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in a new issue