@@ -88,9 +88,9 @@ int main()
8888
8989 // Define the camera to look into our 3d world
9090 raylib::Camera camera;
91- camera.position = ( Vector3) { 2 .0f , 2 .0f , 6 .0f }; // Camera position
92- camera.target = ( Vector3) { 0 .0f , 0 .5f , 0 .0f }; // Camera looking at point
93- camera.up = ( Vector3) { 0 .0f , 1 .0f , 0 .0f }; // Camera up vector (rotation towards target)
91+ camera.position = Vector3{ 2 .0f , 2 .0f , 6 .0f }; // Camera position
92+ camera.target = Vector3{ 0 .0f , 0 .5f , 0 .0f }; // Camera looking at point
93+ camera.up = Vector3{ 0 .0f , 1 .0f , 0 .0f }; // Camera up vector (rotation towards target)
9494 camera.fovy = 45 .0f ; // Camera field-of-view Y
9595 camera.projection = CAMERA_PERSPECTIVE; // Camera projection type
9696
@@ -117,8 +117,8 @@ int main()
117117
118118 // Setup ambient color and intensity parameters
119119 float ambientIntensity = 0 .02f ;
120- raylib::Color ambientColor = ( Color) { 26 , 32 , 135 , 255 };
121- raylib::Vector3 ambientColorNormalized = ( Vector3) { ambientColor.r /255 .0f , ambientColor.g /255 .0f , ambientColor.b /255 .0f };
120+ raylib::Color ambientColor = Color{ 26 , 32 , 135 , 255 };
121+ raylib::Vector3 ambientColorNormalized = Vector3{ ambientColor.r /255 .0f , ambientColor.g /255 .0f , ambientColor.b /255 .0f };
122122 shader.SetValue (shader.GetLocation (" ambientColor" ), &ambientColorNormalized, SHADER_UNIFORM_VEC3);
123123 shader.SetValue (shader.GetLocation (" ambient" ), &ambientIntensity, SHADER_UNIFORM_FLOAT);
124124
@@ -142,7 +142,7 @@ int main()
142142 car.materials [0 ].maps [MATERIAL_MAP_METALNESS].value = 0 .0f ;
143143 car.materials [0 ].maps [MATERIAL_MAP_ROUGHNESS].value = 0 .0f ;
144144 car.materials [0 ].maps [MATERIAL_MAP_OCCLUSION].value = 1 .0f ;
145- car.materials [0 ].maps [MATERIAL_MAP_EMISSION].color = ( Color) { 255 , 162 , 0 , 255 };
145+ car.materials [0 ].maps [MATERIAL_MAP_EMISSION].color = Color{ 255 , 162 , 0 , 255 };
146146
147147 // Setup materials[0].maps default textures
148148 car.materials [0 ].maps [MATERIAL_MAP_ALBEDO].texture = LoadTexture (" resources/old_car_d.png" );
@@ -172,15 +172,15 @@ int main()
172172
173173 // Models texture tiling parameter can be stored in the Material struct if required (CURRENTLY NOT USED)
174174 // NOTE: Material.params[4] are available for generic parameters storage (float)
175- Vector2 carTextureTiling = ( Vector2) { 0 .5f , 0 .5f };
176- Vector2 floorTextureTiling = ( Vector2) { 0 .5f , 0 .5f };
175+ Vector2 carTextureTiling = Vector2{ 0 .5f , 0 .5f };
176+ Vector2 floorTextureTiling = Vector2{ 0 .5f , 0 .5f };
177177
178178 // Create some lights
179179 std::array<Light, MAX_LIGHTS> lights = {
180- CreateLight (0 , LightType::POINT, ( Vector3) {-1 .0f , 1 .0f , -2 .0f }, ( Vector3) {0 .0f , 0 .0f , 0 .0f }, YELLOW, 4 .0f , shader),
181- CreateLight (1 , LightType::POINT, ( Vector3) { 2 .0f , 1 .0f , 1 .0f }, ( Vector3) { 0 .0f , 0 .0f , 0 .0f }, GREEN, 3 .3f , shader),
182- CreateLight (2 , LightType::POINT, ( Vector3) { -2 .0f , 1 .0f , 1 .0f }, ( Vector3) { 0 .0f , 0 .0f , 0 .0f }, RED, 8 .3f , shader),
183- CreateLight (3 , LightType::POINT, ( Vector3) { 1 .0f , 1 .0f , -2 .0f }, ( Vector3) { 0 .0f , 0 .0f , 0 .0f }, BLUE, 2 .0f , shader),
180+ CreateLight (0 , LightType::POINT, Vector3{-1 .0f , 1 .0f , -2 .0f }, Vector3{0 .0f , 0 .0f , 0 .0f }, YELLOW, 4 .0f , shader),
181+ CreateLight (1 , LightType::POINT, Vector3{ 2 .0f , 1 .0f , 1 .0f }, Vector3{ 0 .0f , 0 .0f , 0 .0f }, GREEN, 3 .3f , shader),
182+ CreateLight (2 , LightType::POINT, Vector3{ -2 .0f , 1 .0f , 1 .0f }, Vector3{ 0 .0f , 0 .0f , 0 .0f }, RED, 8 .3f , shader),
183+ CreateLight (3 , LightType::POINT, Vector3{ 1 .0f , 1 .0f , -2 .0f }, Vector3{ 0 .0f , 0 .0f , 0 .0f }, BLUE, 2 .0f , shader),
184184 };
185185
186186 // Setup material texture maps usage in shader
@@ -228,7 +228,7 @@ int main()
228228 raylib::Vector4 floorEmissiveColor = ColorNormalize (floor.materials [0 ].maps [MATERIAL_MAP_EMISSION].color );
229229 SetShaderValue (shader, emissiveColorLoc, &floorEmissiveColor, SHADER_UNIFORM_VEC4);
230230
231- DrawModel (floor, ( Vector3) { 0 .0f , 0 .0f , 0 .0f }, 5 .0f , WHITE); // Draw floor model
231+ DrawModel (floor, Vector3{ 0 .0f , 0 .0f , 0 .0f }, 5 .0f , WHITE); // Draw floor model
232232
233233 // Set old car model texture tiling, emissive color and emissive intensity parameters on shader
234234 SetShaderValue (shader, textureTilingLoc, &carTextureTiling, SHADER_UNIFORM_VEC2);
@@ -237,15 +237,15 @@ int main()
237237 float emissiveIntensity = 0 .01f ;
238238 SetShaderValue (shader, emissiveIntensityLoc, &emissiveIntensity, SHADER_UNIFORM_FLOAT);
239239
240- car.Draw (( Vector3) { 0 .0f , 0 .0f , 0 .0f }, 0 .005f , WHITE); // Draw car model
240+ car.Draw (Vector3{ 0 .0f , 0 .0f , 0 .0f }, 0 .005f , WHITE); // Draw car model
241241
242242 // Draw spheres to show the lights positions
243243 for (const auto & light : lights)
244244 {
245- Color lightColor = ( Color) { static_cast <unsigned char >(light.color [0 ]*255 ),
246- static_cast <unsigned char >(light.color [1 ]*255 ),
247- static_cast <unsigned char >(light.color [2 ]*255 ),
248- static_cast <unsigned char >(light.color [3 ]*255 ) };
245+ Color lightColor = Color{ static_cast <unsigned char >(light.color [0 ]*255 ),
246+ static_cast <unsigned char >(light.color [1 ]*255 ),
247+ static_cast <unsigned char >(light.color [2 ]*255 ),
248+ static_cast <unsigned char >(light.color [3 ]*255 ) };
249249
250250 if (light.enabled ) DrawSphereEx (light.position , 0 .2f , 8 , 8 , lightColor);
251251 else DrawSphereWires (light.position , 0 .2f , 8 , 8 , ColorAlpha (lightColor, 0 .3f ));
@@ -267,12 +267,12 @@ int main()
267267 // --------------------------------------------------------------------------------------
268268 // Unbind (disconnect) shader from car.material[0]
269269 // to avoid UnloadMaterial() trying to unload it automatically
270- car.materials [0 ].shader = ( Shader) { 0 };
270+ car.materials [0 ].shader = Shader{ 0 };
271271 UnloadMaterial (car.materials [0 ]);
272272 car.materials [0 ].maps = NULL ;
273273 // UnloadModel(car);
274274
275- floor.materials [0 ].shader = ( Shader) { 0 };
275+ floor.materials [0 ].shader = Shader{ 0 };
276276 UnloadMaterial (floor.materials [0 ]);
277277 floor.materials [0 ].maps = NULL ;
278278 // UnloadModel(floor);
0 commit comments