View | Details | Raw Unified | Return to bug 228730
Collapse All | Expand All

(-)graphics/mandelbulber/files/patch-src_Render3D.cpp (+27 lines)
Line 0 Link Here
1
--- src/Render3D.cpp.orig	2012-12-02 16:22:54 UTC
2
+++ src/Render3D.cpp
3
@@ -867,11 +867,11 @@ void *MainThread(void *ptr)
4
 						//---------- end of raytraced reflection
5
 
6
 						unsigned short shadow16 = shadowOutput.R * 4096.0;
7
-						sRGB16 globalLight = { AO.R * 4096.0, AO.G * 4096.0, AO.B * 4096.0 };
8
+						sRGB16 globalLight = { static_cast<unsigned short>(AO.R * 4096.0), static_cast<unsigned short>(AO.G * 4096.0), static_cast<unsigned short>(AO.B * 4096.0) };
9
 						unsigned short shade16 = shade.R * 4096.0;
10
-						sRGB16 shadeAux16 = { shadeAux.R * 4096.0, shadeAux.G * 4096.0, shadeAux.B * 4096.0 };
11
-						sRGB16 specularAux16 = { shadeAuxSpec.R * 4096.0, shadeAuxSpec.G * 4096.0, shadeAuxSpec.B * 4096.0 };
12
-						sRGB16 reflection = { envMapping.R * 256.0, envMapping.G * 256.0, envMapping.B * 256.0 };
13
+						sRGB16 shadeAux16 = { static_cast<unsigned short>(shadeAux.R * 4096.0), static_cast<unsigned short>(shadeAux.G * 4096.0), static_cast<unsigned short>(shadeAux.B * 4096.0) };
14
+						sRGB16 specularAux16 = { static_cast<unsigned short>(shadeAuxSpec.R * 4096.0), static_cast<unsigned short>(shadeAuxSpec.G * 4096.0), static_cast<unsigned short>(shadeAuxSpec.B * 4096.0) };
15
+						sRGB16 reflection = { static_cast<unsigned short>(envMapping.R * 256.0), static_cast<unsigned short>(envMapping.G * 256.0), static_cast<unsigned short>(envMapping.B * 256.0) };
16
 
17
 						if (!image->IsLowMemMode())
18
 						{
19
@@ -913,7 +913,7 @@ void *MainThread(void *ptr)
20
 						//------------- render 3D background
21
 						background = TexturedBackground(&param, viewVector);
22
 
23
-						sRGB16 background16 = { background.R * 65536.0, background.G * 65536.0, background.B * 65536.0 };
24
+						sRGB16 background16 = { static_cast<unsigned short>(background.R * 65536.0), static_cast<unsigned short>(background.G * 65536.0), static_cast<unsigned short>(background.B * 65536.0) };
25
 						pixelData.backgroundBuf16 = background16;
26
 
27
 						if (!image->IsLowMemMode())
(-)graphics/mandelbulber/files/patch-src_cimage.cpp (+20 lines)
Line 0 Link Here
1
--- src/cimage.cpp.orig	2012-12-02 16:22:54 UTC
2
+++ src/cimage.cpp
3
@@ -159,7 +159,7 @@ sRGB16 cImage::CalculatePixel(sComplexImage &pixel, un
4
 				+ adj.globalIlum * pixel.ambientBuf16.B / 4096.0 + pixel.auxLight.B / 4096.0) + jasSuma2 * mLightB + pixel.auxSpecular.B / 4096.0) * 65536.0;
5
 	}
6
 
7
-	sRGB col = { R, G, B };
8
+	sRGB col = { static_cast<unsigned short>(R), static_cast<unsigned short>(G), static_cast<unsigned short>(B) };
9
 	if (sw.fogEnabled)
10
 	{
11
 		col = PostRendering_Fog(zBuf, fogVisFront, fogVisBack + fogVisFront, ecol.fogColor, col);
12
@@ -250,7 +250,7 @@ sRGB16 cImage::CalculateAmbientPixel(sRGB16 ambient16,
13
 	if(newG > 65535) newG = 65535;
14
 	if(newB > 65535) newB = 65535;
15
 
16
-	sRGB16 newPixel = {newR, newG, newB};
17
+	sRGB16 newPixel = {static_cast<unsigned short>(newR), static_cast<unsigned short>(newG), static_cast<unsigned short>(newB)};
18
 	//sRGB16 newPixel = {color.R, color.G, color.B};
19
 	return newPixel;
20
 }
(-)graphics/mandelbulber/files/patch-src_image.cpp (+20 lines)
Line 0 Link Here
1
--- src/image.cpp.orig	2012-12-02 16:22:54 UTC
2
+++ src/image.cpp
3
@@ -373,7 +373,7 @@ void ThreadSSAO(void *ptr)
4
 
5
 			}
