mirror of
				https://github.com/ciphervance/supercell-wx.git
				synced 2025-10-31 09:50:06 +00:00 
			
		
		
		
	Merge pull request #317 from AdenKoperczak/inverted_threshold
Change negative threshold values to act as inverted threshold
This commit is contained in:
		
						commit
						37af0714ae
					
				
					 2 changed files with 8 additions and 2 deletions
				
			
		|  | @ -21,7 +21,9 @@ smooth out vec4 color; | ||||||
| void main() | void main() | ||||||
| { | { | ||||||
|    if (gsIn[0].displayed != 0 && |    if (gsIn[0].displayed != 0 && | ||||||
|        (gsIn[0].threshold <= 0 ||            // If Threshold: 0 was specified, no threshold |        (gsIn[0].threshold == 0 ||            // If Threshold: 0 was specified, no threshold | ||||||
|  |         uMapDistance == 0 ||                 // If uMapDistance is zero, threshold is disabled | ||||||
|  |         (gsIn[0].threshold < 0 && -(gsIn[0].threshold) <= uMapDistance) || // If Threshold is negative and below current map distance | ||||||
|         gsIn[0].threshold >= uMapDistance || // If Threshold is above current map distance |         gsIn[0].threshold >= uMapDistance || // If Threshold is above current map distance | ||||||
|         gsIn[0].threshold >= 999) &&         // If Threshold: 999 was specified (or greater), no threshold |         gsIn[0].threshold >= 999) &&         // If Threshold: 999 was specified (or greater), no threshold | ||||||
|        (gsIn[0].timeRange[0] == 0 ||              // If there is no start time specified |        (gsIn[0].timeRange[0] == 0 ||              // If there is no start time specified | ||||||
|  |  | ||||||
|  | @ -136,7 +136,11 @@ void PlacefileText::Impl::RenderTextDrawItem( | ||||||
|          std::chrono::system_clock::now() : |          std::chrono::system_clock::now() : | ||||||
|          selectedTime_; |          selectedTime_; | ||||||
| 
 | 
 | ||||||
|    if ((!thresholded_ || mapDistance_ <= di->threshold_) && |    const bool thresholdMet = | ||||||
|  |       !thresholded_ || mapDistance_ <= di->threshold_ || | ||||||
|  |       (di->threshold_.value() < 0.0 && mapDistance_ >= -(di->threshold_)); | ||||||
|  | 
 | ||||||
|  |    if (thresholdMet && | ||||||
|        (di->startTime_ == std::chrono::system_clock::time_point {} || |        (di->startTime_ == std::chrono::system_clock::time_point {} || | ||||||
|         (di->startTime_ <= selectedTime && selectedTime < di->endTime_))) |         (di->startTime_ <= selectedTime && selectedTime < di->endTime_))) | ||||||
|    { |    { | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Dan Paulat
						Dan Paulat