Commit d497615e authored by rconde's avatar rconde

- fixing various issues for building under visual studio

 -- fixed min/max redefined warnings
 -- including platform.h for round under visual studio
 -- fixing consistency of const modifiers between function declaration and definition
 -- moving local definitions to top of function to build under visual studio (not c99 compliant)
parent 3e7a8267
......@@ -52,10 +52,13 @@
#endif
#ifndef max
#define max(a,b) ((a) > (b) ? (a) : (b))
#define min(a,b) ((a) < (b) ? (a) : (b))
#endif
#ifndef min
#define min(a,b) ((a) < (b) ? (a) : (b))
#endif
// ------------------------------------------------------- typedef & struct ---
typedef struct {
......
......@@ -37,6 +37,7 @@
#include "shader.h"
#include "texture-font.h"
#include "texture-atlas.h"
#include "platform.h"
#if defined(__APPLE__)
#include <Glut/glut.h>
......@@ -48,8 +49,13 @@
#include <GL/glut.h>
#endif
#ifndef max
#define max(a,b) ((a) > (b) ? (a) : (b))
#endif
#ifndef min
#define min(a,b) ((a) < (b) ? (a) : (b))
#endif
// ------------------------------------------------------- global variables ---
......
......@@ -48,8 +48,13 @@
#include <GL/glut.h>
#endif
#ifndef max
#define max(a,b) ((a) > (b) ? (a) : (b))
#endif
#ifndef min
#define min(a,b) ((a) < (b) ? (a) : (b))
#endif
// ------------------------------------------------------- typedef & struct ---
......
......@@ -43,6 +43,7 @@
#include <math.h>
#include <wchar.h>
#include "texture-font.h"
#include "platform.h"
#define HRES 64
#define HRESf 64.f
......@@ -318,7 +319,7 @@ texture_font_init(texture_font_t *self)
// --------------------------------------------- texture_font_new_from_file ---
texture_font_t *
texture_font_new_from_file(texture_atlas_t *atlas, float pt_size,
texture_font_new_from_file(texture_atlas_t *atlas, const float pt_size,
const char *filename)
{
texture_font_t *self;
......@@ -416,8 +417,13 @@ texture_font_load_glyphs( texture_font_t * self,
FT_UInt glyph_index;
texture_glyph_t *glyph;
FT_Int32 flags = 0;
int ft_glyph_top = 0;
int ft_glyph_left = 0;
ivec4 region;
size_t missed = 0;
char pass;
assert( self );
assert( charcodes );
......@@ -427,8 +433,6 @@ texture_font_load_glyphs( texture_font_t * self,
height = self->atlas->height;
depth = self->atlas->depth;
char pass;
if (!texture_font_get_face(self, &library, &face))
return wcslen(charcodes);
......@@ -448,9 +452,9 @@ texture_font_load_glyphs( texture_font_t * self,
if(pass)
continue; // don't add the item
FT_Int32 flags = 0;
int ft_glyph_top = 0;
int ft_glyph_left = 0;
flags = 0;
ft_glyph_top = 0;
ft_glyph_left = 0;
glyph_index = FT_Get_Char_Index( face, charcodes[i] );
// WARNING: We use texture-atlas depth to guess if user wants
// LCD subpixel rendering
......
......@@ -323,7 +323,7 @@ typedef struct vertex_buffer_t
*/
size_t
vertex_buffer_insert( vertex_buffer_t * self,
size_t index,
const size_t index,
const void * vertices, const size_t vcount,
const GLuint * indices, const size_t icount );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment