Make various g3s_point pointers const
This commit is contained in:
parent
843672be06
commit
490908f530
|
@ -105,7 +105,7 @@ bool g3_check_normal_facing(const vms_vector *v,const vms_vector *norm)
|
|||
return (vm_vec_dot(&tempv,norm) > 0);
|
||||
}
|
||||
|
||||
bool do_facing_check(vms_vector *norm,g3s_point **vertlist,vms_vector *p)
|
||||
bool do_facing_check(vms_vector *norm,const g3s_point **vertlist,vms_vector *p)
|
||||
{
|
||||
if (norm) { //have normal
|
||||
|
||||
|
@ -131,7 +131,7 @@ bool do_facing_check(vms_vector *norm,g3s_point **vertlist,vms_vector *p)
|
|||
//is passed, this function works like g3_check_normal_facing() plus
|
||||
//g3_draw_poly().
|
||||
//returns -1 if not facing, 1 if off screen, 0 if drew
|
||||
bool g3_check_and_draw_poly(int nv,g3s_point **pointlist,vms_vector *norm,vms_vector *pnt)
|
||||
bool g3_check_and_draw_poly(int nv,const g3s_point **pointlist,vms_vector *norm,vms_vector *pnt)
|
||||
{
|
||||
if (do_facing_check(norm,pointlist,pnt))
|
||||
return g3_draw_poly(nv,pointlist);
|
||||
|
@ -139,7 +139,7 @@ bool g3_check_and_draw_poly(int nv,g3s_point **pointlist,vms_vector *norm,vms_ve
|
|||
return 255;
|
||||
}
|
||||
|
||||
bool g3_check_and_draw_tmap(int nv,g3s_point **pointlist,g3s_uvl *uvl_list,g3s_lrgb *light_rgb,grs_bitmap *bm,vms_vector *norm,vms_vector *pnt)
|
||||
bool g3_check_and_draw_tmap(int nv,const g3s_point **pointlist,g3s_uvl *uvl_list,g3s_lrgb *light_rgb,grs_bitmap *bm,vms_vector *norm,vms_vector *pnt)
|
||||
{
|
||||
if (do_facing_check(norm,pointlist,pnt))
|
||||
return g3_draw_tmap(nv,pointlist,uvl_list,light_rgb,bm);
|
||||
|
|
|
@ -71,7 +71,7 @@ void rotate_point_list(g3s_point *dest,vms_vector *src,int n)
|
|||
|
||||
static const vms_angvec zero_angles = {0,0,0};
|
||||
|
||||
g3s_point *point_list[MAX_POINTS_PER_POLY];
|
||||
static const g3s_point *point_list[MAX_POINTS_PER_POLY];
|
||||
|
||||
int glow_num = -1;
|
||||
|
||||
|
|
2
3d/rod.c
2
3d/rod.c
|
@ -23,7 +23,7 @@ COPYRIGHT 1993-1998 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED.
|
|||
|
||||
grs_point blob_vertices[4];
|
||||
g3s_point rod_points[4];
|
||||
g3s_point *rod_point_list[] = {&rod_points[0],&rod_points[1],&rod_points[2],&rod_points[3]};
|
||||
static const g3s_point *rod_point_list[] = {&rod_points[0],&rod_points[1],&rod_points[2],&rod_points[3]};
|
||||
|
||||
g3s_uvl uvl_list[4] = { { 0x0200,0x0200,0 },
|
||||
{ 0xfe00,0x0200,0 },
|
||||
|
|
|
@ -498,7 +498,7 @@ void ogl_cache_level_textures(void)
|
|||
r_cachedtexcount = r_texcount;
|
||||
}
|
||||
|
||||
bool g3_draw_line(g3s_point *p0,g3s_point *p1)
|
||||
bool g3_draw_line(const g3s_point *p0,const g3s_point *p1)
|
||||
{
|
||||
int c;
|
||||
GLfloat color_r, color_g, color_b;
|
||||
|
@ -814,7 +814,7 @@ int gr_disk(fix x,fix y,fix r)
|
|||
/*
|
||||
* Draw flat-shaded Polygon (Lasers, Drone-arms, Driller-ears)
|
||||
*/
|
||||
bool g3_draw_poly(int nv,g3s_point **pointlist)
|
||||
bool g3_draw_poly(int nv,const g3s_point **pointlist)
|
||||
{
|
||||
int c, index3, index4;
|
||||
float color_r, color_g, color_b, color_a;
|
||||
|
@ -874,7 +874,7 @@ extern void (*tmap_drawer_ptr)(grs_bitmap *bm,int nv,g3s_point **vertlist);
|
|||
/*
|
||||
* Everything texturemapped (walls, robots, ship)
|
||||
*/
|
||||
bool g3_draw_tmap(int nv,g3s_point **pointlist,g3s_uvl *uvl_list,g3s_lrgb *light_rgb,grs_bitmap *bm)
|
||||
bool g3_draw_tmap(int nv,const g3s_point **pointlist,g3s_uvl *uvl_list,g3s_lrgb *light_rgb,grs_bitmap *bm)
|
||||
{
|
||||
int c, index2, index3, index4;
|
||||
GLfloat *vertex_array, *color_array, *texcoord_array, color_alpha = 1.0;
|
||||
|
@ -948,7 +948,7 @@ bool g3_draw_tmap(int nv,g3s_point **pointlist,g3s_uvl *uvl_list,g3s_lrgb *light
|
|||
/*
|
||||
* Everything texturemapped with secondary texture (walls with secondary texture)
|
||||
*/
|
||||
bool g3_draw_tmap_2(int nv, g3s_point **pointlist, g3s_uvl *uvl_list, g3s_lrgb *light_rgb, grs_bitmap *bmbot, grs_bitmap *bm, int orient)
|
||||
bool g3_draw_tmap_2(int nv, const g3s_point **pointlist, g3s_uvl *uvl_list, g3s_lrgb *light_rgb, grs_bitmap *bmbot, grs_bitmap *bm, int orient)
|
||||
{
|
||||
int c, index2, index3, index4;
|
||||
GLfloat *vertex_array, *color_array, *texcoord_array;
|
||||
|
|
|
@ -146,7 +146,7 @@ void check_segment(segment *seg)
|
|||
gr_setcolor(1); //and render in color one
|
||||
|
||||
for (fn=0;fn<6;fn++) {
|
||||
g3s_point *vert_list[4];
|
||||
const g3s_point *vert_list[4];
|
||||
|
||||
vert_list[0] = &Segment_points[seg->verts[Side_to_verts[fn][0]]];
|
||||
vert_list[1] = &Segment_points[seg->verts[Side_to_verts[fn][1]]];
|
||||
|
|
10
include/3d.h
10
include/3d.h
|
@ -165,11 +165,11 @@ ubyte g3_add_delta_vec(g3s_point *dest,const g3s_point *src,const vms_vector *de
|
|||
|
||||
//draw a flat-shaded face.
|
||||
//returns 1 if off screen, 0 if drew
|
||||
bool g3_draw_poly(int nv,g3s_point **pointlist);
|
||||
bool g3_draw_poly(int nv,const g3s_point **pointlist);
|
||||
|
||||
//draw a texture-mapped face.
|
||||
//returns 1 if off screen, 0 if drew
|
||||
bool g3_draw_tmap(int nv,g3s_point **pointlist,g3s_uvl *uvl_list,g3s_lrgb *light_rgb,grs_bitmap *bm);
|
||||
bool g3_draw_tmap(int nv,const g3s_point **pointlist,g3s_uvl *uvl_list,g3s_lrgb *light_rgb,grs_bitmap *bm);
|
||||
|
||||
//draw a sortof sphere - i.e., the 2d radius is proportional to the 3d
|
||||
//radius, but not to the distance from the eye
|
||||
|
@ -185,11 +185,11 @@ int g3_draw_sphere(g3s_point *pnt,fix rad);
|
|||
//is passed, this function works like g3_check_normal_facing() plus
|
||||
//g3_draw_poly().
|
||||
//returns -1 if not facing, 1 if off screen, 0 if drew
|
||||
bool g3_check_and_draw_poly(int nv,g3s_point **pointlist,vms_vector *norm,vms_vector *pnt);
|
||||
bool g3_check_and_draw_tmap(int nv,g3s_point **pointlist,g3s_uvl *uvl_list,g3s_lrgb *light_rgb, grs_bitmap *bm,vms_vector *norm,vms_vector *pnt);
|
||||
bool g3_check_and_draw_poly(int nv,const g3s_point **pointlist,vms_vector *norm,vms_vector *pnt);
|
||||
bool g3_check_and_draw_tmap(int nv,const g3s_point **pointlist,g3s_uvl *uvl_list,g3s_lrgb *light_rgb, grs_bitmap *bm,vms_vector *norm,vms_vector *pnt);
|
||||
|
||||
//draws a line. takes two points.
|
||||
bool g3_draw_line(g3s_point *p0,g3s_point *p1);
|
||||
bool g3_draw_line(const g3s_point *p0,const g3s_point *p1);
|
||||
|
||||
//draw a polygon that is always facing you
|
||||
//returns 1 if off screen, 0 if drew
|
||||
|
|
|
@ -102,7 +102,7 @@ unsigned char ogl_ugpixel( grs_bitmap * bitmap, int x, int y );
|
|||
void ogl_ulinec(int left, int top, int right, int bot, int c);
|
||||
|
||||
#include "3d.h"
|
||||
bool g3_draw_tmap_2(int nv,g3s_point **pointlist,g3s_uvl *uvl_list,g3s_lrgb *light_rgb, grs_bitmap *bmbot,grs_bitmap *bm, int orient);
|
||||
bool g3_draw_tmap_2(int nv,const g3s_point **pointlist,g3s_uvl *uvl_list,g3s_lrgb *light_rgb, grs_bitmap *bmbot,grs_bitmap *bm, int orient);
|
||||
|
||||
void ogl_draw_vertex_reticle(int cross,int primary,int secondary,int color,int alpha,int size_offs);
|
||||
void ogl_toggle_depth_test(int enable);
|
||||
|
|
|
@ -131,7 +131,7 @@ int toggle_show_only_curside(void)
|
|||
return Show_only_curside = !Show_only_curside;
|
||||
}
|
||||
|
||||
void draw_outline(int nverts,g3s_point **pointlist)
|
||||
void draw_outline(int nverts,const g3s_point **pointlist)
|
||||
{
|
||||
int i;
|
||||
|
||||
|
@ -205,7 +205,7 @@ void render_face(int segnum, int sidenum, int nv, int *vp, int tmap1, int tmap2,
|
|||
g3s_uvl uvl_copy[8];
|
||||
g3s_lrgb dyn_light[8];
|
||||
int i;
|
||||
g3s_point *pointlist[8];
|
||||
const g3s_point *pointlist[8];
|
||||
|
||||
Assert(nv <= 8);
|
||||
|
||||
|
@ -349,7 +349,7 @@ void check_face(int segnum, int sidenum, int facenum, int nv, int *vp, int tmap1
|
|||
#endif
|
||||
g3s_uvl uvl_copy[8];
|
||||
g3s_lrgb dyn_light[8];
|
||||
g3s_point *pointlist[4];
|
||||
const g3s_point *pointlist[4];
|
||||
|
||||
memset(dyn_light, 0, sizeof(dyn_light));
|
||||
#ifndef OGL
|
||||
|
|
|
@ -75,9 +75,9 @@ void build_light_table(void);
|
|||
void free_light_table(void);
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
void draw_cell(int i,int j,g3s_point *p0,g3s_point *p1,g3s_point *p2,g3s_point *p3)
|
||||
void draw_cell(int i,int j,const g3s_point *p0,const g3s_point *p1,const g3s_point *p2,const g3s_point *p3)
|
||||
{
|
||||
g3s_point *pointlist[3];
|
||||
const g3s_point *pointlist[3];
|
||||
|
||||
pointlist[0] = p0;
|
||||
pointlist[1] = p1;
|
||||
|
|
Loading…
Reference in a new issue