From 1474172b4a30d4764c2f35c1cb3e578b89d3136c Mon Sep 17 00:00:00 2001 From: Ray San Date: Thu, 19 Oct 2017 13:25:51 +0200 Subject: Updated for raylib 1.8 --- src/resources | Bin 107260 -> 106876 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/src/resources b/src/resources index 92ccf3a6..2273ca71 100644 Binary files a/src/resources and b/src/resources differ -- cgit v1.2.3 From 86df9168e78ab048f5aba989b2e704e87adea736 Mon Sep 17 00:00:00 2001 From: Ray San Date: Thu, 19 Oct 2017 14:14:18 +0200 Subject: Updated raylib VS2015 project --- project/vs2015/raylib/raylib.vcxproj | 2 +- release/libs/win32/msvc/raylib.lib | Bin 2336290 -> 2589838 bytes src/models.c | 19 ++++++++++++------- 3 files changed, 13 insertions(+), 8 deletions(-) diff --git a/project/vs2015/raylib/raylib.vcxproj b/project/vs2015/raylib/raylib.vcxproj index 6ab4a6c1..37e8b183 100644 --- a/project/vs2015/raylib/raylib.vcxproj +++ b/project/vs2015/raylib/raylib.vcxproj @@ -75,7 +75,7 @@ true true WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions);GRAPHICS_API_OPENGL_33;PLATFORM_DESKTOP - $(SolutionDir)..\..\src\external\openal_soft\include;$(SolutionDir)..\..\src\external\glfw3\include;$(SolutionDir)..\..\src\external;%(AdditionalIncludeDirectories) + $(SolutionDir)..\..\release\include;$(SolutionDir)..\..\src\external;%(AdditionalIncludeDirectories) CompileAsC diff --git a/release/libs/win32/msvc/raylib.lib b/release/libs/win32/msvc/raylib.lib index 0af993c9..6983d9a8 100644 Binary files a/release/libs/win32/msvc/raylib.lib and b/release/libs/win32/msvc/raylib.lib differ diff --git a/src/models.c b/src/models.c index ea8f6c30..4b8a6731 100644 --- a/src/models.c +++ b/src/models.c @@ -666,7 +666,7 @@ Mesh GenMeshPlane(float width, float length, int resX, int resZ) // Vertices definition int vertexCount = resX*resZ*6; // 6 vertex by quad - Vector3 vertices[vertexCount]; + Vector3 *vertices = (Vector3 *)malloc(vertexCount*sizeof(Vector3)); for (int z = 0; z < resZ; z++) { // [-length/2, length/2] @@ -680,11 +680,11 @@ Mesh GenMeshPlane(float width, float length, int resX, int resZ) } // Normals definition - Vector3 normals[vertexCount]; + Vector3 *normals = (Vector3 *)malloc(vertexCount*sizeof(Vector3)); for (int n = 0; n < vertexCount; n++) normals[n] = (Vector3){ 0.0f, 1.0f, 0.0f }; // Vector3.up; // TexCoords definition - Vector2 texcoords[vertexCount]; + Vector2 *texcoords = (Vector2 *)malloc(vertexCount*sizeof(Vector2)); for (int v = 0; v < resZ; v++) { for (int u = 0; u < resX; u++) @@ -694,10 +694,10 @@ Mesh GenMeshPlane(float width, float length, int resX, int resZ) } // Triangles definition (indices) - int nbFaces = (resX - 1)*(resZ - 1); - int triangles[nbFaces*6]; + int numFaces = (resX - 1)*(resZ - 1); + int *triangles = (int *)malloc(numFaces*6*sizeof(int)); int t = 0; - for (int face = 0; face < nbFaces; face++) + for (int face = 0; face < numFaces; face++) { // Retrieve lower left corner from face ind int i = face % (resX - 1) + (face/(resZ - 1)*resX); @@ -712,7 +712,7 @@ Mesh GenMeshPlane(float width, float length, int resX, int resZ) } mesh.vertexCount = vertexCount; - mesh.triangleCount = nbFaces*2; + mesh.triangleCount = numFaces*2; mesh.vertices = (float *)malloc(mesh.vertexCount*3*sizeof(float)); mesh.texcoords = (float *)malloc(mesh.vertexCount*2*sizeof(float)); mesh.normals = (float *)malloc(mesh.vertexCount*3*sizeof(float)); @@ -744,6 +744,11 @@ Mesh GenMeshPlane(float width, float length, int resX, int resZ) // Mesh indices array initialization for (int i = 0; i < mesh.triangleCount*3; i++) mesh.indices[i] = triangles[i]; + free(vertices); + free(normals); + free(texcoords); + free(triangles); + #else // Use par_shapes library to generate plane mesh par_shapes_mesh *plane = par_shapes_create_plane(resX, resZ); // No normals/texcoords generated!!! -- cgit v1.2.3 From e3dcccb9365e57b6ad4465df1f7c34cc1041acd8 Mon Sep 17 00:00:00 2001 From: Ray San Date: Thu, 19 Oct 2017 14:19:04 +0200 Subject: Updated raylib release 1.8 --- release/libs/win32/mingw32/libraylib.a | Bin 700684 -> 700748 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/release/libs/win32/mingw32/libraylib.a b/release/libs/win32/mingw32/libraylib.a index 682f806b..a89aa94d 100644 Binary files a/release/libs/win32/mingw32/libraylib.a and b/release/libs/win32/mingw32/libraylib.a differ -- cgit v1.2.3 From 037fbc571ab943d0b8efd69d674bc7408875e8be Mon Sep 17 00:00:00 2001 From: Ray San Date: Thu, 19 Oct 2017 14:37:00 +0200 Subject: Remove unused file --- examples/models/resources/pixels.png | Bin 168 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 examples/models/resources/pixels.png diff --git a/examples/models/resources/pixels.png b/examples/models/resources/pixels.png deleted file mode 100644 index c9a4134b..00000000 Binary files a/examples/models/resources/pixels.png and /dev/null differ -- cgit v1.2.3 From 1375a616b25c3ffad1cc73581b8acbdc30ef79b4 Mon Sep 17 00:00:00 2001 From: Ray Date: Fri, 20 Oct 2017 00:18:21 +0200 Subject: Some examples code tweaks --- examples/Makefile | 5 ----- examples/core/core_basic_window.c | 2 +- examples/models/models_cubicmap.c | 2 +- examples/models/models_heightmap.c | 2 +- examples/shaders/shaders_postprocessing.c | 2 +- 5 files changed, 4 insertions(+), 9 deletions(-) diff --git a/examples/Makefile b/examples/Makefile index bd4552cb..0dc04452 100644 --- a/examples/Makefile +++ b/examples/Makefile @@ -557,11 +557,6 @@ physac/physics_restitution: physac/physics_restitution.c # compile [physac] example - physics shatter physac/physics_shatter: physac/physics_shatter.c $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) $(PHYSAC_LIBS) -D$(PLATFORM) - -ifeq ($(PLATFORM),PLATFORM_ANDROID) -external/native_app_glue.o : native_app_glue.c native_app_glue.h - $(CC) -c $< $(CFLAGS) $(INCLUDE_PATHS) -D$(PLATFORM) -D$(SHAREDFLAG) -endif # fix dylib install path name for each executable (MAC) fix_dylib: diff --git a/examples/core/core_basic_window.c b/examples/core/core_basic_window.c index fb83400a..b30f05de 100644 --- a/examples/core/core_basic_window.c +++ b/examples/core/core_basic_window.c @@ -15,7 +15,7 @@ * This example has been created using raylib 1.0 (www.raylib.com) * raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details) * -* Copyright (c) 2014 Ramon Santamaria (@raysan5) +* Copyright (c) 2013-2016 Ramon Santamaria (@raysan5) * ********************************************************************************************/ diff --git a/examples/models/models_cubicmap.c b/examples/models/models_cubicmap.c index a8faa7c0..d8be9329 100644 --- a/examples/models/models_cubicmap.c +++ b/examples/models/models_cubicmap.c @@ -2,7 +2,7 @@ * * raylib [models] example - Cubicmap loading and drawing * -* This example has been created using raylib 1.3 (www.raylib.com) +* This example has been created using raylib 1.8 (www.raylib.com) * raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details) * * Copyright (c) 2015 Ramon Santamaria (@raysan5) diff --git a/examples/models/models_heightmap.c b/examples/models/models_heightmap.c index e887cea7..e476d1b7 100644 --- a/examples/models/models_heightmap.c +++ b/examples/models/models_heightmap.c @@ -2,7 +2,7 @@ * * raylib [models] example - Heightmap loading and drawing * -* This example has been created using raylib 1.3 (www.raylib.com) +* This example has been created using raylib 1.8 (www.raylib.com) * raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details) * * Copyright (c) 2015 Ramon Santamaria (@raysan5) diff --git a/examples/shaders/shaders_postprocessing.c b/examples/shaders/shaders_postprocessing.c index ae77a723..4aac5f91 100644 --- a/examples/shaders/shaders_postprocessing.c +++ b/examples/shaders/shaders_postprocessing.c @@ -76,7 +76,7 @@ int main() Model dwarf = LoadModel("resources/model/dwarf.obj"); // Load OBJ model Texture2D texture = LoadTexture("resources/model/dwarf_diffuse.png"); // Load model texture (diffuse map) - dwarf.material.maps[MAP_DIFFUSE].texture = texture; // Set dwarf model diffuse texture + dwarf.material.maps[MAP_DIFFUSE].texture = texture; // Set dwarf model diffuse texture Vector3 position = { 0.0f, 0.0f, 0.0f }; // Set model position -- cgit v1.2.3 From 1ef818b0325dafd2d7028a663b9b90d6d6529c44 Mon Sep 17 00:00:00 2001 From: Ray Date: Fri, 20 Oct 2017 13:59:08 +0200 Subject: Update example --- examples/core/core_vr_simulator.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/examples/core/core_vr_simulator.c b/examples/core/core_vr_simulator.c index 69e0f849..d919c410 100644 --- a/examples/core/core_vr_simulator.c +++ b/examples/core/core_vr_simulator.c @@ -22,7 +22,8 @@ int main() InitWindow(screenWidth, screenHeight, "raylib [core] example - vr simulator"); - InitVrSimulator(HMD_OCULUS_RIFT_CV1); // Init VR simulator (Oculus Rift CV1 parameters) + // Init VR simulator (Oculus Rift CV1 parameters) + InitVrSimulator(GetVrDeviceInfo(HMD_OCULUS_RIFT_CV1)); // Define the camera to look into our 3d world Camera camera; -- cgit v1.2.3