6
 
7
-			sRGB16 ambient = { total_ambient * 4096.0, total_ambient * 4096.0, total_ambient * 4096.0 };
8
+			sRGB16 ambient = { static_cast<unsigned short>(total_ambient * 4096.0), static_cast<unsigned short>(total_ambient * 4096.0), static_cast<unsigned short>(total_ambient * 4096.0) };
9
 			if (!image->IsLowMemMode()) image->PutPixelAmbient(x, y, ambient);
10
 			else
11
 			{
12
@@ -567,7 +567,7 @@ void DrawPalette(sRGB *palette)
13
 		{
14
 			int number = (int) (i * 256.0 / colWidth + paletteOffset * 256.0);
15
 			sRGB color = mainImage.IndexToColour(number);
16
-			GdkColor gdk_color = { 0, color.R * 256, color.G * 256, color.B * 256 };
17
+			GdkColor gdk_color = { 0, static_cast<unsigned short>(color.R * 256), static_cast<unsigned short>(color.G * 256), static_cast<unsigned short>(color.B * 256) };
18
 			gdk_gc_set_rgb_fg_color(GC, &gdk_color);
19
 			gdk_draw_line(dareaPalette->window, GC, i, 0, i, 30);
20
 		}
(-)graphics/mandelbulber/files/patch-src_interface.cpp (+11 lines)
Line 0 Link Here
1
--- src/interface.cpp.orig	2012-12-02 16:22:54 UTC
2
+++ src/interface.cpp
3
@@ -1931,7 +1931,7 @@ void CreateInterface(sParamRender *default_settings)
4
 
5
 	Interface.label_NavigatorEstimatedDistance = gtk_label_new("Estimated distance to the surface:");
6
 
7
-	Interface.label_about = gtk_label_new("Mandelbulber "MANDELBULBER_VERSION_STR"\n"
8
+	Interface.label_about = gtk_label_new("Mandelbulber " MANDELBULBER_VERSION_STR "\n"
9
 		"author: Krzysztof Marczak\n"
10
 		"Licence: GNU GPL v3\n"
11
 		"www: http://sites.google.com/site/mandelbulber/home\n"
(-)graphics/mandelbulber/files/patch-src_netrender.cpp (+11 lines)
Line 0 Link Here
1
--- src/netrender.cpp.orig	2012-12-02 16:22:54 UTC
2
+++ src/netrender.cpp
3
@@ -88,7 +88,7 @@ bool CNetRender::SetServer(char *portNo, char *statusO
4
               sizeof(timeout)) < 0)
5
   	std::cout << "socket options error " << strerror(errno);
6
 
7
-  status = bind(socketfd, host_info_list->ai_addr, host_info_list->ai_addrlen);
8
+  status = ::bind(socketfd, host_info_list->ai_addr, host_info_list->ai_addrlen);
9
   if (status == -1)
10
   {
11
   	std::cout << "bind error" << std::endl ;
(-)graphics/mandelbulber/files/patch-src_shaders.cpp (+11 lines)
Line 0 Link Here
1
--- src/shaders.cpp.orig	2012-12-02 16:22:54 UTC
2
+++ src/shaders.cpp
3
@@ -822,7 +822,7 @@ void PostRenderingLights(cImage *image, sParamRender *
4
 							if (newG > 65535) newG = 65535;
5
 							if (newB > 65535) newB = 65535;
6
 
7
-							sRGB16 pixel = { newR, newG, newB };
8
+							sRGB16 pixel = { static_cast<unsigned short>(newR), static_cast<unsigned short>(newG), static_cast<unsigned short>(newB) };
9
 							int alpha = oldAlpha + bright * 65536;
10
 							if (alpha > 65535) alpha = 65535;
11
 

Return to bug 228730