mirror of
				https://github.com/zenorogue/hyperrogue.git
				synced 2025-10-31 05:52:59 +00:00 
			
		
		
		
	fixed possible crash when drawing empty textures
This commit is contained in:
		| @@ -460,7 +460,11 @@ void drawTexturedTriangle(SDL_Surface *s, int *px, int *py, glvertex *tv, color_ | |||||||
|       int tw = texture::config.data.twidth; |       int tw = texture::config.data.twidth; | ||||||
|       int x = int(ht[0] * tw) & (tw-1); |       int x = int(ht[0] * tw) & (tw-1); | ||||||
|       int y = int(ht[1] * tw) & (tw-1); |       int y = int(ht[1] * tw) & (tw-1); | ||||||
|       color_t c = texture::config.data.texture_pixels[y * tw + x]; |       color_t c; | ||||||
|  |       if(texture::config.data.texture_pixels.size() == 0) | ||||||
|  |         c = 0xFFFFFFFF; | ||||||
|  |       else | ||||||
|  |         c = texture::config.data.texture_pixels[y * tw + x]; | ||||||
|       auto& pix = qpixel(s, mx, my); |       auto& pix = qpixel(s, mx, my); | ||||||
|       for(int p=0; p<3; p++) { |       for(int p=0; p<3; p++) { | ||||||
|         int alpha = part(c, 3) * part(col, 0); |         int alpha = part(c, 3) * part(col, 0); | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Zeno Rogue
					Zeno Rogue