diff options
author | Bignaux Ronan <ronan@aimao.org> | 2018-10-25 21:24:39 +0200 |
---|---|---|
committer | Pierre GRANDIN <pgrandin@users.noreply.github.com> | 2018-10-25 12:24:39 -0700 |
commit | bf35b9fbd5a35706ca89627d8b313d1dc77b862e (patch) | |
tree | 354224977784e0e3bf9fa4c02a0747f0e2de92ef /navit/graphics | |
parent | 7901afc052c3e182993f580090a8974e894b5c1c (diff) | |
download | navit-bf35b9fbd5a35706ca89627d8b313d1dc77b862e.tar.gz |
Fix:SDL:fix headers according to SDL convention. (#704)
Diffstat (limited to 'navit/graphics')
-rw-r--r-- | navit/graphics/egl/graphics_egl.c | 27 | ||||
-rw-r--r-- | navit/graphics/sdl/event_sdl.c | 2 | ||||
-rw-r--r-- | navit/graphics/sdl/event_sdl.h | 2 | ||||
-rw-r--r-- | navit/graphics/sdl/graphics_sdl.c | 22 | ||||
-rw-r--r-- | navit/graphics/sdl/raster.h | 3 |
5 files changed, 34 insertions, 22 deletions
diff --git a/navit/graphics/egl/graphics_egl.c b/navit/graphics/egl/graphics_egl.c index f9c33c775..2da56047c 100644 --- a/navit/graphics/egl/graphics_egl.c +++ b/navit/graphics/egl/graphics_egl.c @@ -38,7 +38,7 @@ #include "window.h" #include "navit/font/freetype/font_freetype.h" -#include <SDL2/SDL_image.h> +#include "SDL_image.h" #include <GLES2/gl2.h> #include <EGL/egl.h> @@ -88,7 +88,8 @@ struct graphics_priv { struct graphics_gc_priv *background_gc; enum draw_mode_num mode; GLuint program; - GLint mvp_location, position_location, color_location, texture_position_location, use_texture_location, texture_location; + GLint mvp_location, position_location, color_location, texture_position_location, use_texture_location, + texture_location; struct callback_list *cbl; struct font_freetype_methods freetype_methods; struct navit *nav; @@ -430,7 +431,8 @@ static struct graphics_gc_priv *gc_new(struct graphics_priv *gr, struct graphics static struct graphics_image_priv image_error; -static struct graphics_image_priv *image_new(struct graphics_priv *gr, struct graphics_image_methods *meth, char *name, int *w, int *h, struct point *hot, int rotation) { +static struct graphics_image_priv *image_new(struct graphics_priv *gr, struct graphics_image_methods *meth, char *name, + int *w, int *h, struct point *hot, int rotation) { struct graphics_image_priv *gi; /* FIXME: meth is not used yet.. so gi leaks. at least xpm is small */ @@ -640,7 +642,8 @@ static void draw_rectangle(struct graphics_priv *gr, struct graphics_gc_priv *gc graphics_priv_root->dirty = 1; } -static void display_text_draw(struct font_freetype_text *text, struct graphics_priv *gr, struct graphics_gc_priv *fg, struct graphics_gc_priv *bg, int color, struct point *p) { +static void display_text_draw(struct font_freetype_text *text, struct graphics_priv *gr, struct graphics_gc_priv *fg, + struct graphics_gc_priv *bg, int color, struct point *p) { int i, x, y, stride; struct font_freetype_glyph *g, **gp; unsigned char *shadow, *glyph; @@ -745,7 +748,8 @@ static void display_text_draw(struct font_freetype_text *text, struct graphics_p } } -static void draw_text(struct graphics_priv *gr, struct graphics_gc_priv *fg, struct graphics_gc_priv *bg, struct graphics_font_priv *font, char *text, struct point *p, int dx, int dy) { +static void draw_text(struct graphics_priv *gr, struct graphics_gc_priv *fg, struct graphics_gc_priv *bg, + struct graphics_font_priv *font, char *text, struct point *p, int dx, int dy) { if ((gr->parent && !gr->parent->overlay_enabled) || (gr->parent && gr->parent->overlay_enabled && !gr->overlay_enabled)) { @@ -772,7 +776,8 @@ static void draw_text(struct graphics_priv *gr, struct graphics_gc_priv *fg, str } -static void draw_image(struct graphics_priv *gr, struct graphics_gc_priv *fg, struct point *p, struct graphics_image_priv *img) { +static void draw_image(struct graphics_priv *gr, struct graphics_gc_priv *fg, struct point *p, + struct graphics_image_priv *img) { draw_image_es(gr, p, img->img->w, img->img->h, img->img->pixels); } @@ -908,7 +913,8 @@ static void *get_data(struct graphics_priv *this, const char *type) { glClearColor ( 0, 0, 0, 1); glClear ( GL_COLOR_BUFFER_BIT ); - callback_list_call_attr_2(graphics_priv_root->cbl, attr_resize, GINT_TO_POINTER(this->width), GINT_TO_POINTER(this->height)); + callback_list_call_attr_2(graphics_priv_root->cbl, attr_resize, GINT_TO_POINTER(this->width), + GINT_TO_POINTER(this->height)); this->program = glCreateProgram(); vertexShader = load_shader(vertex_src, GL_VERTEX_SHADER); @@ -1073,7 +1079,8 @@ static void create_framebuffer_texture(struct graphics_priv *gr) { } } -static struct graphics_priv *overlay_new(struct graphics_priv *gr, struct graphics_methods *meth, struct point *p, int w, int h, int wraparound) { +static struct graphics_priv *overlay_new(struct graphics_priv *gr, struct graphics_methods *meth, struct point *p, + int w, int h, int wraparound) { struct graphics_priv *this = graphics_opengl_new_helper(meth); this->p.x = p->x; @@ -1228,7 +1235,8 @@ static gboolean graphics_sdl_idle(void *data) { } -static struct graphics_priv *graphics_opengl_new(struct navit *nav, struct graphics_methods *meth, struct attr **attrs, struct callback_list *cbl) { +static struct graphics_priv *graphics_opengl_new(struct navit *nav, struct graphics_methods *meth, struct attr **attrs, + struct callback_list *cbl) { struct attr *attr; if (!event_request_system("glib", "graphics_opengl_new")) return NULL; @@ -1319,4 +1327,3 @@ error: void plugin_init(void) { plugin_register_category_graphics("egl", graphics_opengl_new); } - diff --git a/navit/graphics/sdl/event_sdl.c b/navit/graphics/sdl/event_sdl.c index 5e258c643..454e9eb06 100644 --- a/navit/graphics/sdl/event_sdl.c +++ b/navit/graphics/sdl/event_sdl.c @@ -19,7 +19,7 @@ #include <glib.h> #include <poll.h> -#include <SDL/SDL.h> +#include "SDL.h" #include <pthread.h> #include <signal.h> #include "config.h" diff --git a/navit/graphics/sdl/event_sdl.h b/navit/graphics/sdl/event_sdl.h index 7dceedec5..ee47f60d9 100644 --- a/navit/graphics/sdl/event_sdl.h +++ b/navit/graphics/sdl/event_sdl.h @@ -2,7 +2,7 @@ #ifndef __EVENT_SDL_H #define __EVENT_SDL_H -#include <SDL/SDL.h> +#include "SDL.h" #include "config.h" #include "callback.h" #include "event.h" diff --git a/navit/graphics/sdl/graphics_sdl.c b/navit/graphics/sdl/graphics_sdl.c index d9d31df8e..efd0faad5 100644 --- a/navit/graphics/sdl/graphics_sdl.c +++ b/navit/graphics/sdl/graphics_sdl.c @@ -34,7 +34,7 @@ #include "callback.h" #include "font/freetype/font_freetype.h" -#include <SDL/SDL.h> +#include "SDL.h" #include <math.h> #ifdef USE_WEBOS @@ -56,7 +56,7 @@ #include "raster.h" #include <event.h> -#include <SDL/SDL_image.h> +#include "SDL_image.h" #include <alloca.h> /* TODO: union overlay + non-overlay to reduce size */ @@ -252,7 +252,8 @@ static struct graphics_gc_priv *gc_new(struct graphics_priv *gr, struct graphics } -static struct graphics_image_priv *image_new(struct graphics_priv *gr, struct graphics_image_methods *meth, char *name, int *w, int *h, struct point *hot, int rotation) { +static struct graphics_image_priv *image_new(struct graphics_priv *gr, struct graphics_image_methods *meth, char *name, + int *w, int *h, struct point *hot, int rotation) { struct graphics_image_priv *gi; /* FIXME: meth is not used yet.. so gi leaks. at least xpm is small */ @@ -526,7 +527,8 @@ static void resize_ft_buffer (unsigned int new_size) { } } -static void display_text_draw(struct font_freetype_text *text, struct graphics_priv *gr, struct graphics_gc_priv *fg, struct graphics_gc_priv *bg, int color, struct point *p) { +static void display_text_draw(struct font_freetype_text *text, struct graphics_priv *gr, struct graphics_gc_priv *fg, + struct graphics_gc_priv *bg, int color, struct point *p) { int i, x, y, stride; struct font_freetype_glyph *g, **gp; struct color transparent = { 0x0000, 0x0000, 0x0000, 0x0000 }; @@ -661,7 +663,8 @@ static void display_text_draw(struct font_freetype_text *text, struct graphics_p } } -static void draw_text(struct graphics_priv *gr, struct graphics_gc_priv *fg, struct graphics_gc_priv *bg, struct graphics_font_priv *font, char *text, struct point *p, int dx, int dy) { +static void draw_text(struct graphics_priv *gr, struct graphics_gc_priv *fg, struct graphics_gc_priv *bg, + struct graphics_font_priv *font, char *text, struct point *p, int dx, int dy) { if ((gr->overlay_parent && !gr->overlay_parent->overlay_enable) || (gr->overlay_parent && gr->overlay_parent->overlay_enable && !gr->overlay_enable)) { @@ -685,7 +688,8 @@ static void draw_text(struct graphics_priv *gr, struct graphics_gc_priv *fg, str gr->freetype_methods.text_destroy(t); } -static void draw_image(struct graphics_priv *gr, struct graphics_gc_priv *fg, struct point *p, struct graphics_image_priv *img) { +static void draw_image(struct graphics_priv *gr, struct graphics_gc_priv *fg, struct point *p, + struct graphics_image_priv *img) { if ((gr->overlay_parent && !gr->overlay_parent->overlay_enable) || (gr->overlay_parent && gr->overlay_parent->overlay_enable && !gr->overlay_enable) ) { return; @@ -817,7 +821,8 @@ static struct graphics_methods graphics_methods = { NULL, /* hide_native_keyboard */ }; -static struct graphics_priv *overlay_new(struct graphics_priv *gr, struct graphics_methods *meth, struct point *p, int w, int h,int wraparound) { +static struct graphics_priv *overlay_new(struct graphics_priv *gr, struct graphics_methods *meth, struct point *p, + int w, int h,int wraparound) { struct graphics_priv *ov; Uint32 rmask, gmask, bmask, amask; int i; @@ -1275,7 +1280,8 @@ static gboolean graphics_sdl_idle(void *data) { } -static struct graphics_priv *graphics_sdl_new(struct navit *nav, struct graphics_methods *meth, struct attr **attrs, struct callback_list *cbl) { +static struct graphics_priv *graphics_sdl_new(struct navit *nav, struct graphics_methods *meth, struct attr **attrs, + struct callback_list *cbl) { struct graphics_priv *this=g_new0(struct graphics_priv, 1); struct font_priv *(*font_freetype_new) (void *meth); struct attr *attr; diff --git a/navit/graphics/sdl/raster.h b/navit/graphics/sdl/raster.h index 8f50b2715..2e68ea05f 100644 --- a/navit/graphics/sdl/raster.h +++ b/navit/graphics/sdl/raster.h @@ -9,7 +9,7 @@ #define __RASTER_H #include <stdint.h> -#include <SDL/SDL.h> +#include "SDL.h" void raster_rect(SDL_Surface *s, int16_t x, int16_t y, int16_t w, int16_t h, uint32_t col); @@ -22,4 +22,3 @@ void raster_aacircle(SDL_Surface *s, int16_t x, int16_t y, int16_t r, uint32_t c void raster_aapolygon(SDL_Surface *s, int16_t n, int16_t *vx, int16_t *vy, uint32_t col); #endif /* __RASTER_H */ - |