Browse Source

Revert "Corrected some bugs..."

This reverts commit 29d8b48503.
pull/12/head
Palaui 10 years ago
parent
commit
a2c8ddca13
6 changed files with 13 additions and 44 deletions
  1. +1
    -10
      src/core.c
  2. +8
    -23
      src/makefile
  3. +1
    -1
      src/models.c
  4. +0
    -1
      src/raylib.h
  5. +2
    -2
      src/raymath.h
  6. +1
    -7
      src/rlgl.c

+ 1
- 10
src/core.c View File

@ -165,7 +165,7 @@ static const char *windowTitle; // Window text title...
static char configFlags = 0;
static bool customCursor = false; // Tracks if custom cursor has been set
static bool cursorOnScreen = false; // Tracks if cursor is inside client area
static bool cursorOnScreen = true; // Tracks if cursor is inside client area
static Texture2D cursor; // Cursor texture
static Vector2 mousePosition;
@ -727,15 +727,6 @@ Vector2 GetMousePosition(void)
return mousePosition;
}
// Set mouse position XY
void SetMousePosition(Vector2 position)
{
mousePosition = position;
#if defined(PLATFORM_DESKTOP)
glfwSetCursorPos(window, position.x, position.y);
#endif
}
// Returns mouse wheel movement Y
int GetMouseWheelMove(void)
{

+ 8
- 23
src/makefile View File

@ -24,7 +24,7 @@
#**************************************************************************************************
# define raylib platform (by default, compile for RPI)
# Other possible platforms: PLATFORM_DESKTOP_WIN PLATFORM_DESKTOP_LINUX PLATFORM_DESKTOP_MAC PLATFORM_WEB
# Other possible platforms: PLATFORM_DESKTOP PLATFORM_DESKTOP_LINUX
PLATFORM ?= PLATFORM_RPI
# define raylib graphics api depending on selected platform
@ -40,26 +40,16 @@ endif
# NOTE: makefiles targets require tab indentation
# define compiler: gcc for C program, define as g++ for C++
ifeq ($(PLATFORM),PLATFORM_WEB)
# define emscripten compiler
CC = emcc
else
# define default gcc compiler
CC = gcc
endif
CC = gcc
# define compiler flags:
# -O2 defines optimization level
# -Wall turns on most, but not all, compiler warnings
# -std=c99 use standard C from 1999 revision
ifeq ($(PLATFORM),PLATFORM_WEB)
CFLAGS = -O3 -s USE_GLFW=3 -s LEGACY_GL_EMULATION=1
else
ifeq ($(PLATFORM),PLATFORM_RPI)
CFLAGS = -O2 -Wall -std=gnu99 -fgnu89-inline
else
CFLAGS = -O2 -Wall -std=c99
endif
CFLAGS = -O2 -Wall -std=c99 -fgnu89-inline
endif
#CFLAGSEXTRA = -Wextra -Wmissing-prototypes -Wstrict-prototypes
@ -79,16 +69,11 @@ default: raylib
# compile raylib library
raylib: $(OBJS)
ifeq ($(PLATFORM),PLATFORM_WEB)
emcc $(OBJS) -o raylib.bc
else
ar rcs libraylib.a $(OBJS)
endif
# compile core module
# emcc core.c -o core.bc -DPLATFORM_DESKTOP
core.o: core.c
$(CC) -c core.c $(CFLAGS) $(INCLUDES) -D$(PLATFORM) -D$(GRAPHICS)
$(CC) -c core.c $(CFLAGS) $(INCLUDES) -D$(PLATFORM)
# compile rlgl module
rlgl.o: rlgl.c
@ -100,19 +85,19 @@ raymath.o: raymath.c
# compile shapes module
shapes.o: shapes.c
$(CC) -c shapes.c $(CFLAGS) $(INCLUDES) -D$(PLATFORM) -D$(GRAPHICS)
$(CC) -c shapes.c $(CFLAGS) $(INCLUDES) -D$(PLATFORM)
# compile textures module
textures.o: textures.c
$(CC) -c textures.c $(CFLAGS) $(INCLUDES) -D$(PLATFORM) -D$(GRAPHICS)
$(CC) -c textures.c $(CFLAGS) $(INCLUDES) -D$(PLATFORM)
# compile text module
text.o: text.c
$(CC) -c text.c $(CFLAGS) $(INCLUDES) -D$(PLATFORM) -D$(GRAPHICS)
$(CC) -c text.c $(CFLAGS) $(INCLUDES) -D$(PLATFORM)
# compile models module
models.o: models.c
$(CC) -c models.c $(CFLAGS) $(INCLUDES) -D$(PLATFORM) -D$(GRAPHICS)
$(CC) -c models.c $(CFLAGS) $(INCLUDES) -D$(PLATFORM)
# compile audio module
audio.o: audio.c

+ 1
- 1
src/models.c View File

@ -743,7 +743,7 @@ Model LoadHeightmap(Image heightmap, float maxHeight)
vData.texcoords[tcCounter + 7] = vData.texcoords[tcCounter + 5];
vData.texcoords[tcCounter + 8] = vData.texcoords[tcCounter + 2];
vData.texcoords[tcCounter + 9] = vData.texcoords[tcCounter + 3];
vData.texcoords[tcCounter + 9] = vData.texcoords[tcCounter + 1];
vData.texcoords[tcCounter + 10] = (float)(x+1) / (mapX-1);
vData.texcoords[tcCounter + 11] = (float)(z+1) / (mapZ-1);

+ 0
- 1
src/raylib.h View File

@ -340,7 +340,6 @@ bool IsMouseButtonUp(int button); // Detect if a mouse but
int GetMouseX(void); // Returns mouse position X
int GetMouseY(void); // Returns mouse position Y
Vector2 GetMousePosition(void); // Returns mouse position XY
void SetMousePosition(Vector2 position); // Set mouse position XY
int GetMouseWheelMove(void); // Returns mouse wheel movement Y
bool IsGamepadAvailable(int gamepad); // Detect if a gamepad is available

+ 2
- 2
src/raymath.h View File

@ -108,8 +108,8 @@ Matrix MatrixAdd(Matrix left, Matrix right); // Add two matrices
Matrix MatrixSubstract(Matrix left, Matrix right); // Substract two matrices (left - right)
Matrix MatrixTranslate(float x, float y, float z); // Returns translation matrix
Matrix MatrixRotate(float angleX, float angleY, float angleZ); // Returns rotation matrix
Matrix MatrixFromAxisAngle(Vector3 axis, float angle); // Returns rotation matrix for an angle around an specified axis
Matrix MatrixFromAxisAngle2(Vector3 axis, float angle); // Returns rotation matrix for an angle around an specified axis (test another implemntation)
Matrix MatrixRotateAroundAxis(Vector3 axis, float angle); // Returns rotation matrix for an angle around an specified axis
Matrix MatrixRotateAroundAxis2(Vector3 axis, float angle); // Returns rotation matrix for an angle around an specified axis (test another implemntation)
Matrix MatrixFromQuaternion(Quaternion q); // Returns rotation matrix for a given quaternion
Matrix MatrixRotateX(float angle); // Returns x-rotation matrix (angle in radians)
Matrix MatrixRotateY(float angle); // Returns y-rotation matrix (angle in radians)

+ 1
- 7
src/rlgl.c View File

@ -301,10 +301,6 @@ void rlRotatef(float angleDeg, float x, float y, float z)
if (x == 1) rot = MatrixRotateX(angleDeg*DEG2RAD);
else if (y == 1) rot = MatrixRotateY(angleDeg*DEG2RAD);
else if (z == 1) rot = MatrixRotateZ(angleDeg*DEG2RAD);
//Vector3 vec = (Vector3){ 0, 0, 1 };
//VectorNormalize(&vec);
//rot = MatrixFromAxisAngle(vec, angleDeg*DEG2RAD); // Working
MatrixTranspose(&rot);
@ -1309,8 +1305,7 @@ unsigned int rlglLoadTexture(unsigned char *data, int width, int height, bool ge
#if defined(GRAPHICS_API_OPENGL_33)
// NOTE: We define internal (GPU) format as GL_RGBA8 (probably BGRA8 in practice, driver takes care)
//glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, width, height, 0, GL_RGBA, GL_UNSIGNED_BYTE, data); // OpenGL
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, width, height, 0, GL_RGBA, GL_UNSIGNED_BYTE, data); // WebGL
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, width, height, 0, GL_RGBA, GL_UNSIGNED_BYTE, data);
#elif defined(GRAPHICS_API_OPENGL_ES2)
// NOTE: On embedded systems, we let the driver choose the best internal format
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, width, height, 0, GL_RGBA, GL_UNSIGNED_BYTE, data);
@ -1567,7 +1562,6 @@ static GLuint LoadDefaultShaders(void)
char fShaderStr[] = " #version 110 \n" // NOTE: Equivalent to version 100 on ES2
#elif defined(GRAPHICS_API_OPENGL_ES2)
char fShaderStr[] = " #version 100 \n" // NOTE: Must be defined this way! 110 doesn't work!
"precision mediump float; \n" // WebGL, required for PLATFORM_WEB
#endif
"uniform sampler2D texture0; \n"
"varying vec2 fragTexCoord; \n"

Loading…
Cancel
Save