Jiggle chart around a bit and put bottom dividing line in

This commit is contained in:
Kevin Anthoney 2014-07-24 18:31:27 +01:00
parent 33dfb0ef5c
commit f53ad1092f
2 changed files with 15 additions and 6 deletions

View File

@ -102,7 +102,7 @@ typedef enum
// Galaxy width / width of chart area at max zoom
#define CHART_MAX_ZOOM (256.0/CHART_WIDTH_AT_MAX_ZOOM)
//start scrolling when cursor is this number of units away from centre
#define CHART_SCROLL_AT_X 30.0
#define CHART_SCROLL_AT_X 25.0
#define CHART_SCROLL_AT_Y 31.0
#define CHART_ZOOM_SHOW_LABELS 2.0
@ -148,8 +148,8 @@ enum
GUI_ROW_SCENARIOS_START = 3,
GUI_MAX_ROWS_SCENARIOS = 12,
GUI_ROW_SCENARIOS_DETAIL = GUI_ROW_SCENARIOS_START + GUI_MAX_ROWS_SCENARIOS + 2,
GUI_ROW_CHART_SYSTEM = 18,
GUI_ROW_PLANET_FINDER = 19
GUI_ROW_CHART_SYSTEM = 19,
GUI_ROW_PLANET_FINDER = 20
};
#if GUI_FIRST_ROW() < 0
# error Too many items in OPTIONS list!

View File

@ -1549,7 +1549,7 @@ static OOTextureSprite *NewTextureSpriteWithDescriptor(NSDictionary *descriptor)
double hcenter = size_in_pixels.width/2.0;
double hscale = size_in_pixels.width / (CHART_WIDTH_AT_MAX_ZOOM*zoom);
double vscale = -size_in_pixels.height / (2*CHART_HEIGHT_AT_MAX_ZOOM*zoom);
double vcenter = 11*MAIN_GUI_ROW_HEIGHT;
double vcenter = 10*MAIN_GUI_ROW_HEIGHT;
double hoffset = hcenter - chart_centre_coordinates.x*hscale;
double voffset = size_in_pixels.height - vcenter - chart_centre_coordinates.y*vscale;
int i;
@ -1573,9 +1573,9 @@ static OOTextureSprite *NewTextureSpriteWithDescriptor(NSDictionary *descriptor)
pixelRatio = viewSize.width / 640.0;
}
clipRect = NSMakeRect((viewSize.width - size_in_pixels.width*pixelRatio)/2.0,
(viewSize.height + size_in_pixels.height*pixelRatio)/2.0 - (pixel_title_size.height + 15 + (GUI_ROW_CHART_SYSTEM-1)*MAIN_GUI_ROW_HEIGHT) * pixelRatio,
(viewSize.height + size_in_pixels.height*pixelRatio)/2.0 - (pixel_title_size.height + 15 + (GUI_ROW_CHART_SYSTEM-2)*MAIN_GUI_ROW_HEIGHT) * pixelRatio,
size_in_pixels.width * pixelRatio,
GUI_ROW_CHART_SYSTEM * MAIN_GUI_ROW_HEIGHT * pixelRatio);
(GUI_ROW_CHART_SYSTEM-1) * MAIN_GUI_ROW_HEIGHT * pixelRatio);
Random_Seed target = [PLAYER target_system_seed];
NSString *targetName = [UNIVERSE getSystemName:target];
@ -1925,6 +1925,15 @@ static OOTextureSprite *NewTextureSpriteWithDescriptor(NSDictionary *descriptor)
// disable draw clipping
OOGL(glDisable(GL_SCISSOR_TEST));
// Draw bottom divider
OOGL(glColor4f(0.75f, 0.75f, 0.75f, alpha)); // 75% gray
OOGLBEGIN(GL_QUADS);
glVertex3f(x + 0, (float)(y + size_in_pixels.height - (GUI_ROW_CHART_SYSTEM-1)*MAIN_GUI_ROW_HEIGHT - pixel_title_size.height), z);
glVertex3f(x + size_in_pixels.width, (GLfloat)(y + size_in_pixels.height - (GUI_ROW_CHART_SYSTEM-1)*MAIN_GUI_ROW_HEIGHT - pixel_title_size.height), z);
glVertex3f(x + size_in_pixels.width, (GLfloat)(y + size_in_pixels.height - (GUI_ROW_CHART_SYSTEM-1)*MAIN_GUI_ROW_HEIGHT - pixel_title_size.height - 2), z);
glVertex3f(x + 0, (GLfloat)(y + size_in_pixels.height - (GUI_ROW_CHART_SYSTEM-1)*MAIN_GUI_ROW_HEIGHT - pixel_title_size.height - 2), z);
OOGLEND();
}