From 2f4ffebde6515eb7a85fbea9014c07aef9b92c95 Mon Sep 17 00:00:00 2001 From: Kp Date: Sat, 27 Jul 2013 21:12:54 +0000 Subject: [PATCH] Add const markers to some texture mapping code --- common/include/3d.h | 2 +- common/include/texmap.h | 4 ++-- common/texmap/tmapflat.c | 4 ++-- similar/arch/ogl/ogl.c | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/common/include/3d.h b/common/include/3d.h index 9313579b3..688df03f7 100644 --- a/common/include/3d.h +++ b/common/include/3d.h @@ -206,7 +206,7 @@ bool g3_draw_bitmap(vms_vector *pos,fix width,fix height,grs_bitmap *bm); //specifies 2d drawing routines to use instead of defaults. Passing //NULL for either or both restores defaults typedef void (*tmap_drawer_type)(grs_bitmap *bm,int nv,g3s_point **vertlist); -typedef void (*flat_drawer_type)(int nv,int *vertlist); +typedef void (*flat_drawer_type)(int nv,const int *vertlist); typedef int (*line_drawer_type)(fix x0,fix y0,fix x1,fix y1); void g3_set_special_render(tmap_drawer_type tmap_drawer,flat_drawer_type flat_drawer,line_drawer_type line_drawer); diff --git a/common/include/texmap.h b/common/include/texmap.h index f6beeb678..a9bea0695 100644 --- a/common/include/texmap.h +++ b/common/include/texmap.h @@ -92,11 +92,11 @@ extern void ntexture_map_lighted_linear(grs_bitmap *srcb, g3ds_tmap *t); // This is the gr_upoly-like interface to the texture mapper which uses texture-mapper compatible // (ie, avoids cracking) edge/delta computation. -void gr_upoly_tmap(int nverts, int *vert ); +void gr_upoly_tmap(int nverts, const int *vert ); //This is like gr_upoly_tmap() but instead of drawing, it calls the specified //function with ylr values -void gr_upoly_tmap_ylr(int nverts, int *vert, void (*ylr_func)(int, fix, fix) ); +void gr_upoly_tmap_ylr(int nverts, const int *vert, void (*ylr_func)(int, fix, fix) ); extern int Transparency_on,per2_flag; diff --git a/common/texmap/tmapflat.c b/common/texmap/tmapflat.c index 298a7f09d..9d3cdbf2f 100644 --- a/common/texmap/tmapflat.c +++ b/common/texmap/tmapflat.c @@ -178,7 +178,7 @@ void texture_map_flat(g3ds_tmap *t, int color) // ----------------------------------------------------------------------------------------- // This is the gr_upoly-like interface to the texture mapper which uses texture-mapper compatible // (ie, avoids cracking) edge/delta computation. -void gr_upoly_tmap(int nverts, int *vert ) +void gr_upoly_tmap(int nverts, const int *vert ) { gr_upoly_tmap_ylr(nverts, vert, tmap_scanline_flat); } @@ -236,7 +236,7 @@ void draw_tmap_flat(grs_bitmap *bp,int nverts,g3s_point **vertbuf) // ----------------------------------------------------------------------------------------- //This is like gr_upoly_tmap() but instead of drawing, it calls the specified //function with ylr values -void gr_upoly_tmap_ylr(int nverts, int *vert, void (*ylr_func)(int,fix,fix) ) +void gr_upoly_tmap_ylr(int nverts, const int *vert, void (*ylr_func)(int,fix,fix) ) { g3ds_tmap my_tmap; int i; diff --git a/similar/arch/ogl/ogl.c b/similar/arch/ogl/ogl.c index 3dbe41b95..7693c55a0 100644 --- a/similar/arch/ogl/ogl.c +++ b/similar/arch/ogl/ogl.c @@ -861,7 +861,7 @@ bool g3_draw_poly(int nv,const g3s_point *const *pointlist) return 0; } -void gr_upoly_tmap(int nverts, int *vert ){ +void gr_upoly_tmap(int nverts, const int *vert ){ glmprintf((0,"gr_upoly_tmap: unhandled\n"));//should never get called }