Selaa lähdekoodia

core: fix a few compilation errors and warnings on OS X.

legacy
Sam Hocevar sam 14 vuotta sitten
vanhempi
commit
700cfbd8ea
5 muutettua tiedostoa jossa 20 lisäystä ja 11 poistoa
  1. +0
    -1
      src/image.cpp
  2. +1
    -2
      src/input.cpp
  3. +14
    -4
      src/lolgl.h
  4. +1
    -0
      src/sample.cpp
  5. +4
    -4
      src/timer.cpp

+ 0
- 1
src/image.cpp Näytä tiedosto

@@ -24,7 +24,6 @@
#endif

#include "core.h"
#include "lolgl.h"

namespace lol
{


+ 1
- 2
src/input.cpp Näytä tiedosto

@@ -60,7 +60,6 @@ static InputData * const data = &inputdata;

vec2 Input::GetAxis(int axis)
{
float invsqrt2 = sqrtf(0.5f);
vec2 ret;

#if defined USE_SDL
@@ -71,7 +70,7 @@ vec2 Input::GetAxis(int axis)
ret.x += left;
ret.y += up;
if (left && up)
ret = ret * invsqrt2;
ret = ret * sqrtf(0.5f);
#else
ret = 0;
#endif


+ 14
- 4
src/lolgl.h Näytä tiedosto

@@ -41,11 +41,21 @@
# include <GL/gl.h>
# endif
#elif defined HAVE_GLES_1X
# include <GLES/gl.h>
# include <GLES/glext.h>
# if defined __APPLE__ && defined __MACH__
# include <OpenGLES/ES1/gl.h>
# include <OpenGLES/ES1/glext.h>
# else
# include <GLES/gl.h>
# include <GLES/glext.h>
# endif
#elif defined HAVE_GLES_2X
# include <GLES2/gl2.h>
# include <GLES2/gl2ext.h>
# if defined __APPLE__ && defined __MACH__
# include <OpenGLES/ES2/gl.h>
# include <OpenGLES/ES2/glext.h>
# else
# include <GLES2/gl2.h>
# include <GLES2/gl2ext.h>
# endif
#endif

/* Redefine some function names */


+ 1
- 0
src/sample.cpp Näytä tiedosto

@@ -15,6 +15,7 @@
#include <cstdlib>
#include <cstdio>
#include <cmath>
#include <cstring>

#if defined USE_SDL
# include <SDL.h>


+ 4
- 4
src/timer.cpp Näytä tiedosto

@@ -16,7 +16,7 @@
#include <cstdio>
#include <stdint.h>

#if defined __linux__
#if defined __linux__ || defined __APPLE__
# include <sys/time.h>
# include <unistd.h>
#elif defined _WIN32
@@ -42,7 +42,7 @@ class TimerData
private:
TimerData()
{
#if defined __linux__
#if defined __linux__ || defined __APPLE__
gettimeofday(&tv0, NULL);
#elif defined _WIN32
LARGE_INTEGER tmp;
@@ -58,7 +58,7 @@ private:
float GetOrWait(float deltams, bool update)
{
float ret, towait;
#if defined __linux__
#if defined __linux__ || defined __APPLE__
struct timeval tv;
gettimeofday(&tv, NULL);
ret = 1e-3f * (tv.tv_usec - tv0.tv_usec)
@@ -90,7 +90,7 @@ private:
return ret;
}

#if defined __linux__
#if defined __linux__ || defined __APPLE__
struct timeval tv0;
#elif defined _WIN32
float ms_per_cycle;


Ladataan…
Peruuta
Tallenna