mirror of
https://github.com/Garux/netradiant-custom.git
synced 2026-09-28 00:00:03 +02:00
* render camera crosshair sharply independently of viewport size, with shadow
This commit is contained in:
@@ -1143,6 +1143,7 @@ misc...
|
||||
* Layers Browser: New Layer, Show All Layers, Hide All Layers buttons
|
||||
* new icons by Julius, high dpi scaling support
|
||||
* improved GUI themes, new unmodified Fusion theme, external .qss file
|
||||
* render camera crosshair sharply independently of viewport size, with shadow
|
||||
|
||||
|
||||
|
||||
|
||||
+18
-10
@@ -2084,16 +2084,24 @@ void CamWnd::Cam_Draw(){
|
||||
|
||||
// draw the crosshair
|
||||
if ( m_bFreeMove ) {
|
||||
gl().glBegin( GL_LINES );
|
||||
gl().glVertex2f( (float)m_Camera.width / 2.f, (float)m_Camera.height / 2.f + 6 );
|
||||
gl().glVertex2f( (float)m_Camera.width / 2.f, (float)m_Camera.height / 2.f + 2 );
|
||||
gl().glVertex2f( (float)m_Camera.width / 2.f, (float)m_Camera.height / 2.f - 6 );
|
||||
gl().glVertex2f( (float)m_Camera.width / 2.f, (float)m_Camera.height / 2.f - 2 );
|
||||
gl().glVertex2f( (float)m_Camera.width / 2.f + 6, (float)m_Camera.height / 2.f );
|
||||
gl().glVertex2f( (float)m_Camera.width / 2.f + 2, (float)m_Camera.height / 2.f );
|
||||
gl().glVertex2f( (float)m_Camera.width / 2.f - 6, (float)m_Camera.height / 2.f );
|
||||
gl().glVertex2f( (float)m_Camera.width / 2.f - 2, (float)m_Camera.height / 2.f );
|
||||
gl().glEnd();
|
||||
// .5 coords for exact pixel rendering
|
||||
const Vector2 cent( ( m_Camera.width + 1 ) / 2 + .5f, ( m_Camera.height + 1 ) / 2 + .5f );
|
||||
constexpr float a = 6.5, b = 2.5;
|
||||
for( float f : { 0.f, 1.f } )
|
||||
{
|
||||
gl().glColor3f( f, f, f );
|
||||
const Vector2 verts[]{
|
||||
cent + Vector2( 0, a ) - Vector2( f, f ),
|
||||
cent + Vector2( 0, b ) - Vector2( f, f ),
|
||||
cent + Vector2( 0, -a ) - Vector2( f, f ),
|
||||
cent + Vector2( 0, -b ) - Vector2( f, f ),
|
||||
cent + Vector2( a, 0 ) - Vector2( f, f ),
|
||||
cent + Vector2( b, 0 ) - Vector2( f, f ),
|
||||
cent + Vector2( -a, 0 ) - Vector2( f, f ),
|
||||
cent + Vector2( -b, 0 ) - Vector2( f, f ) };
|
||||
gl().glVertexPointer( 2, GL_FLOAT, sizeof( *verts ), verts->data() );
|
||||
gl().glDrawArrays( GL_LINES, 0, std::size( verts ) );
|
||||
}
|
||||
}
|
||||
|
||||
if ( g_camwindow_globals.m_showStats ) {
|
||||
|
||||
Reference in New Issue
Block a user