Added different reticle types with RGBA and size settings; Apply RGBA and size to FlightSim Indicator; Added Brightness Slider to Graphics options menu; Added OpenGL usage for gr_disk
This commit is contained in:
parent
7305f3d51e
commit
31d17380ec
77
2d/disc.c
77
2d/disc.c
|
@ -1,50 +1,11 @@
|
||||||
/*
|
/*
|
||||||
THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX
|
|
||||||
SOFTWARE CORPORATION ("PARALLAX"). PARALLAX, IN DISTRIBUTING THE CODE TO
|
|
||||||
END-USERS, AND SUBJECT TO ALL OF THE TERMS AND CONDITIONS HEREIN, GRANTS A
|
|
||||||
ROYALTY-FREE, PERPETUAL LICENSE TO SUCH END-USERS FOR USE BY SUCH END-USERS
|
|
||||||
IN USING, DISPLAYING, AND CREATING DERIVATIVE WORKS THEREOF, SO LONG AS
|
|
||||||
SUCH USE, DISPLAY OR CREATION IS FOR NON-COMMERCIAL, ROYALTY OR REVENUE
|
|
||||||
FREE PURPOSES. IN NO EVENT SHALL THE END-USER USE THE COMPUTER CODE
|
|
||||||
CONTAINED HEREIN FOR REVENUE-BEARING PURPOSES. THE END-USER UNDERSTANDS
|
|
||||||
AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE.
|
|
||||||
COPYRIGHT 1993-1998 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED.
|
|
||||||
*/
|
|
||||||
/*
|
|
||||||
* $Source: /cvsroot/dxx-rebirth/d1x-rebirth/2d/disc.c,v $
|
|
||||||
* $Revision: 1.1.1.1 $
|
|
||||||
* $Author: zicodxx $
|
|
||||||
* $Date: 2006/03/17 19:38:57 $
|
|
||||||
*
|
*
|
||||||
* Graphical routines for drawing a disk.
|
* Graphical routines for drawing a disk.
|
||||||
*
|
*
|
||||||
* $Log: disc.c,v $
|
|
||||||
* Revision 1.1.1.1 2006/03/17 19:38:57 zicodxx
|
|
||||||
* initial import
|
|
||||||
*
|
|
||||||
* Revision 1.1.1.1 1999/06/14 21:57:18 donut
|
|
||||||
* Import of d1x 1.37 source.
|
|
||||||
*
|
|
||||||
* Revision 1.5 1994/11/18 22:50:16 john
|
|
||||||
* Changed shorts to ints in parameters.
|
|
||||||
*
|
|
||||||
* Revision 1.4 1994/05/06 12:50:12 john
|
|
||||||
* Added supertransparency; neatend things up; took out warnings.
|
|
||||||
*
|
|
||||||
* Revision 1.3 1994/04/22 11:16:04 john
|
|
||||||
* *** empty log message ***
|
|
||||||
*
|
|
||||||
* Revision 1.2 1993/10/15 16:22:24 john
|
|
||||||
* *** empty log message ***
|
|
||||||
*
|
|
||||||
* Revision 1.1 1993/09/08 11:43:24 john
|
|
||||||
* Initial revision
|
|
||||||
*
|
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#ifndef OGL
|
||||||
#include "u_mem.h"
|
#include "u_mem.h"
|
||||||
|
|
||||||
#include "gr.h"
|
#include "gr.h"
|
||||||
#include "grdef.h"
|
#include "grdef.h"
|
||||||
|
|
||||||
|
@ -89,38 +50,4 @@ int gr_disk(fix xc1,fix yc1,fix r1)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int gr_udisk(fix xc1,fix yc1,fix r1)
|
#endif
|
||||||
{
|
|
||||||
int p,x, y, xc, yc, r;
|
|
||||||
|
|
||||||
r = f2i(r1);
|
|
||||||
xc = f2i(xc1);
|
|
||||||
yc = f2i(yc1);
|
|
||||||
p=3-(r*2);
|
|
||||||
x=0;
|
|
||||||
y=r;
|
|
||||||
|
|
||||||
while(x<y)
|
|
||||||
{
|
|
||||||
// Draw the first octant
|
|
||||||
gr_uscanline( xc-y, xc+y, yc-x );
|
|
||||||
gr_uscanline( xc-y, xc+y, yc+x );
|
|
||||||
|
|
||||||
if (p<0)
|
|
||||||
p=p+(x<<2)+6;
|
|
||||||
else {
|
|
||||||
// Draw the second octant
|
|
||||||
gr_uscanline( xc-x, xc+x, yc-y );
|
|
||||||
gr_uscanline( xc-x, xc+x, yc+y );
|
|
||||||
p=p+((x-y)<<2)+10;
|
|
||||||
y--;
|
|
||||||
}
|
|
||||||
x++;
|
|
||||||
}
|
|
||||||
if(x==y) {
|
|
||||||
gr_uscanline( xc-x, xc+x, yc-y );
|
|
||||||
gr_uscanline( xc-x, xc+x, yc+y );
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,9 @@
|
||||||
D1X-Rebirth Changelog
|
D1X-Rebirth Changelog
|
||||||
|
|
||||||
|
20110110
|
||||||
|
--------
|
||||||
|
2d/disc.c, arch/ogl/gr.c, arch/ogl/ogl.c, include/gr.h, include/ogl_init.h, main/automap.c, main/gauges.c, main/gauges.h, main/menu.c, main/playsave.c, main/playsave.h: Added different reticle types with RGBA and size settings; Apply RGBA and size to FlightSim Indicator; Added Brightness Slider to Graphics options menu; Added OpenGL usage for gr_disk
|
||||||
|
|
||||||
20110109
|
20110109
|
||||||
--------
|
--------
|
||||||
main/net_udp.h: Set max UDP packet size to 1024 again (seems some configuration DO have problems with larger packets after all)
|
main/net_udp.h: Set max UDP packet size to 1024 again (seems some configuration DO have problems with larger packets after all)
|
||||||
|
|
|
@ -600,7 +600,7 @@ void ogl_urect(int left,int top,int right,int bot)
|
||||||
void ogl_ulinec(int left,int top,int right,int bot,int c)
|
void ogl_ulinec(int left,int top,int right,int bot,int c)
|
||||||
{
|
{
|
||||||
GLfloat xo,yo,xf,yf;
|
GLfloat xo,yo,xf,yf;
|
||||||
GLfloat color_array[] = { CPAL2Tr(c), CPAL2Tg(c), CPAL2Tb(c), 1.0, CPAL2Tr(c), CPAL2Tg(c), CPAL2Tb(c), 1.0, CPAL2Tr(c), CPAL2Tg(c), CPAL2Tb(c), 1.0, CPAL2Tr(c), CPAL2Tg(c), CPAL2Tb(c), 1.0 };
|
GLfloat color_array[] = { CPAL2Tr(c), CPAL2Tg(c), CPAL2Tb(c), 1.0 - (float)Gr_scanline_darkening_level / ((float)GR_FADE_LEVELS - 1.0), CPAL2Tr(c), CPAL2Tg(c), CPAL2Tb(c), 1.0 - (float)Gr_scanline_darkening_level / ((float)GR_FADE_LEVELS - 1.0), CPAL2Tr(c), CPAL2Tg(c), CPAL2Tb(c), 1.0, CPAL2Tr(c), CPAL2Tg(c), CPAL2Tb(c), 1.0 - (float)Gr_scanline_darkening_level / ((float)GR_FADE_LEVELS - 1.0) };
|
||||||
GLfloat vertex_array[] = { 0.0, 0.0, 0.0, 0.0 };
|
GLfloat vertex_array[] = { 0.0, 0.0, 0.0, 0.0 };
|
||||||
|
|
||||||
glEnableClientState(GL_VERTEX_ARRAY);
|
glEnableClientState(GL_VERTEX_ARRAY);
|
||||||
|
|
162
arch/ogl/ogl.c
162
arch/ogl/ogl.c
|
@ -68,9 +68,6 @@
|
||||||
#define sinf(a) sin(a)
|
#define sinf(a) sin(a)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define BRIGHT_G 0.125, 1.0, 0.125, 1.0
|
|
||||||
#define DARK_G 0.125, 0.54, 0.125, 0.6
|
|
||||||
|
|
||||||
unsigned char *ogl_pal=gr_palette;
|
unsigned char *ogl_pal=gr_palette;
|
||||||
|
|
||||||
int last_width=-1,last_height=-1;
|
int last_width=-1,last_height=-1;
|
||||||
|
@ -85,61 +82,7 @@ int ogl_rgb_internalformat = GL_RGB;
|
||||||
int ogl_rgba_internalformat = GL_RGBA8;
|
int ogl_rgba_internalformat = GL_RGBA8;
|
||||||
int ogl_rgb_internalformat = GL_RGB8;
|
int ogl_rgb_internalformat = GL_RGB8;
|
||||||
#endif
|
#endif
|
||||||
GLfloat dark_lca[16 * 4] = {
|
|
||||||
DARK_G, DARK_G, DARK_G, DARK_G,
|
|
||||||
DARK_G, DARK_G, DARK_G, DARK_G,
|
|
||||||
DARK_G, DARK_G, DARK_G, DARK_G,
|
|
||||||
DARK_G, DARK_G, DARK_G, DARK_G
|
|
||||||
};
|
|
||||||
GLfloat bright_lca[16 * 4] = {
|
|
||||||
BRIGHT_G, BRIGHT_G, BRIGHT_G, BRIGHT_G,
|
|
||||||
BRIGHT_G, BRIGHT_G, BRIGHT_G, BRIGHT_G,
|
|
||||||
BRIGHT_G, BRIGHT_G, BRIGHT_G, BRIGHT_G,
|
|
||||||
BRIGHT_G, BRIGHT_G, BRIGHT_G, BRIGHT_G
|
|
||||||
};
|
|
||||||
GLfloat *sphere_va = NULL;
|
GLfloat *sphere_va = NULL;
|
||||||
GLfloat cross_lca[8 * 4] = {
|
|
||||||
DARK_G, BRIGHT_G,
|
|
||||||
DARK_G, BRIGHT_G,
|
|
||||||
DARK_G, BRIGHT_G,
|
|
||||||
DARK_G, BRIGHT_G
|
|
||||||
};
|
|
||||||
GLfloat cross_lva[8 * 2] = {
|
|
||||||
-4.0, 2.0, -2.0, 0,
|
|
||||||
-3.0, -4.0, -2.0, -3.0,
|
|
||||||
4.0, 2.0, 2.0, 0,
|
|
||||||
3.0, -4.0, 2.0, -3.0,
|
|
||||||
};
|
|
||||||
GLfloat primary_lca[2][4 * 4] = {
|
|
||||||
{BRIGHT_G, BRIGHT_G, DARK_G, DARK_G},
|
|
||||||
{DARK_G, DARK_G, BRIGHT_G, BRIGHT_G}
|
|
||||||
};
|
|
||||||
GLfloat primary_lva[4][4 * 2] = {
|
|
||||||
{
|
|
||||||
-5.5, -5.0,
|
|
||||||
-6.5, -7.5,
|
|
||||||
-10.0, -7.0,
|
|
||||||
-10.0, -8.7
|
|
||||||
},
|
|
||||||
{
|
|
||||||
-10.0, -7.0,
|
|
||||||
-10.0, -8.7,
|
|
||||||
-15.0, -8.5,
|
|
||||||
-15.0, -9.5
|
|
||||||
},
|
|
||||||
{
|
|
||||||
5.5, -5.0,
|
|
||||||
6.5, -7.5,
|
|
||||||
10.0, -7.0,
|
|
||||||
10.0, -8.7
|
|
||||||
},
|
|
||||||
{
|
|
||||||
10.0, -7.0,
|
|
||||||
10.0, -8.7,
|
|
||||||
15.0, -8.5,
|
|
||||||
15.0, -9.5
|
|
||||||
}
|
|
||||||
};
|
|
||||||
GLfloat *secondary_lva[3]={NULL, NULL, NULL};
|
GLfloat *secondary_lva[3]={NULL, NULL, NULL};
|
||||||
int r_polyc,r_tpolyc,r_bitmapc,r_ubitbltc,r_upixelc;
|
int r_polyc,r_tpolyc,r_bitmapc,r_ubitbltc,r_upixelc;
|
||||||
extern int linedotscale;
|
extern int linedotscale;
|
||||||
|
@ -610,10 +553,82 @@ GLfloat *circle_array_init_2(int nsides, float xsc, float xo, float ysc, float y
|
||||||
return vertex_array;
|
return vertex_array;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ogl_draw_reticle(int cross,int primary,int secondary)
|
void ogl_draw_vertex_reticle(int cross,int primary,int secondary,int color,int alpha,int size_offs)
|
||||||
{
|
{
|
||||||
fix size=270;
|
int size=270+(size_offs*20), i;
|
||||||
float scale = ((float)SWIDTH/SHEIGHT);
|
float scale = ((float)SWIDTH/SHEIGHT), ret_rgba[4], ret_dark_rgba[4];
|
||||||
|
GLfloat cross_lva[8 * 2] = {
|
||||||
|
-4.0, 2.0, -2.0, 0, -3.0, -4.0, -2.0, -3.0, 4.0, 2.0, 2.0, 0, 3.0, -4.0, 2.0, -3.0,
|
||||||
|
};
|
||||||
|
GLfloat primary_lva[4][4 * 2] = {
|
||||||
|
{ -5.5, -5.0, -6.5, -7.5, -10.0, -7.0, -10.0, -8.7 },
|
||||||
|
{ -10.0, -7.0, -10.0, -8.7, -15.0, -8.5, -15.0, -9.5 },
|
||||||
|
{ 5.5, -5.0, 6.5, -7.5, 10.0, -7.0, 10.0, -8.7 },
|
||||||
|
{ 10.0, -7.0, 10.0, -8.7, 15.0, -8.5, 15.0, -9.5 }
|
||||||
|
};
|
||||||
|
GLfloat dark_lca[16 * 4] = {
|
||||||
|
0.125, 0.54, 0.125, 0.6, 0.125, 0.54, 0.125, 0.6, 0.125, 0.54, 0.125, 0.6, 0.125, 0.54, 0.125, 0.6,
|
||||||
|
0.125, 0.54, 0.125, 0.6, 0.125, 0.54, 0.125, 0.6, 0.125, 0.54, 0.125, 0.6, 0.125, 0.54, 0.125, 0.6,
|
||||||
|
0.125, 0.54, 0.125, 0.6, 0.125, 0.54, 0.125, 0.6, 0.125, 0.54, 0.125, 0.6, 0.125, 0.54, 0.125, 0.6,
|
||||||
|
0.125, 0.54, 0.125, 0.6, 0.125, 0.54, 0.125, 0.6, 0.125, 0.54, 0.125, 0.6, 0.125, 0.54, 0.125, 0.6
|
||||||
|
};
|
||||||
|
GLfloat bright_lca[16 * 4] = {
|
||||||
|
0.125, 1.0, 0.125, 1.0, 0.125, 1.0, 0.125, 1.0, 0.125, 1.0, 0.125, 1.0, 0.125, 1.0, 0.125, 1.0,
|
||||||
|
0.125, 1.0, 0.125, 1.0, 0.125, 1.0, 0.125, 1.0, 0.125, 1.0, 0.125, 1.0, 0.125, 1.0, 0.125, 1.0,
|
||||||
|
0.125, 1.0, 0.125, 1.0, 0.125, 1.0, 0.125, 1.0, 0.125, 1.0, 0.125, 1.0, 0.125, 1.0, 0.125, 1.0,
|
||||||
|
0.125, 1.0, 0.125, 1.0, 0.125, 1.0, 0.125, 1.0, 0.125, 1.0, 0.125, 1.0, 0.125, 1.0, 0.125, 1.0
|
||||||
|
};
|
||||||
|
GLfloat cross_lca[8 * 4] = {
|
||||||
|
0.125, 0.54, 0.125, 0.6, 0.125, 1.0, 0.125, 1.0,
|
||||||
|
0.125, 0.54, 0.125, 0.6, 0.125, 1.0, 0.125, 1.0,
|
||||||
|
0.125, 0.54, 0.125, 0.6, 0.125, 1.0, 0.125, 1.0,
|
||||||
|
0.125, 0.54, 0.125, 0.6, 0.125, 1.0, 0.125, 1.0
|
||||||
|
};
|
||||||
|
GLfloat primary_lca[2][4 * 4] = {
|
||||||
|
{0.125, 1.0, 0.125, 1.0, 0.125, 1.0, 0.125, 1.0, 0.125, 0.54, 0.125, 0.6, 0.125, 0.54, 0.125, 0.6},
|
||||||
|
{0.125, 0.54, 0.125, 0.6, 0.125, 0.54, 0.125, 0.6, 0.125, 1.0, 0.125, 1.0, 0.125, 1.0, 0.125, 1.0}
|
||||||
|
};
|
||||||
|
|
||||||
|
ret_rgba[0] = PAL2Tr(color);
|
||||||
|
ret_dark_rgba[0] = ret_rgba[0]/2;
|
||||||
|
ret_rgba[1] = PAL2Tg(color);
|
||||||
|
ret_dark_rgba[1] = ret_rgba[1]/2;
|
||||||
|
ret_rgba[2] = PAL2Tb(color);
|
||||||
|
ret_dark_rgba[2] = ret_rgba[2]/2;
|
||||||
|
ret_rgba[3] = 1.0 - ((float)alpha / ((float)GR_FADE_LEVELS));
|
||||||
|
ret_dark_rgba[3] = ret_rgba[3]/2;
|
||||||
|
|
||||||
|
for (i = 0; i < 16*4; i += 4)
|
||||||
|
{
|
||||||
|
bright_lca[i] = ret_rgba[0];
|
||||||
|
dark_lca[i] = ret_dark_rgba[0];
|
||||||
|
bright_lca[i+1] = ret_rgba[1];
|
||||||
|
dark_lca[i+1] = ret_dark_rgba[1];
|
||||||
|
bright_lca[i+2] = ret_rgba[2];
|
||||||
|
dark_lca[i+2] = ret_dark_rgba[2];
|
||||||
|
bright_lca[i+3] = ret_rgba[3];
|
||||||
|
dark_lca[i+3] = ret_dark_rgba[3];
|
||||||
|
}
|
||||||
|
for (i = 0; i < 8*4; i += 8)
|
||||||
|
{
|
||||||
|
cross_lca[i] = ret_dark_rgba[0];
|
||||||
|
cross_lca[i+1] = ret_dark_rgba[1];
|
||||||
|
cross_lca[i+2] = ret_dark_rgba[2];
|
||||||
|
cross_lca[i+3] = ret_dark_rgba[3];
|
||||||
|
cross_lca[i+4] = ret_rgba[0];
|
||||||
|
cross_lca[i+5] = ret_rgba[1];
|
||||||
|
cross_lca[i+6] = ret_rgba[2];
|
||||||
|
cross_lca[i+7] = ret_rgba[3];
|
||||||
|
}
|
||||||
|
|
||||||
|
primary_lca[0][0] = primary_lca[0][4] = primary_lca[1][8] = primary_lca[1][12] = ret_rgba[0];
|
||||||
|
primary_lca[0][1] = primary_lca[0][5] = primary_lca[1][9] = primary_lca[1][13] = ret_rgba[1];
|
||||||
|
primary_lca[0][2] = primary_lca[0][6] = primary_lca[1][10] = primary_lca[1][14] = ret_rgba[2];
|
||||||
|
primary_lca[0][3] = primary_lca[0][7] = primary_lca[1][11] = primary_lca[1][15] = ret_rgba[3];
|
||||||
|
primary_lca[1][0] = primary_lca[1][4] = primary_lca[0][8] = primary_lca[0][12] = ret_dark_rgba[0];
|
||||||
|
primary_lca[1][1] = primary_lca[1][5] = primary_lca[0][9] = primary_lca[0][13] = ret_dark_rgba[1];
|
||||||
|
primary_lca[1][2] = primary_lca[1][6] = primary_lca[0][10] = primary_lca[0][14] = ret_dark_rgba[2];
|
||||||
|
primary_lca[1][3] = primary_lca[1][7] = primary_lca[0][11] = primary_lca[0][15] = ret_dark_rgba[3];
|
||||||
|
|
||||||
glPushMatrix();
|
glPushMatrix();
|
||||||
glTranslatef((grd_curcanv->cv_bitmap.bm_w/2+grd_curcanv->cv_bitmap.bm_x)/(float)last_width,1.0-(grd_curcanv->cv_bitmap.bm_h/2+grd_curcanv->cv_bitmap.bm_y)/(float)last_height,0);
|
glTranslatef((grd_curcanv->cv_bitmap.bm_w/2+grd_curcanv->cv_bitmap.bm_x)/(float)last_width,1.0-(grd_curcanv->cv_bitmap.bm_h/2+grd_curcanv->cv_bitmap.bm_y)/(float)last_height,0);
|
||||||
|
@ -748,7 +763,7 @@ int gr_ucircle(fix xc1, fix yc1, fix r1)
|
||||||
int c, nsides;
|
int c, nsides;
|
||||||
c=grd_curcanv->cv_color;
|
c=grd_curcanv->cv_color;
|
||||||
OGL_DISABLE(TEXTURE_2D);
|
OGL_DISABLE(TEXTURE_2D);
|
||||||
glColor4f(CPAL2Tr(c),CPAL2Tg(c),CPAL2Tb(c),1.0);
|
glColor4f(CPAL2Tr(c),CPAL2Tg(c),CPAL2Tb(c),1.0 - (float)Gr_scanline_darkening_level / ((float)GR_FADE_LEVELS - 1.0));
|
||||||
glPushMatrix();
|
glPushMatrix();
|
||||||
glTranslatef(
|
glTranslatef(
|
||||||
(f2fl(xc1) + grd_curcanv->cv_bitmap.bm_x + 0.5) / (float)last_width,
|
(f2fl(xc1) + grd_curcanv->cv_bitmap.bm_x + 0.5) / (float)last_width,
|
||||||
|
@ -764,6 +779,23 @@ int gr_circle(fix xc1,fix yc1,fix r1){
|
||||||
return gr_ucircle(xc1,yc1,r1);
|
return gr_ucircle(xc1,yc1,r1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int gr_disk(fix x,fix y,fix r)
|
||||||
|
{
|
||||||
|
int c, nsides;
|
||||||
|
c=grd_curcanv->cv_color;
|
||||||
|
OGL_DISABLE(TEXTURE_2D);
|
||||||
|
glColor4f(CPAL2Tr(c),CPAL2Tg(c),CPAL2Tb(c),1.0 - (float)Gr_scanline_darkening_level / ((float)GR_FADE_LEVELS - 1.0));
|
||||||
|
glPushMatrix();
|
||||||
|
glTranslatef(
|
||||||
|
(f2fl(x) + grd_curcanv->cv_bitmap.bm_x + 0.5) / (float)last_width,
|
||||||
|
1.0 - (f2fl(y) + grd_curcanv->cv_bitmap.bm_y + 0.5) / (float)last_height,0);
|
||||||
|
glScalef(f2fl(r) / last_width, f2fl(r) / last_height, 1.0);
|
||||||
|
nsides = 10 + 2 * (int)(M_PI * f2fl(r) / 19);
|
||||||
|
ogl_drawcircle(nsides, GL_TRIANGLE_FAN, circle_array_init(nsides));
|
||||||
|
glPopMatrix();
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Draw flat-shaded Polygon (Lasers, Drone-arms, Driller-ears)
|
* Draw flat-shaded Polygon (Lasers, Drone-arms, Driller-ears)
|
||||||
*/
|
*/
|
||||||
|
@ -1091,10 +1123,10 @@ bool ogl_ubitmapm_c(int x, int y,grs_bitmap *bm,int c)
|
||||||
color_b = CPAL2Tb(c);
|
color_b = CPAL2Tb(c);
|
||||||
}
|
}
|
||||||
|
|
||||||
color_array[0] = color_array[4] = color_array[8] = color_array[12] = color_r;
|
color_array[0] = color_array[4] = color_array[8] = color_r;
|
||||||
color_array[1] = color_array[5] = color_array[9] = color_array[13] = color_g;
|
color_array[1] = color_array[5] = color_array[9] = color_g;
|
||||||
color_array[2] = color_array[6] = color_array[10] = color_array[14] = color_b;
|
color_array[2] = color_array[6] = color_array[10] = color_b;
|
||||||
color_array[3] = color_array[7] = color_array[11] = color_array[15] = 1.0;
|
color_array[3] = color_array[7] = color_array[11] = 1.0;
|
||||||
|
|
||||||
vertex_array[0] = xo;
|
vertex_array[0] = xo;
|
||||||
vertex_array[1] = yo;
|
vertex_array[1] = yo;
|
||||||
|
|
|
@ -318,7 +318,6 @@ void gr_urect(int left,int top,int right,int bot);
|
||||||
|
|
||||||
// Draw a filled circle
|
// Draw a filled circle
|
||||||
int gr_disk(fix x,fix y,fix r);
|
int gr_disk(fix x,fix y,fix r);
|
||||||
int gr_udisk(fix x,fix y,fix r);
|
|
||||||
|
|
||||||
// Draw an outline circle
|
// Draw an outline circle
|
||||||
int gr_circle(fix x,fix y,fix r);
|
int gr_circle(fix x,fix y,fix r);
|
||||||
|
|
|
@ -97,6 +97,6 @@ void ogl_ulinec(int left, int top, int right, int bot, int c);
|
||||||
#include "3d.h"
|
#include "3d.h"
|
||||||
bool g3_draw_tmap_2(int nv,g3s_point **pointlist,g3s_uvl *uvl_list,grs_bitmap *bmbot,grs_bitmap *bm, int orient);
|
bool g3_draw_tmap_2(int nv,g3s_point **pointlist,g3s_uvl *uvl_list,grs_bitmap *bmbot,grs_bitmap *bm, int orient);
|
||||||
|
|
||||||
void ogl_draw_reticle(int cross, int primary, int secondary);
|
void ogl_draw_vertex_reticle(int cross,int primary,int secondary,int color,int alpha,int size_offs);
|
||||||
|
|
||||||
#endif /* _OGL_INIT_H_ */
|
#endif /* _OGL_INIT_H_ */
|
||||||
|
|
|
@ -70,6 +70,7 @@ COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED.
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
#include "rbaudio.h"
|
#include "rbaudio.h"
|
||||||
#include "window.h"
|
#include "window.h"
|
||||||
|
#include "playsave.h"
|
||||||
|
|
||||||
#define EF_USED 1 // This edge is used
|
#define EF_USED 1 // This edge is used
|
||||||
#define EF_DEFINING 2 // A structure defining edge that should always draw.
|
#define EF_DEFINING 2 // A structure defining edge that should always draw.
|
||||||
|
@ -347,7 +348,8 @@ void draw_automap(automap *am)
|
||||||
|
|
||||||
name_frame(am);
|
name_frame(am);
|
||||||
|
|
||||||
show_mousefs_reticle(GWIDTH-(GHEIGHT/8), GHEIGHT-(GHEIGHT/8), GHEIGHT/5);
|
if (PlayerCfg.MouseFlightSim && PlayerCfg.MouseFSIndicator)
|
||||||
|
show_mousefs_indicator(GWIDTH-(GHEIGHT/8), GHEIGHT-(GHEIGHT/8), GHEIGHT/5);
|
||||||
}
|
}
|
||||||
|
|
||||||
#define LEAVE_TIME 0x4000
|
#define LEAVE_TIME 0x4000
|
||||||
|
|
248
main/gauges.c
248
main/gauges.c
|
@ -1956,15 +1956,16 @@ xy primary_offsets[4] = { {-30,14}, {-16,6}, {-15,6}, {-8, 2} };
|
||||||
xy secondary_offsets[4] = { {-24,2}, {-12,0}, {-12,1}, {-6,-2} };
|
xy secondary_offsets[4] = { {-24,2}, {-12,0}, {-12,1}, {-6,-2} };
|
||||||
|
|
||||||
//draw the reticle
|
//draw the reticle
|
||||||
void show_reticle()
|
void show_reticle(int reticle_type)
|
||||||
{
|
{
|
||||||
int x,y;
|
int x,y,size;
|
||||||
int laser_ready,missile_ready,laser_ammo,missile_ammo;
|
int laser_ready,missile_ready,laser_ammo,missile_ammo;
|
||||||
int cross_bm_num,primary_bm_num,secondary_bm_num;
|
int cross_bm_num,primary_bm_num,secondary_bm_num;
|
||||||
int use_hires_reticle,ofs;
|
int use_hires_reticle,ofs;
|
||||||
|
|
||||||
x = grd_curcanv->cv_bitmap.bm_w/2;
|
x = grd_curcanv->cv_bitmap.bm_w/2;
|
||||||
y = grd_curcanv->cv_bitmap.bm_h/2;
|
y = grd_curcanv->cv_bitmap.bm_h/2;
|
||||||
|
size = (grd_curcanv->cv_bitmap.bm_h / (32-(PlayerCfg.ReticleSize*4)));
|
||||||
|
|
||||||
laser_ready = allowed_to_fire_laser();
|
laser_ready = allowed_to_fire_laser();
|
||||||
missile_ready = allowed_to_fire_missile();
|
missile_ready = allowed_to_fire_missile();
|
||||||
|
@ -1988,111 +1989,86 @@ void show_reticle()
|
||||||
Assert(primary_bm_num <= 2);
|
Assert(primary_bm_num <= 2);
|
||||||
Assert(secondary_bm_num <= 4);
|
Assert(secondary_bm_num <= 4);
|
||||||
Assert(cross_bm_num <= 1);
|
Assert(cross_bm_num <= 1);
|
||||||
|
|
||||||
|
gr_setcolor(BM_XRGB(PlayerCfg.ReticleRGBA[0],PlayerCfg.ReticleRGBA[1],PlayerCfg.ReticleRGBA[2]));
|
||||||
|
Gr_scanline_darkening_level = PlayerCfg.ReticleRGBA[3];
|
||||||
|
|
||||||
|
switch (reticle_type)
|
||||||
|
{
|
||||||
|
case RET_TYPE_CLASSIC:
|
||||||
|
{
|
||||||
|
grs_bitmap *cross, *primary, *secondary;
|
||||||
|
|
||||||
|
use_hires_reticle = (HIRESMODE != 0);
|
||||||
|
ofs = (use_hires_reticle?0:2);
|
||||||
|
|
||||||
|
PIGGY_PAGE_IN(Gauges[RETICLE_CROSS + cross_bm_num]);
|
||||||
|
cross = &GameBitmaps[Gauges[RETICLE_CROSS + cross_bm_num].index];
|
||||||
|
hud_bitblt_free(x+HUD_SCALE_X_AR(cross_offsets[ofs].x),y+HUD_SCALE_Y_AR(cross_offsets[ofs].y), HUD_SCALE_X_AR(cross->bm_w), HUD_SCALE_Y_AR(cross->bm_h), cross);
|
||||||
|
|
||||||
|
PIGGY_PAGE_IN(Gauges[RETICLE_PRIMARY + primary_bm_num]);
|
||||||
|
primary = &GameBitmaps[Gauges[RETICLE_PRIMARY + primary_bm_num].index];
|
||||||
|
hud_bitblt_free(x+HUD_SCALE_X_AR(primary_offsets[ofs].x),y+HUD_SCALE_Y_AR(primary_offsets[ofs].y), HUD_SCALE_X_AR(primary->bm_w), HUD_SCALE_Y_AR(primary->bm_h), primary);
|
||||||
|
|
||||||
|
PIGGY_PAGE_IN(Gauges[RETICLE_SECONDARY + secondary_bm_num]);
|
||||||
|
secondary = &GameBitmaps[Gauges[RETICLE_SECONDARY + secondary_bm_num].index];
|
||||||
|
hud_bitblt_free(x+HUD_SCALE_X_AR(secondary_offsets[ofs].x),y+HUD_SCALE_Y_AR(secondary_offsets[ofs].y), HUD_SCALE_X_AR(secondary->bm_w), HUD_SCALE_Y_AR(secondary->bm_h), secondary);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case RET_TYPE_CLASSIC_REBOOT:
|
||||||
|
{
|
||||||
#ifdef OGL
|
#ifdef OGL
|
||||||
if (PlayerCfg.OglReticle)
|
ogl_draw_vertex_reticle(cross_bm_num,primary_bm_num,secondary_bm_num,BM_XRGB(PlayerCfg.ReticleRGBA[0],PlayerCfg.ReticleRGBA[1],PlayerCfg.ReticleRGBA[2]),PlayerCfg.ReticleRGBA[3],PlayerCfg.ReticleSize);
|
||||||
{
|
|
||||||
ogl_draw_reticle(cross_bm_num,primary_bm_num,secondary_bm_num);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
#endif
|
#endif
|
||||||
|
break;
|
||||||
|
|
||||||
if (grd_curcanv->cv_bitmap.bm_w > 200) {
|
|
||||||
grs_bitmap *cross, *primary, *secondary;
|
|
||||||
|
|
||||||
use_hires_reticle = (HIRESMODE != 0);
|
|
||||||
ofs = (use_hires_reticle?0:2);
|
|
||||||
|
|
||||||
PIGGY_PAGE_IN(Gauges[RETICLE_CROSS + cross_bm_num]);
|
|
||||||
cross = &GameBitmaps[Gauges[RETICLE_CROSS + cross_bm_num].index];
|
|
||||||
hud_bitblt_free(x+HUD_SCALE_X_AR(cross_offsets[ofs].x),y+HUD_SCALE_Y_AR(cross_offsets[ofs].y), HUD_SCALE_X_AR(cross->bm_w), HUD_SCALE_Y_AR(cross->bm_h), cross);
|
|
||||||
|
|
||||||
PIGGY_PAGE_IN(Gauges[RETICLE_PRIMARY + primary_bm_num]);
|
|
||||||
primary = &GameBitmaps[Gauges[RETICLE_PRIMARY + primary_bm_num].index];
|
|
||||||
hud_bitblt_free(x+HUD_SCALE_X_AR(primary_offsets[ofs].x),y+HUD_SCALE_Y_AR(primary_offsets[ofs].y), HUD_SCALE_X_AR(primary->bm_w), HUD_SCALE_Y_AR(primary->bm_h), primary);
|
|
||||||
|
|
||||||
PIGGY_PAGE_IN(Gauges[RETICLE_SECONDARY + secondary_bm_num]);
|
|
||||||
secondary = &GameBitmaps[Gauges[RETICLE_SECONDARY + secondary_bm_num].index];
|
|
||||||
hud_bitblt_free(x+HUD_SCALE_X_AR(secondary_offsets[ofs].x),y+HUD_SCALE_Y_AR(secondary_offsets[ofs].y), HUD_SCALE_X_AR(secondary->bm_w), HUD_SCALE_Y_AR(secondary->bm_h), secondary);
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifndef SHAREWARE
|
|
||||||
#ifdef NETWORK
|
|
||||||
if ((Newdemo_state == ND_STATE_PLAYBACK) || (((Game_mode & GM_MULTI_COOP) || (Game_mode & GM_TEAM)) && Show_reticle_name))
|
|
||||||
{
|
|
||||||
// Draw player callsign for player in sights
|
|
||||||
fvi_query fq;
|
|
||||||
vms_vector orient;
|
|
||||||
int Hit_type;
|
|
||||||
fvi_info Hit_data;
|
|
||||||
|
|
||||||
fq.p0 = &ConsoleObject->pos;
|
|
||||||
orient = ConsoleObject->orient.fvec;
|
|
||||||
vm_vec_scale(&orient, F1_0*1024);
|
|
||||||
vm_vec_add2(&orient, fq.p0);
|
|
||||||
fq.p1 = &orient;
|
|
||||||
fq.rad = 0;
|
|
||||||
fq.thisobjnum = ConsoleObject - Objects;
|
|
||||||
fq.flags = FQ_TRANSWALL | FQ_CHECK_OBJS;
|
|
||||||
fq.startseg = ConsoleObject->segnum;
|
|
||||||
fq.ignore_obj_list = NULL;
|
|
||||||
|
|
||||||
Hit_type = find_vector_intersection(&fq, &Hit_data);
|
|
||||||
if ((Hit_type == HIT_OBJECT) && (Objects[Hit_data.hit_object].type == OBJ_PLAYER))
|
|
||||||
{
|
|
||||||
// Draw callsign on HUD
|
|
||||||
char s[CALLSIGN_LEN+1];
|
|
||||||
int w, h, aw;
|
|
||||||
int x1, y1;
|
|
||||||
int pnum;
|
|
||||||
int color_num;
|
|
||||||
|
|
||||||
pnum = Objects[Hit_data.hit_object].id;
|
|
||||||
|
|
||||||
if ((Game_mode & GM_TEAM) && (get_team(pnum) != get_team(Player_num)) && (Newdemo_state != ND_STATE_PLAYBACK))
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (Game_mode & GM_TEAM)
|
|
||||||
color_num = get_team(pnum);
|
|
||||||
else
|
|
||||||
color_num = pnum;
|
|
||||||
sprintf(s, "%s", Players[pnum].callsign);
|
|
||||||
gr_get_string_size(s, &w, &h, &aw);
|
|
||||||
gr_set_fontcolor(BM_XRGB(player_rgb[color_num].r,player_rgb[color_num].g,player_rgb[color_num].b),-1 );
|
|
||||||
x1 = x-(w/2);
|
|
||||||
y1 = y+HUD_SCALE_Y(12);
|
|
||||||
gr_string (x1, y1, s);
|
|
||||||
}
|
}
|
||||||
#ifndef NDEBUG
|
case RET_TYPE_X:
|
||||||
else if ((Hit_type == HIT_OBJECT) && (Objects[Hit_data.hit_object].type == OBJ_ROBOT))
|
gr_uline(i2f(x-(size/2)), i2f(y-(size/2)), i2f(x-(size/5)), i2f(y-(size/5)));
|
||||||
{
|
gr_uline(i2f(x+(size/2)), i2f(y-(size/2)), i2f(x+(size/5)), i2f(y-(size/5)));
|
||||||
char s[CALLSIGN_LEN+1];
|
gr_uline(i2f(x-(size/2)), i2f(y+(size/2)), i2f(x-(size/5)), i2f(y+(size/5)));
|
||||||
int w, h, aw;
|
gr_uline(i2f(x+(size/2)), i2f(y+(size/2)), i2f(x+(size/5)), i2f(y+(size/5)));
|
||||||
int x1, y1;
|
break;
|
||||||
int color_num = 0;
|
case RET_TYPE_DOT:
|
||||||
|
gr_disk(i2f(x),i2f(y),i2f(size/4));
|
||||||
sprintf(s, "%d", Hit_data.hit_object);
|
break;
|
||||||
gr_get_string_size(s, &w, &h, &aw);
|
case RET_TYPE_CIRCLE:
|
||||||
gr_set_fontcolor(BM_XRGB(player_rgb[color_num].r,player_rgb[color_num].g,player_rgb[color_num].b),-1 );
|
gr_ucircle(i2f(x),i2f(y),i2f(size/4));
|
||||||
x1 = x-(w/2);
|
break;
|
||||||
y1 = y+(HUD_SCALE_Y(12));
|
case RET_TYPE_CROSS_V1:
|
||||||
gr_string (x1, y1, s);
|
gr_uline(i2f(x),i2f(y-(size/2)),i2f(x),i2f(y+(size/2)+1));
|
||||||
}
|
gr_uline(i2f(x-(size/2)),i2f(y),i2f(x+(size/2)+1),i2f(y));
|
||||||
#endif
|
break;
|
||||||
|
case RET_TYPE_CROSS_V2:
|
||||||
|
gr_uline(i2f(x), i2f(y-(size/2)), i2f(x), i2f(y-(size/6)));
|
||||||
|
gr_uline(i2f(x), i2f(y+(size/2)), i2f(x), i2f(y+(size/6)));
|
||||||
|
gr_uline(i2f(x-(size/2)), i2f(y), i2f(x-(size/6)), i2f(y));
|
||||||
|
gr_uline(i2f(x+(size/2)), i2f(y), i2f(x+(size/6)), i2f(y));
|
||||||
|
break;
|
||||||
|
case RET_TYPE_ANGLE:
|
||||||
|
gr_uline(i2f(x),i2f(y),i2f(x),i2f(y+(size/2)));
|
||||||
|
gr_uline(i2f(x),i2f(y),i2f(x+(size/2)),i2f(y));
|
||||||
|
break;
|
||||||
|
case RET_TYPE_NONE:
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
#endif
|
Gr_scanline_darkening_level = GR_FADE_LEVELS;
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void show_mousefs_reticle(int x, int y, int size)
|
void show_mousefs_indicator(int x, int y, int size)
|
||||||
{
|
{
|
||||||
int axscale = (MOUSEFS_DELTA_RANGE*2)/size, xaxpos = x+(Controls.raw_mouse_axis[0]/axscale), yaxpos = y+(Controls.raw_mouse_axis[1]/axscale), zaxpos = y+(Controls.raw_mouse_axis[2]/axscale);
|
int axscale = (MOUSEFS_DELTA_RANGE*2)/size, xaxpos = x+(Controls.raw_mouse_axis[0]/axscale), yaxpos = y+(Controls.raw_mouse_axis[1]/axscale), zaxpos = y+(Controls.raw_mouse_axis[2]/axscale);
|
||||||
|
|
||||||
gr_setcolor(BM_XRGB(0,31,0));
|
gr_setcolor(BM_XRGB(PlayerCfg.ReticleRGBA[0],PlayerCfg.ReticleRGBA[1],PlayerCfg.ReticleRGBA[2]));
|
||||||
gr_uline(i2f(xaxpos), i2f(y-(size/2)), i2f(xaxpos), i2f(y-(size/2)+(size/4)));
|
Gr_scanline_darkening_level = PlayerCfg.ReticleRGBA[3];
|
||||||
gr_uline(i2f(xaxpos), i2f(y+(size/2)), i2f(xaxpos), i2f(y+(size/2)-(size/4)));
|
gr_uline(i2f(xaxpos), i2f(y-(size/2)), i2f(xaxpos), i2f(y-(size/4)));
|
||||||
gr_uline(i2f(x-(size/2)), i2f(yaxpos), i2f(x-(size/2)+(size/4)), i2f(yaxpos));
|
gr_uline(i2f(xaxpos), i2f(y+(size/2)), i2f(xaxpos), i2f(y+(size/4)));
|
||||||
gr_uline(i2f(x+(size/2)), i2f(yaxpos), i2f(x+(size/2)-(size/4)), i2f(yaxpos));
|
gr_uline(i2f(x-(size/2)), i2f(yaxpos), i2f(x-(size/4)), i2f(yaxpos));
|
||||||
|
gr_uline(i2f(x+(size/2)), i2f(yaxpos), i2f(x+(size/4)), i2f(yaxpos));
|
||||||
gr_uline(i2f(x+(size/2)+HUD_SCALE_X_AR(2)), i2f(y), i2f(x+(size/2)+HUD_SCALE_X_AR(2)), i2f(zaxpos));
|
gr_uline(i2f(x+(size/2)+HUD_SCALE_X_AR(2)), i2f(y), i2f(x+(size/2)+HUD_SCALE_X_AR(2)), i2f(zaxpos));
|
||||||
|
Gr_scanline_darkening_level = GR_FADE_LEVELS;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef NETWORK
|
#ifdef NETWORK
|
||||||
|
@ -2209,6 +2185,76 @@ void hud_show_kill_list()
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
void show_HUD_names()
|
||||||
|
{
|
||||||
|
#ifdef NETWORK
|
||||||
|
int x = grd_curcanv->cv_bitmap.bm_w/2, y = grd_curcanv->cv_bitmap.bm_h/2;
|
||||||
|
|
||||||
|
if ((Newdemo_state == ND_STATE_PLAYBACK) || (((Game_mode & GM_MULTI_COOP) || (Game_mode & GM_TEAM)) && Show_reticle_name))
|
||||||
|
{
|
||||||
|
// Draw player callsign for player in sights
|
||||||
|
fvi_query fq;
|
||||||
|
vms_vector orient;
|
||||||
|
int Hit_type;
|
||||||
|
fvi_info Hit_data;
|
||||||
|
|
||||||
|
fq.p0 = &ConsoleObject->pos;
|
||||||
|
orient = ConsoleObject->orient.fvec;
|
||||||
|
vm_vec_scale(&orient, F1_0*1024);
|
||||||
|
vm_vec_add2(&orient, fq.p0);
|
||||||
|
fq.p1 = &orient;
|
||||||
|
fq.rad = 0;
|
||||||
|
fq.thisobjnum = ConsoleObject - Objects;
|
||||||
|
fq.flags = FQ_TRANSWALL | FQ_CHECK_OBJS;
|
||||||
|
fq.startseg = ConsoleObject->segnum;
|
||||||
|
fq.ignore_obj_list = NULL;
|
||||||
|
|
||||||
|
Hit_type = find_vector_intersection(&fq, &Hit_data);
|
||||||
|
if ((Hit_type == HIT_OBJECT) && (Objects[Hit_data.hit_object].type == OBJ_PLAYER))
|
||||||
|
{
|
||||||
|
// Draw callsign on HUD
|
||||||
|
char s[CALLSIGN_LEN+1];
|
||||||
|
int w, h, aw;
|
||||||
|
int x1, y1;
|
||||||
|
int pnum;
|
||||||
|
int color_num;
|
||||||
|
|
||||||
|
pnum = Objects[Hit_data.hit_object].id;
|
||||||
|
|
||||||
|
if ((Game_mode & GM_TEAM) && (get_team(pnum) != get_team(Player_num)) && (Newdemo_state != ND_STATE_PLAYBACK))
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (Game_mode & GM_TEAM)
|
||||||
|
color_num = get_team(pnum);
|
||||||
|
else
|
||||||
|
color_num = pnum;
|
||||||
|
sprintf(s, "%s", Players[pnum].callsign);
|
||||||
|
gr_get_string_size(s, &w, &h, &aw);
|
||||||
|
gr_set_fontcolor(BM_XRGB(player_rgb[color_num].r,player_rgb[color_num].g,player_rgb[color_num].b),-1 );
|
||||||
|
x1 = x-(w/2);
|
||||||
|
y1 = y+HUD_SCALE_Y(12);
|
||||||
|
gr_string (x1, y1, s);
|
||||||
|
}
|
||||||
|
#ifndef NDEBUG
|
||||||
|
else if ((Hit_type == HIT_OBJECT) && (Objects[Hit_data.hit_object].type == OBJ_ROBOT))
|
||||||
|
{
|
||||||
|
char s[CALLSIGN_LEN+1];
|
||||||
|
int w, h, aw;
|
||||||
|
int x1, y1;
|
||||||
|
int color_num = 0;
|
||||||
|
|
||||||
|
sprintf(s, "%d", Hit_data.hit_object);
|
||||||
|
gr_get_string_size(s, &w, &h, &aw);
|
||||||
|
gr_set_fontcolor(BM_XRGB(player_rgb[color_num].r,player_rgb[color_num].g,player_rgb[color_num].b),-1 );
|
||||||
|
x1 = x-(w/2);
|
||||||
|
y1 = y+(HUD_SCALE_Y(12));
|
||||||
|
gr_string (x1, y1, s);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
//draw all the things on the HUD
|
//draw all the things on the HUD
|
||||||
|
|
||||||
void draw_hud()
|
void draw_hud()
|
||||||
|
@ -2242,10 +2288,12 @@ void draw_hud()
|
||||||
show_time();
|
show_time();
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
if (PlayerCfg.CockpitMode[1] != CM_LETTERBOX && PlayerCfg.ReticleOn)
|
if (PlayerCfg.CockpitMode[1] != CM_LETTERBOX)
|
||||||
show_reticle();
|
show_reticle(PlayerCfg.ReticleType);
|
||||||
if (PlayerCfg.CockpitMode[1] != CM_LETTERBOX && Newdemo_state != ND_STATE_PLAYBACK && PlayerCfg.MouseFlightSim && PlayerCfg.MouseFSReticle)
|
if (PlayerCfg.CockpitMode[1] != CM_LETTERBOX && Newdemo_state != ND_STATE_PLAYBACK && PlayerCfg.MouseFlightSim && PlayerCfg.MouseFSIndicator)
|
||||||
show_mousefs_reticle(GWIDTH/2, GHEIGHT/2, GHEIGHT/4);
|
show_mousefs_indicator(GWIDTH/2, GHEIGHT/2, GHEIGHT/4);
|
||||||
|
|
||||||
|
show_HUD_names();
|
||||||
|
|
||||||
HUD_render_message_frame();
|
HUD_render_message_frame();
|
||||||
|
|
||||||
|
|
|
@ -43,7 +43,7 @@ void render_gauges(void);
|
||||||
void init_gauges(void);
|
void init_gauges(void);
|
||||||
void close_gauges(void);
|
void close_gauges(void);
|
||||||
void cockpit_decode_alpha(grs_bitmap *bm);
|
void cockpit_decode_alpha(grs_bitmap *bm);
|
||||||
void show_mousefs_reticle(int x, int y, int size);
|
void show_mousefs_indicator(int x, int y, int size);
|
||||||
extern void check_erase_message(void);
|
extern void check_erase_message(void);
|
||||||
|
|
||||||
extern void draw_hud(); //draw all the HUD stuff
|
extern void draw_hud(); //draw all the HUD stuff
|
||||||
|
@ -78,5 +78,21 @@ extern span weapon_window_left[],weapon_window_left_hires[],weapon_window_right[
|
||||||
#define WinBoxLeft (HIRESMODE?weapon_window_left_hires:weapon_window_left)
|
#define WinBoxLeft (HIRESMODE?weapon_window_left_hires:weapon_window_left)
|
||||||
#define WinBoxRight (HIRESMODE?weapon_window_right_hires:weapon_window_right)
|
#define WinBoxRight (HIRESMODE?weapon_window_right_hires:weapon_window_right)
|
||||||
|
|
||||||
|
// defines for the reticle(s)
|
||||||
|
#define RET_TYPE_CLASSIC 0
|
||||||
|
#define RET_TYPE_CLASSIC_REBOOT 1
|
||||||
|
#define RET_TYPE_NONE 2
|
||||||
|
#define RET_TYPE_X 3
|
||||||
|
#define RET_TYPE_DOT 4
|
||||||
|
#define RET_TYPE_CIRCLE 5
|
||||||
|
#define RET_TYPE_CROSS_V1 6
|
||||||
|
#define RET_TYPE_CROSS_V2 7
|
||||||
|
#define RET_TYPE_ANGLE 8
|
||||||
|
|
||||||
|
#define RET_COLOR_DEFAULT_R 0
|
||||||
|
#define RET_COLOR_DEFAULT_G 32
|
||||||
|
#define RET_COLOR_DEFAULT_B 0
|
||||||
|
#define RET_COLOR_DEFAULT_A 0
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
225
main/menu.c
225
main/menu.c
|
@ -858,7 +858,7 @@ int do_load_level_menu(void)
|
||||||
void do_sound_menu();
|
void do_sound_menu();
|
||||||
void input_config();
|
void input_config();
|
||||||
void change_res();
|
void change_res();
|
||||||
void do_graphics_menu();
|
void graphics_config();
|
||||||
void do_misc_menu();
|
void do_misc_menu();
|
||||||
|
|
||||||
int options_menuset(newmenu *menu, d_event *event, void *userdata)
|
int options_menuset(newmenu *menu, d_event *event, void *userdata)
|
||||||
|
@ -866,10 +866,6 @@ int options_menuset(newmenu *menu, d_event *event, void *userdata)
|
||||||
switch (event->type)
|
switch (event->type)
|
||||||
{
|
{
|
||||||
case EVENT_NEWMENU_CHANGED:
|
case EVENT_NEWMENU_CHANGED:
|
||||||
if ( newmenu_get_citem(menu)==4)
|
|
||||||
{
|
|
||||||
gr_palette_set_gamma(newmenu_get_items(menu)[4].value);
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case EVENT_NEWMENU_SELECTED:
|
case EVENT_NEWMENU_SELECTED:
|
||||||
|
@ -877,11 +873,11 @@ int options_menuset(newmenu *menu, d_event *event, void *userdata)
|
||||||
{
|
{
|
||||||
case 0: do_sound_menu(); break;
|
case 0: do_sound_menu(); break;
|
||||||
case 2: input_config(); break;
|
case 2: input_config(); break;
|
||||||
case 5: change_res(); break;
|
case 4: change_res(); break;
|
||||||
case 6: do_graphics_menu(); break;
|
case 5: graphics_config(); break;
|
||||||
case 8: ReorderPrimary(); break;
|
case 7: ReorderPrimary(); break;
|
||||||
case 9: ReorderSecondary(); break;
|
case 8: ReorderSecondary(); break;
|
||||||
case 10: do_misc_menu(); break;
|
case 9: do_misc_menu(); break;
|
||||||
}
|
}
|
||||||
return 1; // stay in menu until escape
|
return 1; // stay in menu until escape
|
||||||
break;
|
break;
|
||||||
|
@ -1071,7 +1067,7 @@ int input_config_menuset(newmenu *menu, d_event *event, void *userdata)
|
||||||
if (citem == opt_ic_grabinput)
|
if (citem == opt_ic_grabinput)
|
||||||
GameCfg.Grabinput = items[citem].value;
|
GameCfg.Grabinput = items[citem].value;
|
||||||
if (citem == opt_ic_mousefsgauge)
|
if (citem == opt_ic_mousefsgauge)
|
||||||
PlayerCfg.MouseFSReticle = items[citem].value;
|
PlayerCfg.MouseFSIndicator = items[citem].value;
|
||||||
if (citem == opt_ic_mousefilt)
|
if (citem == opt_ic_mousefilt)
|
||||||
PlayerCfg.MouseFilter = items[citem].value;
|
PlayerCfg.MouseFilter = items[citem].value;
|
||||||
break;
|
break;
|
||||||
|
@ -1133,7 +1129,7 @@ void input_config()
|
||||||
opt_ic_grabinput = nitems;
|
opt_ic_grabinput = nitems;
|
||||||
m[nitems].type = NM_TYPE_CHECK; m[nitems].text= "Keep Keyboard/Mouse focus"; m[nitems].value = GameCfg.Grabinput; nitems++;
|
m[nitems].type = NM_TYPE_CHECK; m[nitems].text= "Keep Keyboard/Mouse focus"; m[nitems].value = GameCfg.Grabinput; nitems++;
|
||||||
opt_ic_mousefsgauge = nitems;
|
opt_ic_mousefsgauge = nitems;
|
||||||
m[nitems].type = NM_TYPE_CHECK; m[nitems].text= "Mouse FlightSim Reticle"; m[nitems].value = PlayerCfg.MouseFSReticle; nitems++;
|
m[nitems].type = NM_TYPE_CHECK; m[nitems].text= "Mouse FlightSim Indicator"; m[nitems].value = PlayerCfg.MouseFSIndicator; nitems++;
|
||||||
opt_ic_mousefilt = nitems;
|
opt_ic_mousefilt = nitems;
|
||||||
m[nitems].type = NM_TYPE_CHECK; m[nitems].text= "Mouse Smoothing/Filtering"; m[nitems].value = PlayerCfg.MouseFilter; nitems++;
|
m[nitems].type = NM_TYPE_CHECK; m[nitems].text= "Mouse Smoothing/Filtering"; m[nitems].value = PlayerCfg.MouseFilter; nitems++;
|
||||||
m[nitems].type = NM_TYPE_TEXT; m[nitems].text = ""; nitems++;
|
m[nitems].type = NM_TYPE_TEXT; m[nitems].text = ""; nitems++;
|
||||||
|
@ -1147,39 +1143,140 @@ void input_config()
|
||||||
newmenu_do1(NULL, TXT_CONTROLS, nitems, m, input_config_menuset, NULL, 3);
|
newmenu_do1(NULL, TXT_CONTROLS, nitems, m, input_config_menuset, NULL, 3);
|
||||||
}
|
}
|
||||||
|
|
||||||
void do_graphics_menu()
|
void reticle_config()
|
||||||
{
|
{
|
||||||
newmenu_item m[9];
|
#ifdef OGL
|
||||||
int i = 0, j = 0;
|
newmenu_item m[18];
|
||||||
|
#else
|
||||||
|
newmenu_item m[17];
|
||||||
|
#endif
|
||||||
|
int nitems = 0, i, opt_ret_type, opt_ret_rgba, opt_ret_size;
|
||||||
|
|
||||||
do {
|
m[nitems].type = NM_TYPE_TEXT; m[nitems].text = "Reticle Type:"; nitems++;
|
||||||
m[0].type = NM_TYPE_TEXT; m[0].text="Texture Filtering (restart required):";
|
opt_ret_type = nitems;
|
||||||
m[1].type = NM_TYPE_RADIO; m[1].text = "None (Classical)"; m[1].value = 0; m[1].group = 0;
|
m[nitems].type = NM_TYPE_RADIO; m[nitems].text = "Classic"; m[nitems].value = 0; m[nitems].group = 0; nitems++;
|
||||||
m[2].type = NM_TYPE_RADIO; m[2].text = "Bilinear"; m[2].value = 0; m[2].group = 0;
|
#ifdef OGL
|
||||||
m[3].type = NM_TYPE_RADIO; m[3].text = "Trilinear"; m[3].value = 0; m[3].group = 0;
|
m[nitems].type = NM_TYPE_RADIO; m[nitems].text = "Classic Reboot"; m[nitems].value = 0; m[nitems].group = 0; nitems++;
|
||||||
m[4].type = NM_TYPE_TEXT; m[4].text="";
|
#endif
|
||||||
m[5].type = NM_TYPE_CHECK; m[5].text="Transparency Effects"; m[5].value = PlayerCfg.OglAlphaEffects;
|
m[nitems].type = NM_TYPE_RADIO; m[nitems].text = "None"; m[nitems].value = 0; m[nitems].group = 0; nitems++;
|
||||||
m[6].type = NM_TYPE_CHECK; m[6].text="Vectorial Reticle"; m[6].value = PlayerCfg.OglReticle;
|
m[nitems].type = NM_TYPE_RADIO; m[nitems].text = "X"; m[nitems].value = 0; m[nitems].group = 0; nitems++;
|
||||||
m[7].type = NM_TYPE_CHECK; m[7].text="VSync"; m[7].value = GameCfg.VSync;
|
m[nitems].type = NM_TYPE_RADIO; m[nitems].text = "Dot"; m[nitems].value = 0; m[nitems].group = 0; nitems++;
|
||||||
m[8].type = NM_TYPE_CHECK; m[8].text="4x multisampling"; m[8].value = GameCfg.Multisample;
|
m[nitems].type = NM_TYPE_RADIO; m[nitems].text = "Circle"; m[nitems].value = 0; m[nitems].group = 0; nitems++;
|
||||||
|
m[nitems].type = NM_TYPE_RADIO; m[nitems].text = "Cross V1"; m[nitems].value = 0; m[nitems].group = 0; nitems++;
|
||||||
|
m[nitems].type = NM_TYPE_RADIO; m[nitems].text = "Cross V2"; m[nitems].value = 0; m[nitems].group = 0; nitems++;
|
||||||
|
m[nitems].type = NM_TYPE_RADIO; m[nitems].text = "Angle"; m[nitems].value = 0; m[nitems].group = 0; nitems++;
|
||||||
|
m[nitems].type = NM_TYPE_TEXT; m[nitems].text = ""; nitems++;
|
||||||
|
m[nitems].type = NM_TYPE_TEXT; m[nitems].text = "Reticle Color:"; nitems++;
|
||||||
|
opt_ret_rgba = nitems;
|
||||||
|
m[nitems].type = NM_TYPE_SLIDER; m[nitems].text = "Red"; m[nitems].value = (PlayerCfg.ReticleRGBA[0]/2); m[nitems].min_value = 0; m[nitems].max_value = 16; nitems++;
|
||||||
|
m[nitems].type = NM_TYPE_SLIDER; m[nitems].text = "Green"; m[nitems].value = (PlayerCfg.ReticleRGBA[1]/2); m[nitems].min_value = 0; m[nitems].max_value = 16; nitems++;
|
||||||
|
m[nitems].type = NM_TYPE_SLIDER; m[nitems].text = "Blue"; m[nitems].value = (PlayerCfg.ReticleRGBA[2]/2); m[nitems].min_value = 0; m[nitems].max_value = 16; nitems++;
|
||||||
|
m[nitems].type = NM_TYPE_SLIDER; m[nitems].text = "Alpha"; m[nitems].value = (PlayerCfg.ReticleRGBA[3]/2); m[nitems].min_value = 0; m[nitems].max_value = 16; nitems++;
|
||||||
|
m[nitems].type = NM_TYPE_TEXT; m[nitems].text = ""; nitems++;
|
||||||
|
opt_ret_size = nitems;
|
||||||
|
m[nitems].type = NM_TYPE_SLIDER; m[nitems].text = "Reticle Size:"; m[nitems].value = PlayerCfg.ReticleSize; m[nitems].min_value = 0; m[nitems].max_value = 4; nitems++;
|
||||||
|
|
||||||
m[GameCfg.TexFilt+1].value=1;
|
i = PlayerCfg.ReticleType;
|
||||||
|
#ifndef OGL
|
||||||
|
if (i > 1) i--;
|
||||||
|
#endif
|
||||||
|
m[opt_ret_type+i].value=1;
|
||||||
|
|
||||||
i = newmenu_do1( NULL, "Graphics Options", sizeof(m)/sizeof(*m), m, NULL, NULL, i );
|
newmenu_do1( NULL, "Reticle Options", nitems, m, NULL, NULL, 1 );
|
||||||
|
|
||||||
if (GameCfg.VSync != m[7].value || GameCfg.Multisample != m[8].value)
|
#ifdef OGL
|
||||||
nm_messagebox( NULL, 1, TXT_OK, "To apply VSync or 4x Multisample\nyou need to restart the program");
|
for (i = 0; i < 9; i++)
|
||||||
|
if (m[i+opt_ret_type].value)
|
||||||
|
PlayerCfg.ReticleType = i;
|
||||||
|
#else
|
||||||
|
for (i = 0; i < 8; i++)
|
||||||
|
if (m[i+opt_ret_type].value)
|
||||||
|
PlayerCfg.ReticleType = i;
|
||||||
|
if (PlayerCfg.ReticleType > 1) PlayerCfg.ReticleType++;
|
||||||
|
#endif
|
||||||
|
for (i = 0; i < 4; i++)
|
||||||
|
PlayerCfg.ReticleRGBA[i] = (m[i+opt_ret_rgba].value*2);
|
||||||
|
PlayerCfg.ReticleSize = m[opt_ret_size].value;
|
||||||
|
}
|
||||||
|
|
||||||
for (j = 0; j <= 2; j++)
|
int opt_gr_texfilt, opt_gr_brightness, opt_gr_reticlemenu, opt_gr_alphafx, opt_gr_vsync, opt_gr_multisample;
|
||||||
if (m[j+1].value)
|
int graphics_config_menuset(newmenu *menu, d_event *event, void *userdata)
|
||||||
GameCfg.TexFilt = j;
|
{
|
||||||
PlayerCfg.OglAlphaEffects = m[5].value;
|
newmenu_item *items = newmenu_get_items(menu);
|
||||||
PlayerCfg.OglReticle = m[6].value;
|
int citem = newmenu_get_citem(menu);
|
||||||
GameCfg.VSync = m[7].value;
|
|
||||||
GameCfg.Multisample = m[8].value;
|
userdata = userdata;
|
||||||
gr_set_attributes();
|
|
||||||
gr_set_mode(Game_screen_mode);
|
switch (event->type)
|
||||||
} while( i>-1 );
|
{
|
||||||
|
case EVENT_NEWMENU_CHANGED:
|
||||||
|
if ( citem == opt_gr_brightness)
|
||||||
|
gr_palette_set_gamma(items[citem].value);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case EVENT_NEWMENU_SELECTED:
|
||||||
|
if (citem == opt_gr_reticlemenu)
|
||||||
|
reticle_config();
|
||||||
|
return 1; // stay in menu
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
void graphics_config()
|
||||||
|
{
|
||||||
|
#ifdef OGL
|
||||||
|
newmenu_item m[11];
|
||||||
|
#else
|
||||||
|
newmenu_item m[2];
|
||||||
|
#endif
|
||||||
|
int nitems = 0, i = 0;
|
||||||
|
|
||||||
|
#ifdef OGL
|
||||||
|
m[nitems].type = NM_TYPE_TEXT; m[nitems].text = "Texture Filtering (restart required):"; nitems++;
|
||||||
|
opt_gr_texfilt = nitems;
|
||||||
|
m[nitems].type = NM_TYPE_RADIO; m[nitems].text = "None (Classical)"; m[nitems].value = 0; m[nitems].group = 0; nitems++;
|
||||||
|
m[nitems].type = NM_TYPE_RADIO; m[nitems].text = "Bilinear"; m[nitems].value = 0; m[nitems].group = 0; nitems++;
|
||||||
|
m[nitems].type = NM_TYPE_RADIO; m[nitems].text = "Trilinear"; m[nitems].value = 0; m[nitems].group = 0; nitems++;
|
||||||
|
m[nitems].type = NM_TYPE_TEXT; m[nitems].text = ""; nitems++;
|
||||||
|
#endif
|
||||||
|
opt_gr_brightness = nitems;
|
||||||
|
m[nitems].type = NM_TYPE_SLIDER; m[nitems].text = TXT_BRIGHTNESS; m[nitems].value = gr_palette_get_gamma(); m[nitems].min_value = 0; m[nitems].max_value = 16; nitems++;
|
||||||
|
opt_gr_reticlemenu = nitems;
|
||||||
|
m[nitems].type = NM_TYPE_MENU; m[nitems].text = "Reticle Options"; nitems++;
|
||||||
|
#ifdef OGL
|
||||||
|
opt_gr_alphafx = nitems;
|
||||||
|
m[nitems].type = NM_TYPE_CHECK; m[nitems].text = "Transparency Effects"; m[nitems].value = PlayerCfg.OglAlphaEffects; nitems++;
|
||||||
|
opt_gr_vsync = nitems;
|
||||||
|
m[nitems].type = NM_TYPE_CHECK; m[nitems].text="VSync"; m[nitems].value = GameCfg.VSync; nitems++;
|
||||||
|
opt_gr_multisample = nitems;
|
||||||
|
m[nitems].type = NM_TYPE_CHECK; m[nitems].text="4x multisampling"; m[nitems].value = GameCfg.Multisample; nitems++;
|
||||||
|
|
||||||
|
m[opt_gr_texfilt+GameCfg.TexFilt].value=1;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
newmenu_do1( NULL, "Graphics Options", nitems, m, graphics_config_menuset, NULL, 1 );
|
||||||
|
|
||||||
|
#ifdef OGL
|
||||||
|
if (GameCfg.VSync != m[opt_gr_vsync].value || GameCfg.Multisample != m[opt_gr_multisample].value)
|
||||||
|
nm_messagebox( NULL, 1, TXT_OK, "To apply VSync or 4x Multisample\nyou need to restart the program");
|
||||||
|
|
||||||
|
for (i = 0; i <= 2; i++)
|
||||||
|
if (m[i+opt_gr_texfilt].value)
|
||||||
|
GameCfg.TexFilt = i;
|
||||||
|
PlayerCfg.OglAlphaEffects = m[opt_gr_alphafx].value;
|
||||||
|
GameCfg.VSync = m[opt_gr_vsync].value;
|
||||||
|
GameCfg.Multisample = m[opt_gr_multisample].value;
|
||||||
|
#endif
|
||||||
|
GameCfg.GammaLevel = m[opt_gr_brightness].value;
|
||||||
|
#ifdef OGL
|
||||||
|
gr_set_attributes();
|
||||||
|
gr_set_mode(Game_screen_mode);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
#if PHYSFS_VER_MAJOR >= 2
|
#if PHYSFS_VER_MAJOR >= 2
|
||||||
|
@ -1750,27 +1847,25 @@ void do_sound_menu()
|
||||||
|
|
||||||
void do_misc_menu()
|
void do_misc_menu()
|
||||||
{
|
{
|
||||||
newmenu_item m[7];
|
newmenu_item m[6];
|
||||||
int i = 0;
|
int i = 0;
|
||||||
|
|
||||||
do {
|
do {
|
||||||
ADD_CHECK(0, "Ship auto-leveling", PlayerCfg.AutoLeveling);
|
ADD_CHECK(0, "Ship auto-leveling", PlayerCfg.AutoLeveling);
|
||||||
ADD_CHECK(1, "Show reticle", PlayerCfg.ReticleOn);
|
ADD_CHECK(1, "Persistent Debris",PlayerCfg.PersistentDebris);
|
||||||
ADD_CHECK(2, "Persistent Debris",PlayerCfg.PersistentDebris);
|
ADD_CHECK(2, "Screenshots w/o HUD",PlayerCfg.PRShot);
|
||||||
ADD_CHECK(3, "Screenshots w/o HUD",PlayerCfg.PRShot);
|
ADD_CHECK(3, "Disable redundant pickup messages",PlayerCfg.NoRedundancy);
|
||||||
ADD_CHECK(4, "Disable redundant pickup messages",PlayerCfg.NoRedundancy);
|
ADD_CHECK(4, "Only show Player msgs in Multipl.",PlayerCfg.MultiMessages);
|
||||||
ADD_CHECK(5, "Only show Player msgs in Multipl.",PlayerCfg.MultiMessages);
|
ADD_CHECK(5, "Show D2-style Prox. Bomb Gauge",PlayerCfg.BombGauge);
|
||||||
ADD_CHECK(6, "Show D2-style Prox. Bomb Gauge",PlayerCfg.BombGauge);
|
|
||||||
|
|
||||||
i = newmenu_do1( NULL, "Misc Options", sizeof(m)/sizeof(*m), m, NULL, NULL, i );
|
i = newmenu_do1( NULL, "Misc Options", sizeof(m)/sizeof(*m), m, NULL, NULL, i );
|
||||||
|
|
||||||
PlayerCfg.AutoLeveling = m[0].value;
|
PlayerCfg.AutoLeveling = m[0].value;
|
||||||
PlayerCfg.ReticleOn = m[1].value;
|
PlayerCfg.PersistentDebris = m[1].value;
|
||||||
PlayerCfg.PersistentDebris = m[2].value;
|
PlayerCfg.PRShot = m[2].value;
|
||||||
PlayerCfg.PRShot = m[3].value;
|
PlayerCfg.NoRedundancy = m[3].value;
|
||||||
PlayerCfg.NoRedundancy = m[4].value;
|
PlayerCfg.MultiMessages = m[4].value;
|
||||||
PlayerCfg.MultiMessages = m[5].value;
|
PlayerCfg.BombGauge = m[5].value;
|
||||||
PlayerCfg.BombGauge = m[6].value;
|
|
||||||
|
|
||||||
} while( i>-1 );
|
} while( i>-1 );
|
||||||
|
|
||||||
|
@ -1845,7 +1940,7 @@ void do_options_menu()
|
||||||
{
|
{
|
||||||
newmenu_item *m;
|
newmenu_item *m;
|
||||||
|
|
||||||
MALLOC(m, newmenu_item, 11);
|
MALLOC(m, newmenu_item, 10);
|
||||||
if (!m)
|
if (!m)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@ -1853,26 +1948,14 @@ void do_options_menu()
|
||||||
m[ 1].type = NM_TYPE_TEXT; m[ 1].text="";
|
m[ 1].type = NM_TYPE_TEXT; m[ 1].text="";
|
||||||
m[ 2].type = NM_TYPE_MENU; m[ 2].text=TXT_CONTROLS_;
|
m[ 2].type = NM_TYPE_MENU; m[ 2].text=TXT_CONTROLS_;
|
||||||
m[ 3].type = NM_TYPE_TEXT; m[ 3].text="";
|
m[ 3].type = NM_TYPE_TEXT; m[ 3].text="";
|
||||||
|
m[ 4].type = NM_TYPE_MENU; m[ 4].text="Screen resolution...";
|
||||||
m[ 4].type = NM_TYPE_SLIDER;
|
m[ 5].type = NM_TYPE_MENU; m[ 5].text="Graphics Options...";
|
||||||
m[ 4].text = TXT_BRIGHTNESS;
|
|
||||||
m[ 4].value = gr_palette_get_gamma();
|
|
||||||
m[ 4].min_value = 0;
|
|
||||||
m[ 4].max_value = 16;
|
|
||||||
|
|
||||||
m[ 5].type = NM_TYPE_MENU; m[ 5].text="Screen resolution...";
|
|
||||||
#ifdef OGL
|
|
||||||
m[ 6].type = NM_TYPE_MENU; m[ 6].text="Graphics Options...";
|
|
||||||
#else
|
|
||||||
m[ 6].type = NM_TYPE_TEXT; m[ 6].text="";
|
m[ 6].type = NM_TYPE_TEXT; m[ 6].text="";
|
||||||
#endif
|
m[ 7].type = NM_TYPE_MENU; m[ 7].text="Primary autoselect ordering...";
|
||||||
|
m[ 8].type = NM_TYPE_MENU; m[ 8].text="Secondary autoselect ordering...";
|
||||||
m[ 7].type = NM_TYPE_TEXT; m[ 7].text="";
|
m[ 9].type = NM_TYPE_MENU; m[ 9].text="Misc Options...";
|
||||||
m[ 8].type = NM_TYPE_MENU; m[ 8].text="Primary autoselect ordering...";
|
|
||||||
m[ 9].type = NM_TYPE_MENU; m[ 9].text="Secondary autoselect ordering...";
|
|
||||||
m[10].type = NM_TYPE_MENU; m[10].text="Misc Options...";
|
|
||||||
|
|
||||||
// Fall back to main event loop
|
// Fall back to main event loop
|
||||||
// Allows clean closing and re-opening when resolution changes
|
// Allows clean closing and re-opening when resolution changes
|
||||||
newmenu_do3( NULL, TXT_OPTIONS, 11, m, options_menuset, NULL, 0, NULL );
|
newmenu_do3( NULL, TXT_OPTIONS, 10, m, options_menuset, NULL, 0, NULL );
|
||||||
}
|
}
|
||||||
|
|
|
@ -41,6 +41,7 @@ COPYRIGHT 1993-1998 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED.
|
||||||
#include "byteswap.h"
|
#include "byteswap.h"
|
||||||
#include "physfsx.h"
|
#include "physfsx.h"
|
||||||
#include "newdemo.h"
|
#include "newdemo.h"
|
||||||
|
#include "gauges.h"
|
||||||
|
|
||||||
//version 5 -> 6: added new highest level information
|
//version 5 -> 6: added new highest level information
|
||||||
//version 6 -> 7: stripped out the old saved_game array.
|
//version 6 -> 7: stripped out the old saved_game array.
|
||||||
|
@ -80,10 +81,12 @@ int new_player_config()
|
||||||
PlayerCfg.MouseFlightSim = 0;
|
PlayerCfg.MouseFlightSim = 0;
|
||||||
PlayerCfg.MouseSens[0] = PlayerCfg.MouseSens[1] = PlayerCfg.MouseSens[2] = PlayerCfg.MouseSens[3] = PlayerCfg.MouseSens[4] = 8;
|
PlayerCfg.MouseSens[0] = PlayerCfg.MouseSens[1] = PlayerCfg.MouseSens[2] = PlayerCfg.MouseSens[3] = PlayerCfg.MouseSens[4] = 8;
|
||||||
PlayerCfg.MouseFSDead = 0;
|
PlayerCfg.MouseFSDead = 0;
|
||||||
PlayerCfg.MouseFSReticle = 1;
|
PlayerCfg.MouseFSIndicator = 1;
|
||||||
PlayerCfg.MouseFilter = 0;
|
PlayerCfg.MouseFilter = 0;
|
||||||
PlayerCfg.CockpitMode[0] = PlayerCfg.CockpitMode[1] = CM_FULL_COCKPIT;
|
PlayerCfg.CockpitMode[0] = PlayerCfg.CockpitMode[1] = CM_FULL_COCKPIT;
|
||||||
PlayerCfg.ReticleOn = 1;
|
PlayerCfg.ReticleType = RET_TYPE_CLASSIC;
|
||||||
|
PlayerCfg.ReticleRGBA[0] = RET_COLOR_DEFAULT_R; PlayerCfg.ReticleRGBA[1] = RET_COLOR_DEFAULT_G; PlayerCfg.ReticleRGBA[2] = RET_COLOR_DEFAULT_B; PlayerCfg.ReticleRGBA[3] = RET_COLOR_DEFAULT_A;
|
||||||
|
PlayerCfg.ReticleSize = 1;
|
||||||
PlayerCfg.HudMode = 0;
|
PlayerCfg.HudMode = 0;
|
||||||
PlayerCfg.PersistentDebris = 0;
|
PlayerCfg.PersistentDebris = 0;
|
||||||
PlayerCfg.PRShot = 0;
|
PlayerCfg.PRShot = 0;
|
||||||
|
@ -91,7 +94,6 @@ int new_player_config()
|
||||||
PlayerCfg.MultiMessages = 0;
|
PlayerCfg.MultiMessages = 0;
|
||||||
PlayerCfg.BombGauge = 1;
|
PlayerCfg.BombGauge = 1;
|
||||||
PlayerCfg.OglAlphaEffects = 0;
|
PlayerCfg.OglAlphaEffects = 0;
|
||||||
PlayerCfg.OglReticle = 0;
|
|
||||||
|
|
||||||
// Default taunt macros
|
// Default taunt macros
|
||||||
#ifdef NETWORK
|
#ifdef NETWORK
|
||||||
|
@ -207,8 +209,8 @@ int read_player_d1x(char *filename)
|
||||||
PlayerCfg.MouseSens[4] = atoi(line);
|
PlayerCfg.MouseSens[4] = atoi(line);
|
||||||
if(!strcmp(word,"FSDEAD"))
|
if(!strcmp(word,"FSDEAD"))
|
||||||
PlayerCfg.MouseFSDead = atoi(line);
|
PlayerCfg.MouseFSDead = atoi(line);
|
||||||
if(!strcmp(word,"FSGAUGE"))
|
if(!strcmp(word,"FSINDI"))
|
||||||
PlayerCfg.MouseFSReticle = atoi(line);
|
PlayerCfg.MouseFSIndicator = atoi(line);
|
||||||
if(!strcmp(word,"FILTER"))
|
if(!strcmp(word,"FILTER"))
|
||||||
PlayerCfg.MouseFilter = atoi(line);
|
PlayerCfg.MouseFilter = atoi(line);
|
||||||
d_free(word);
|
d_free(word);
|
||||||
|
@ -254,6 +256,12 @@ int read_player_d1x(char *filename)
|
||||||
PlayerCfg.CockpitMode[0] = PlayerCfg.CockpitMode[1] = atoi(line);
|
PlayerCfg.CockpitMode[0] = PlayerCfg.CockpitMode[1] = atoi(line);
|
||||||
else if(!strcmp(word,"HUD"))
|
else if(!strcmp(word,"HUD"))
|
||||||
PlayerCfg.HudMode = atoi(line);
|
PlayerCfg.HudMode = atoi(line);
|
||||||
|
else if(!strcmp(word,"RETTYPE"))
|
||||||
|
PlayerCfg.ReticleType = atoi(line);
|
||||||
|
else if(!strcmp(word,"RETRGBA"))
|
||||||
|
sscanf(line,"%i,%i,%i,%i",&PlayerCfg.ReticleRGBA[0],&PlayerCfg.ReticleRGBA[1],&PlayerCfg.ReticleRGBA[2],&PlayerCfg.ReticleRGBA[3]);
|
||||||
|
else if(!strcmp(word,"RETSIZE"))
|
||||||
|
PlayerCfg.ReticleSize = atoi(line);
|
||||||
d_free(word);
|
d_free(word);
|
||||||
cfgets(line,50,f);
|
cfgets(line,50,f);
|
||||||
word=splitword(line,'=');
|
word=splitword(line,'=');
|
||||||
|
@ -269,11 +277,9 @@ int read_player_d1x(char *filename)
|
||||||
|
|
||||||
while(!strstr(word,"END") && !PHYSFS_eof(f))
|
while(!strstr(word,"END") && !PHYSFS_eof(f))
|
||||||
{
|
{
|
||||||
if(!strcmp(word,"RETICLE"))
|
if(!strcmp(word,"PERSISTENTDEBRIS"))
|
||||||
PlayerCfg.ReticleOn = atoi(line);
|
|
||||||
else if(!strcmp(word,"PERSISTENTDEBRIS"))
|
|
||||||
PlayerCfg.PersistentDebris = atoi(line);
|
PlayerCfg.PersistentDebris = atoi(line);
|
||||||
else if(!strcmp(word,"PRSHOT"))
|
if(!strcmp(word,"PRSHOT"))
|
||||||
PlayerCfg.PRShot = atoi(line);
|
PlayerCfg.PRShot = atoi(line);
|
||||||
if(!strcmp(word,"NOREDUNDANCY"))
|
if(!strcmp(word,"NOREDUNDANCY"))
|
||||||
PlayerCfg.NoRedundancy = atoi(line);
|
PlayerCfg.NoRedundancy = atoi(line);
|
||||||
|
@ -298,8 +304,6 @@ int read_player_d1x(char *filename)
|
||||||
{
|
{
|
||||||
if(!strcmp(word,"OGLALPHAEFFECTS"))
|
if(!strcmp(word,"OGLALPHAEFFECTS"))
|
||||||
PlayerCfg.OglAlphaEffects = atoi(line);
|
PlayerCfg.OglAlphaEffects = atoi(line);
|
||||||
else if(!strcmp(word,"OGLRETICLE"))
|
|
||||||
PlayerCfg.OglReticle = atoi(line);
|
|
||||||
d_free(word);
|
d_free(word);
|
||||||
cfgets(line,50,f);
|
cfgets(line,50,f);
|
||||||
word=splitword(line,'=');
|
word=splitword(line,'=');
|
||||||
|
@ -541,7 +545,7 @@ int write_player_d1x(char *filename)
|
||||||
PHYSFSX_printf(fout,"sensitivity3=%d\n",PlayerCfg.MouseSens[3]);
|
PHYSFSX_printf(fout,"sensitivity3=%d\n",PlayerCfg.MouseSens[3]);
|
||||||
PHYSFSX_printf(fout,"sensitivity4=%d\n",PlayerCfg.MouseSens[4]);
|
PHYSFSX_printf(fout,"sensitivity4=%d\n",PlayerCfg.MouseSens[4]);
|
||||||
PHYSFSX_printf(fout,"fsdead=%d\n",PlayerCfg.MouseFSDead);
|
PHYSFSX_printf(fout,"fsdead=%d\n",PlayerCfg.MouseFSDead);
|
||||||
PHYSFSX_printf(fout,"fsgauge=%d\n",PlayerCfg.MouseFSReticle);
|
PHYSFSX_printf(fout,"fsindi=%d\n",PlayerCfg.MouseFSIndicator);
|
||||||
PHYSFSX_printf(fout,"filter=%d\n",PlayerCfg.MouseFilter);
|
PHYSFSX_printf(fout,"filter=%d\n",PlayerCfg.MouseFilter);
|
||||||
PHYSFSX_printf(fout,"[end]\n");
|
PHYSFSX_printf(fout,"[end]\n");
|
||||||
PHYSFSX_printf(fout,"[weapon keys v2]\n");
|
PHYSFSX_printf(fout,"[weapon keys v2]\n");
|
||||||
|
@ -559,9 +563,11 @@ int write_player_d1x(char *filename)
|
||||||
PHYSFSX_printf(fout,"[cockpit]\n");
|
PHYSFSX_printf(fout,"[cockpit]\n");
|
||||||
PHYSFSX_printf(fout,"mode=%i\n",PlayerCfg.CockpitMode[0]);
|
PHYSFSX_printf(fout,"mode=%i\n",PlayerCfg.CockpitMode[0]);
|
||||||
PHYSFSX_printf(fout,"hud=%i\n",PlayerCfg.HudMode);
|
PHYSFSX_printf(fout,"hud=%i\n",PlayerCfg.HudMode);
|
||||||
|
PHYSFSX_printf(fout,"rettype=%i\n",PlayerCfg.ReticleType);
|
||||||
|
PHYSFSX_printf(fout,"retrgba=%i,%i,%i,%i\n",PlayerCfg.ReticleRGBA[0],PlayerCfg.ReticleRGBA[1],PlayerCfg.ReticleRGBA[2],PlayerCfg.ReticleRGBA[3]);
|
||||||
|
PHYSFSX_printf(fout,"retsize=%i\n",PlayerCfg.ReticleSize);
|
||||||
PHYSFSX_printf(fout,"[end]\n");
|
PHYSFSX_printf(fout,"[end]\n");
|
||||||
PHYSFSX_printf(fout,"[toggles]\n");
|
PHYSFSX_printf(fout,"[toggles]\n");
|
||||||
PHYSFSX_printf(fout,"reticle=%i\n",PlayerCfg.ReticleOn);
|
|
||||||
PHYSFSX_printf(fout,"persistentdebris=%i\n",PlayerCfg.PersistentDebris);
|
PHYSFSX_printf(fout,"persistentdebris=%i\n",PlayerCfg.PersistentDebris);
|
||||||
PHYSFSX_printf(fout,"prshot=%i\n",PlayerCfg.PRShot);
|
PHYSFSX_printf(fout,"prshot=%i\n",PlayerCfg.PRShot);
|
||||||
PHYSFSX_printf(fout,"noredundancy=%i\n",PlayerCfg.NoRedundancy);
|
PHYSFSX_printf(fout,"noredundancy=%i\n",PlayerCfg.NoRedundancy);
|
||||||
|
@ -570,7 +576,6 @@ int write_player_d1x(char *filename)
|
||||||
PHYSFSX_printf(fout,"[end]\n");
|
PHYSFSX_printf(fout,"[end]\n");
|
||||||
PHYSFSX_printf(fout,"[opengl]\n");
|
PHYSFSX_printf(fout,"[opengl]\n");
|
||||||
PHYSFSX_printf(fout,"oglalphaeffects=%i\n",PlayerCfg.OglAlphaEffects);
|
PHYSFSX_printf(fout,"oglalphaeffects=%i\n",PlayerCfg.OglAlphaEffects);
|
||||||
PHYSFSX_printf(fout,"oglreticle=%i\n",PlayerCfg.OglReticle);
|
|
||||||
PHYSFSX_printf(fout,"[end]\n");
|
PHYSFSX_printf(fout,"[end]\n");
|
||||||
PHYSFSX_printf(fout,"[plx version]\n");
|
PHYSFSX_printf(fout,"[plx version]\n");
|
||||||
PHYSFSX_printf(fout,"plx version=%s\n",VERSION);
|
PHYSFSX_printf(fout,"plx version=%s\n",VERSION);
|
||||||
|
|
|
@ -64,13 +64,15 @@ typedef struct player_config
|
||||||
ubyte MouseFlightSim;
|
ubyte MouseFlightSim;
|
||||||
int MouseSens[5];
|
int MouseSens[5];
|
||||||
int MouseFSDead;
|
int MouseFSDead;
|
||||||
int MouseFSReticle;
|
int MouseFSIndicator;
|
||||||
int MouseFilter;
|
int MouseFilter;
|
||||||
int CockpitMode[2]; // 0 saves the "real" cockpit, 1 also saves letterbox and rear. Used to properly switch between modes and restore the real one.
|
int CockpitMode[2]; // 0 saves the "real" cockpit, 1 also saves letterbox and rear. Used to properly switch between modes and restore the real one.
|
||||||
char NetworkMessageMacro[4][MAX_MESSAGE_LEN];
|
char NetworkMessageMacro[4][MAX_MESSAGE_LEN];
|
||||||
int NetlifeKills;
|
int NetlifeKills;
|
||||||
int NetlifeKilled;
|
int NetlifeKilled;
|
||||||
ubyte ReticleOn;
|
ubyte ReticleType;
|
||||||
|
int ReticleRGBA[4];
|
||||||
|
int ReticleSize;
|
||||||
int HudMode;
|
int HudMode;
|
||||||
int PersistentDebris;
|
int PersistentDebris;
|
||||||
int PRShot;
|
int PRShot;
|
||||||
|
@ -78,7 +80,6 @@ typedef struct player_config
|
||||||
ubyte MultiMessages;
|
ubyte MultiMessages;
|
||||||
ubyte BombGauge;
|
ubyte BombGauge;
|
||||||
int OglAlphaEffects;
|
int OglAlphaEffects;
|
||||||
int OglReticle;
|
|
||||||
} __pack__ player_config;
|
} __pack__ player_config;
|
||||||
|
|
||||||
extern struct player_config PlayerCfg;
|
extern struct player_config PlayerCfg;
|
||||||
|
|
Loading…
Reference in a new issue