mirror of
				https://github.com/OpenMW/openmw.git
				synced 2025-10-31 22:56:40 +00:00 
			
		
		
		
	Avoid left shift of negative value
This commit is contained in:
		
							parent
							
								
									6a3ff5ed81
								
							
						
					
					
						commit
						df459199dd
					
				
					 1 changed files with 3 additions and 3 deletions
				
			
		|  | @ -125,7 +125,7 @@ namespace MWRender | |||
|                     { | ||||
|                         for (int cellX=0; cellX<mCellSize; ++cellX) | ||||
|                         { | ||||
|                             int vertexX = static_cast<int>(float(cellX)/float(mCellSize) * 9); | ||||
|                             int vertexX = static_cast<int>(float(cellX) / float(mCellSize) * 9); | ||||
|                             int vertexY = static_cast<int>(float(cellY) / float(mCellSize) * 9); | ||||
| 
 | ||||
|                             int texelX = (x-mMinX) * mCellSize + cellX; | ||||
|  | @ -135,9 +135,9 @@ namespace MWRender | |||
| 
 | ||||
|                             float y2 = 0; | ||||
|                             if (land && (land->mDataTypes & ESM::Land::DATA_WNAM)) | ||||
|                                 y2 = (land->mWnam[vertexY * 9 + vertexX] << 4) / 2048.f; | ||||
|                                 y2 = land->mWnam[vertexY * 9 + vertexX] / 128.f; | ||||
|                             else | ||||
|                                 y2 = (SCHAR_MIN << 4) / 2048.f; | ||||
|                                 y2 = SCHAR_MIN / 128.f; | ||||
|                             if (y2 < 0) | ||||
|                             { | ||||
|                                 r = static_cast<unsigned char>(14 * y2 + 38); | ||||
|  |  | |||
		Loading…
	
		Reference in a new issue