Skip to content
Snippets Groups Projects
Commit 09a16e4c authored by neil's avatar neil
Browse files

Separate declaration and definition of inline functions; add an ALWAYS_INLINE...

Separate declaration and definition of inline functions; add an ALWAYS_INLINE define in types.h for GCC-based compilers to make sure to inline even in non-optimized builds, which is required.

git-svn-id: http://svn.net-core.org/repos/t-engine4@797 51575b47-30f0-44d4-a5cc-537603b46e54
parent f022c6e5
No related branches found
No related tags found
No related merge requests found
......@@ -388,7 +388,8 @@ static int map_set_scroll(lua_State *L)
return 0;
}
inline void display_map_quad(map_type *map, int dx, int dy, map_object *m, int i, int j, float a, bool obscure)
inline void display_map_quad(map_type *map, int dx, int dy, map_object *m, int i, int j, float a, bool obscure) ALWAYS_INLINE;
void display_map_quad(map_type *map, int dx, int dy, map_object *m, int i, int j, float a, bool obscure)
{
if (!obscure)
{
......
#ifndef __SHADERS_H
#define __SHADERS_H
inline bool _CheckGL_Error(const char* GLcall, const char* file, const int line)
inline bool _CheckGL_Error(const char* GLcall, const char* file, const int line) ALWAYS_INLINE;
bool _CheckGL_Error(const char* GLcall, const char* file, const int line)
{
GLenum errCode;
if((errCode = glGetError())!=GL_NO_ERROR)
......@@ -13,7 +14,8 @@ inline bool _CheckGL_Error(const char* GLcall, const char* file, const int line)
return TRUE;
}
inline bool _CheckGLSLShaderCompile(GLuint shader, const char* file)
inline bool _CheckGLSLShaderCompile(GLuint shader, const char* file) ALWAYS_INLINE;
bool _CheckGLSLShaderCompile(GLuint shader, const char* file)
{
int success;
int infologLength = 0;
......@@ -50,7 +52,8 @@ inline bool _CheckGLSLShaderCompile(GLuint shader, const char* file)
return TRUE;
}
inline bool _CheckGLSLProgramLink(GLuint program)
inline bool _CheckGLSLProgramLink(GLuint program) ALWAYS_INLINE;
bool _CheckGLSLProgramLink(GLuint program)
{
int success;
glGetObjectParameterivARB(program, GL_LINK_STATUS, &success);
......@@ -74,7 +77,8 @@ inline bool _CheckGLSLProgramLink(GLuint program)
return TRUE;
}
inline bool _CheckGLSLProgramValid(GLuint program)
inline bool _CheckGLSLProgramValid(GLuint program) ALWAYS_INLINE;
bool _CheckGLSLProgramValid(GLuint program)
{
int success;
glGetObjectParameterivARB(program, GL_VALIDATE_STATUS, &success);
......
......@@ -27,4 +27,12 @@ typedef char bool;
#define FALSE 0
#define TRUE 1
#ifndef ALWAYS_INLINE
#ifdef __GNUC__
#define ALWAYS_INLINE __attribute__((always_inline))
#else
#define ALWAYS_INLINE
#endif
#endif
#endif
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment