Added FPS/UnrealEd-style right-mouse camera navigation to the camera view, with configurable movement keys, mouse look, modifier movement, Caps Lock speed scaling, and mouse-wheel zoom.

Added camera-view helper tools from the list, including reticle drawing, quick select during nav mode, teleport-to-looked-at-object, target lock/orbit mode, and entity/material info display.
Added nav-mode texture adjustment controls for position, scale, and rotation, and fixed the existing Alt texture-drag condition so Alt+Shift and Alt+Ctrl can actually trigger scale/rotate behavior.
Added widescreen support.
Changed up the menus and UI for build.
This commit is contained in:
Justin Marshall
2026-05-04 08:45:25 -07:00
parent 1a7a463c80
commit 6a21513a54
32 changed files with 1381 additions and 81 deletions
+2 -2
View File
@@ -32,8 +32,8 @@ If you have questions concerning this license or the applicable additional terms
// device context support for gui stuff
//
const int VIRTUAL_WIDTH = 640;
const int VIRTUAL_HEIGHT = 480;
const int VIRTUAL_WIDTH = SCREEN_WIDTH;
const int VIRTUAL_HEIGHT = SCREEN_HEIGHT;
const int BLINK_DIVISOR = 200;
class idDeviceContext {
+9 -9
View File
@@ -265,8 +265,8 @@ void idGuiModel::EmitFullScreen( void ) {
viewDef->floatTime = tr.frameShaderTime;
// glOrtho( 0, 640, 480, 0, 0, 1 ); // always assume 640x480 virtual coordinates
viewDef->projectionMatrix[0] = 2.0f / 640.0f;
viewDef->projectionMatrix[5] = -2.0f / 480.0f;
viewDef->projectionMatrix[0] = 2.0f / SCREEN_WIDTH;
viewDef->projectionMatrix[5] = -2.0f / SCREEN_HEIGHT;
viewDef->projectionMatrix[10] = -2.0f / 1.0f;
viewDef->projectionMatrix[12] = -1.0f;
viewDef->projectionMatrix[13] = 1.0f;
@@ -479,13 +479,13 @@ void idGuiModel::DrawStretchPic( float x, float y, float w, float h, float s1, f
h += y;
y = 0;
}
if ( x + w > 640 ) {
s2 -= ( s2 - s1 ) * ( x + w - 640 ) / w;
w = 640 - x;
if ( x + w > SCREEN_WIDTH ) {
s2 -= ( s2 - s1 ) * ( x + w - SCREEN_WIDTH) / w;
w = SCREEN_WIDTH - x;
}
if ( y + h > 480 ) {
t2 -= ( t2 - t1 ) * ( y + h - 480 ) / h;
h = 480 - y;
if ( y + h > SCREEN_HEIGHT) {
t2 -= ( t2 - t1 ) * ( y + h - SCREEN_HEIGHT ) / h;
h = SCREEN_HEIGHT - y;
}
if ( w <= 0 || h <= 0 ) {
@@ -555,7 +555,7 @@ void idGuiModel::DrawStretchPic( float x, float y, float w, float h, float s1, f
verts[3].tangents[1][1] = 1;
verts[3].tangents[1][2] = 0;
DrawStretchPic( &verts[0], &indexes[0], 4, 6, hShader, false, 0.0f, 0.0f, 640.0f, 480.0f );
DrawStretchPic( &verts[0], &indexes[0], 4, 6, hShader, false, 0.0f, 0.0f, SCREEN_WIDTH, SCREEN_HEIGHT);
}
/*
+1 -1
View File
@@ -51,7 +51,7 @@ public:
// these calls are forwarded from the renderer
void SetColor( float r, float g, float b, float a );
void DrawStretchPic( const idDrawVert *verts, const glIndex_t *indexes, int vertCount, int indexCount, const idMaterial *hShader,
bool clip = true, float min_x = 0.0f, float min_y = 0.0f, float max_x = 640.0f, float max_y = 480.0f );
bool clip = true, float min_x = 0.0f, float min_y = 0.0f, float max_x = SCREEN_WIDTH, float max_y = SCREEN_HEIGHT );
void DrawStretchPic( float x, float y, float w, float h,
float s1, float t1, float s2, float t2, const idMaterial *hShader);
void DrawStretchTri ( idVec2 p1, idVec2 p2, idVec2 p3, idVec2 t1, idVec2 t2, idVec2 t3, const idMaterial *material );
+2 -2
View File
@@ -480,8 +480,8 @@ void idImage::GenerateImage( const byte *pic, int width, int height,
}
// make sure it is a power of 2
scaled_width = MakePowerOfTwo( width );
scaled_height = MakePowerOfTwo( height );
scaled_width = width;
scaled_height = height;
if ( scaled_width != width || scaled_height != height ) {
common->Error( "R_CreateImage: not a power of 2 image" );
+3 -3
View File
@@ -161,8 +161,8 @@ const int BIGCHAR_HEIGHT = 16;
// all drawing is done to a 640 x 480 virtual screen size
// and will be automatically scaled to the real resolution
const int SCREEN_WIDTH = 640;
const int SCREEN_HEIGHT = 480;
const float SCREEN_WIDTH = 1280.0f;
const float SCREEN_HEIGHT = 720.0f;
class idRenderWorld;
@@ -208,7 +208,7 @@ public:
virtual void SetColor4( float r, float g, float b, float a ) = 0;
virtual void DrawStretchPic( const idDrawVert *verts, const glIndex_t *indexes, int vertCount, int indexCount, const idMaterial *material,
bool clip = true, float min_x = 0.0f, float min_y = 0.0f, float max_x = 640.0f, float max_y = 480.0f ) = 0;
bool clip = true, float min_x = 0.0f, float min_y = 0.0f, float max_x = SCREEN_WIDTH, float max_y = SCREEN_HEIGHT ) = 0;
virtual void DrawStretchPic( float x, float y, float w, float h, float s1, float t1, float s2, float t2, const idMaterial *material ) = 0;
virtual void DrawStretchTri ( idVec2 p1, idVec2 p2, idVec2 p3, idVec2 t1, idVec2 t2, idVec2 t3, const idMaterial *material ) = 0;
+3 -10
View File
@@ -371,15 +371,8 @@ typedef struct vidmode_s {
} vidmode_t;
vidmode_t r_vidModes[] = {
{ "Mode 0: 320x240", 320, 240 },
{ "Mode 1: 400x300", 400, 300 },
{ "Mode 2: 512x384", 512, 384 },
{ "Mode 3: 640x480", 640, 480 },
{ "Mode 4: 800x600", 800, 600 },
{ "Mode 5: 1024x768", 1024, 768 },
{ "Mode 6: 1152x864", 1152, 864 },
{ "Mode 7: 1280x1024", 1280, 1024 },
{ "Mode 8: 1600x1200", 1600, 1200 },
{ "Mode 0: 1280x720", 1280, 720 },
{ "Mode 1: 1920x1080", 1920, 1080 }
};
static int s_numVidModes = ( sizeof( r_vidModes ) / sizeof( r_vidModes[0] ) );
@@ -394,7 +387,7 @@ static bool R_GetModeInfo( int *width, int *height, int mode ) {
return false;
}
if ( mode >= s_numVidModes ) {
return false;
mode = 0;
}
if ( mode == -1 ) {
+1 -1
View File
@@ -428,7 +428,7 @@ void RB_SetGL2D( void ) {
}
glMatrixMode( GL_PROJECTION );
glLoadIdentity();
glOrtho( 0, 640, 480, 0, 0, 1 ); // always assume 640x480 virtual coordinates
glOrtho( 0, SCREEN_WIDTH, SCREEN_HEIGHT, 0, 0, 1 ); // always assume 640x480 virtual coordinates
glMatrixMode( GL_MODELVIEW );
glLoadIdentity();
+6 -6
View File
@@ -146,18 +146,18 @@ void R_RenderGuiSurf( idUserInterface *gui, drawSurf_t *drawSurf ) {
float guiModelMatrix[16];
float modelMatrix[16];
guiModelMatrix[0] = axis[0][0] / 640.0;
guiModelMatrix[4] = axis[1][0] / 480.0;
guiModelMatrix[0] = axis[0][0] / SCREEN_WIDTH;
guiModelMatrix[4] = axis[1][0] / SCREEN_HEIGHT;
guiModelMatrix[8] = axis[2][0];
guiModelMatrix[12] = origin[0];
guiModelMatrix[1] = axis[0][1] / 640.0;
guiModelMatrix[5] = axis[1][1] / 480.0;
guiModelMatrix[1] = axis[0][1] / SCREEN_WIDTH;
guiModelMatrix[5] = axis[1][1] / SCREEN_HEIGHT;
guiModelMatrix[9] = axis[2][1];
guiModelMatrix[13] = origin[1];
guiModelMatrix[2] = axis[0][2] / 640.0;
guiModelMatrix[6] = axis[1][2] / 480.0;
guiModelMatrix[2] = axis[0][2] / SCREEN_WIDTH;
guiModelMatrix[6] = axis[1][2] / SCREEN_HEIGHT;
guiModelMatrix[10] = axis[2][2];
guiModelMatrix[14] = origin[2];
+1 -1
View File
@@ -704,7 +704,7 @@ public:
virtual void SetColor( const idVec4 &rgba );
virtual void SetColor4( float r, float g, float b, float a );
virtual void DrawStretchPic ( const idDrawVert *verts, const glIndex_t *indexes, int vertCount, int indexCount, const idMaterial *material,
bool clip = true, float x = 0.0f, float y = 0.0f, float w = 640.0f, float h = 0.0f );
bool clip = true, float x = 0.0f, float y = 0.0f, float w = SCREEN_WIDTH, float h = 0.0f );
virtual void DrawStretchPic ( float x, float y, float w, float h, float s1, float t1, float s2, float t2, const idMaterial *material );
virtual void DrawStretchTri ( idVec2 p1, idVec2 p2, idVec2 p3, idVec2 t1, idVec2 t2, idVec2 t3, const idMaterial *material );