Here is a patch against SVN trunk which moves only the "bottom" part of the HUD (i.e., the dials and legends, but not crosshairs or any other part of the display) to the screen bottom edge. This is what I understand screet and pwm57's suggestions to be.
The patch seems to work for me under GNUstep. It is NOT implemented for Cocoa (it would be easy enough to guess what should be changed, but I have no way to test it). I haven't tried it with any OXPs, either.
Code: Select all
Index: src/SDL/MyOpenGLView.m
===================================================================
--- src/SDL/MyOpenGLView.m (revision 2632)
+++ src/SDL/MyOpenGLView.m (working copy)
@@ -357,6 +357,12 @@
}
+- (GLfloat) hud_offset
+{
+ return hud_offset;
+}
+
+
- (GameController *) gameController
{
return gameController;
@@ -702,10 +708,13 @@
#endif
OOLog(@"display.initGL", @"Created a new surface of %d x %d, %@.", (int)viewSize.width, (int)viewSize.height,(fullScreen ? @"fullscreen" : @"windowed"));
- if (viewSize.width/viewSize.height > 4.0/3.0)
+ if (viewSize.width/viewSize.height > 4.0/3.0) {
display_z = 480.0 * bounds.size.width/bounds.size.height;
- else
+ hud_offset = 0.0;
+ } else {
display_z = 640.0;
+ hud_offset = 320.0 * bounds.size.height/bounds.size.width - 240.0;
+ }
float ratio = 0.5;
float aspect = bounds.size.height/bounds.size.width;
Index: src/SDL/MyOpenGLView.h
===================================================================
--- src/SDL/MyOpenGLView.h (revision 2632)
+++ src/SDL/MyOpenGLView.h (working copy)
@@ -114,6 +114,7 @@
NSSize viewSize;
GLfloat display_z;
+ GLfloat hud_offset;
double squareX,squareY;
NSRect bounds;
@@ -159,6 +160,7 @@
- (NSSize) viewSize;
- (GLfloat) display_z;
+- (GLfloat) hud_offset;
- (GameController *) gameController;
- (void) setGameController:(GameController *) controller;
Index: src/Core/HeadUpDisplay.m
===================================================================
--- src/Core/HeadUpDisplay.m (revision 2632)
+++ src/Core/HeadUpDisplay.m (working copy)
@@ -373,11 +373,13 @@
{
OOGL(glLineWidth(_crosshairWidth * line_width));
[self drawCrosshairs];
-
+ OOGL(glPushMatrix());
+ OOGL(glTranslatef(0, -[[UNIVERSE gameView] hud_offset], 0));
OOGL(glLineWidth(line_width));
[self drawLegends];
[self drawDials];
+ OOGL(glPopMatrix());
CheckOpenGLErrors(@"After drawing HUD");
}
- Yet Another Jameson