mirror of
				https://github.com/ciphervance/supercell-wx.git
				synced 2025-10-31 04:40:06 +00:00 
			
		
		
		
	Don't require FinishLines when adding new lines
This commit is contained in:
		
							parent
							
								
									4410b854c4
								
							
						
					
					
						commit
						37a1316e44
					
				
					 2 changed files with 8 additions and 4 deletions
				
			
		|  | @ -249,7 +249,7 @@ void GeoLines::Render(const QMapLibre::CustomLayerRenderParameters& params) | ||||||
| 
 | 
 | ||||||
|    std::unique_lock lock {p->lineMutex_}; |    std::unique_lock lock {p->lineMutex_}; | ||||||
| 
 | 
 | ||||||
|    if (p->currentLineList_.size() > 0) |    if (p->newLineList_.size() > 0) | ||||||
|    { |    { | ||||||
|       gl::OpenGLFunctions& gl = p->context_->gl(); |       gl::OpenGLFunctions& gl = p->context_->gl(); | ||||||
| 
 | 
 | ||||||
|  | @ -430,7 +430,7 @@ void GeoLines::FinishLines() | ||||||
|    std::unique_lock lock {p->lineMutex_}; |    std::unique_lock lock {p->lineMutex_}; | ||||||
| 
 | 
 | ||||||
|    // Swap buffers
 |    // Swap buffers
 | ||||||
|    p->currentLineList_.swap(p->newLineList_); |    p->currentLineList_ = p->newLineList_; | ||||||
|    p->currentLinesBuffer_.swap(p->newLinesBuffer_); |    p->currentLinesBuffer_.swap(p->newLinesBuffer_); | ||||||
|    p->currentIntegerBuffer_.swap(p->newIntegerBuffer_); |    p->currentIntegerBuffer_.swap(p->newIntegerBuffer_); | ||||||
|    p->currentHoverLines_.swap(p->newHoverLines_); |    p->currentHoverLines_.swap(p->newHoverLines_); | ||||||
|  | @ -469,6 +469,12 @@ void GeoLines::Impl::UpdateBuffers() | ||||||
| 
 | 
 | ||||||
| void GeoLines::Impl::UpdateModifiedLineBuffers() | void GeoLines::Impl::UpdateModifiedLineBuffers() | ||||||
| { | { | ||||||
|  |    // Synchronize line list
 | ||||||
|  |    currentLineList_ = newLineList_; | ||||||
|  |    currentLinesBuffer_.resize(currentLineList_.size() * kLineBufferLength_); | ||||||
|  |    currentIntegerBuffer_.resize(currentLineList_.size() * | ||||||
|  |                                 kVerticesPerRectangle * kIntegersPerVertex_); | ||||||
|  | 
 | ||||||
|    // Update buffers for modified lines
 |    // Update buffers for modified lines
 | ||||||
|    for (auto& di : dirtyLines_) |    for (auto& di : dirtyLines_) | ||||||
|    { |    { | ||||||
|  |  | ||||||
|  | @ -345,8 +345,6 @@ void AlertLayer::Impl::AddAlert( | ||||||
| 
 | 
 | ||||||
|    AddLines(lines, coordinates, kBlack_, 5.0f, startTime, endTime, drawItems); |    AddLines(lines, coordinates, kBlack_, 5.0f, startTime, endTime, drawItems); | ||||||
|    AddLines(lines, coordinates, lineColor, 3.0f, startTime, endTime, drawItems); |    AddLines(lines, coordinates, lineColor, 3.0f, startTime, endTime, drawItems); | ||||||
| 
 |  | ||||||
|    lines->FinishLines(); |  | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| void AlertLayer::Impl::UpdateAlert( | void AlertLayer::Impl::UpdateAlert( | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Dan Paulat
						Dan Paulat