Browse Source

Merge pull request #369 from raysan5/develop

Integrate Develop branch
pull/408/head
Ray 7 years ago
committed by GitHub
parent
commit
18601f7619
12 changed files with 19 additions and 18 deletions
  1. +0
    -5
      examples/Makefile
  2. +1
    -1
      examples/core/core_basic_window.c
  3. +2
    -1
      examples/core/core_vr_simulator.c
  4. +1
    -1
      examples/models/models_cubicmap.c
  5. +1
    -1
      examples/models/models_heightmap.c
  6. BIN
      examples/models/resources/pixels.png
  7. +1
    -1
      examples/shaders/shaders_postprocessing.c
  8. +1
    -1
      project/vs2015/raylib/raylib.vcxproj
  9. BIN
      release/libs/win32/mingw32/libraylib.a
  10. BIN
      release/libs/win32/msvc/raylib.lib
  11. +12
    -7
      src/models.c
  12. BIN
      src/resources

+ 0
- 5
examples/Makefile View File

@ -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:

+ 1
- 1
examples/core/core_basic_window.c View File

@ -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)
*
********************************************************************************************/

+ 2
- 1
examples/core/core_vr_simulator.c View File

@ -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;

+ 1
- 1
examples/models/models_cubicmap.c View File

@ -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)

+ 1
- 1
examples/models/models_heightmap.c View File

@ -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)

BIN
examples/models/resources/pixels.png View File

Before After
Width: 2  |  Height: 2  |  Size: 168 B

+ 1
- 1
examples/shaders/shaders_postprocessing.c View File

@ -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

+ 1
- 1
project/vs2015/raylib/raylib.vcxproj View File

@ -75,7 +75,7 @@
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions);GRAPHICS_API_OPENGL_33;PLATFORM_DESKTOP</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(SolutionDir)..\..\src\external\openal_soft\include;$(SolutionDir)..\..\src\external\glfw3\include;$(SolutionDir)..\..\src\external;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>$(SolutionDir)..\..\release\include;$(SolutionDir)..\..\src\external;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<CompileAs>CompileAsC</CompileAs>
</ClCompile>
<Link>

BIN
release/libs/win32/mingw32/libraylib.a View File


BIN
release/libs/win32/msvc/raylib.lib View File


+ 12
- 7
src/models.c View File

@ -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 n">vertices[vertexCount];
Vector3 o">*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 n">normals[vertexCount];
Vector3 o">*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 n">texcoords[vertexCount];
Vector2 o">*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 n">triangles[nbFaces*6];
int numFaces = (resX - 1)*(resZ - 1);
int o">*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!!!

BIN
src/resources View File


Loading…
Cancel
Save