#include "lin-city.h"Go to the source code of this file.
Data Structures | |
| struct | rect_struct |
| struct | screen_geometry_struct |
Defines | |
| #define | CHAR_HEIGHT 8 |
| #define | CHAR_WIDTH 8 |
| #define | MAIN_WIN_W 432 |
| #define | MAIN_WIN_X 56+8+1 |
| #define | MAIN_WIN_Y 8 |
| #define | MAIN_WIN_H 400 |
| #define | SPEED_BUTTONS_X 0 |
| #define | SPEED_BUTTONS_Y 416 |
| #define | SPEED_BUTTONS_H 16 |
| #define | SPEED_BUTTONS_W 32 |
| #define | PAUSE_BUTTON_X SPEED_BUTTONS_X |
| #define | PAUSE_BUTTON_Y SPEED_BUTTONS_Y |
| #define | PAUSE_BUTTON_H 16 |
| #define | PAUSE_BUTTON_W 32 |
| #define | SLOW_BUTTON_X SPEED_BUTTONS_X |
| #define | SLOW_BUTTON_Y SPEED_BUTTONS_Y + SPEED_BUTTONS_H |
| #define | SLOW_BUTTON_H 16 |
| #define | SLOW_BUTTON_W 32 |
| #define | MED_BUTTON_X SPEED_BUTTONS_X |
| #define | MED_BUTTON_Y SPEED_BUTTONS_Y + 2 * SPEED_BUTTONS_H |
| #define | MED_BUTTON_H 16 |
| #define | MED_BUTTON_W 32 |
| #define | FAST_BUTTON_X SPEED_BUTTONS_X |
| #define | FAST_BUTTON_Y SPEED_BUTTONS_Y + 3 * SPEED_BUTTONS_H |
| #define | FAST_BUTTON_H 16 |
| #define | FAST_BUTTON_W 32 |
| #define | QUIT_BUTTON_X 608 |
| #define | QUIT_BUTTON_Y 416 |
| #define | QUIT_BUTTON_W 32 |
| #define | QUIT_BUTTON_H 32 |
| #define | LOAD_BUTTON_X 576 |
| #define | LOAD_BUTTON_Y 416 |
| #define | LOAD_BUTTON_W 32 |
| #define | LOAD_BUTTON_H 32 |
| #define | SAVE_BUTTON_X 576 |
| #define | SAVE_BUTTON_Y 448 |
| #define | SAVE_BUTTON_W 32 |
| #define | SAVE_BUTTON_H 32 |
| #define | HELP_BUTTON_X 640 - 56 |
| #define | HELP_BUTTON_Y 480 - 24 |
| #define | HELP_BUTTON_W 56 |
| #define | HELP_BUTTON_H 24 |
| #define | RESULTS_BUTTON_X 640 - 2*56 |
| #define | RESULTS_BUTTON_Y 480 - 24 |
| #define | RESULTS_BUTTON_W 56 |
| #define | RESULTS_BUTTON_H 24 |
| #define | MISC_BUTTONS_X 0 |
| #define | MISC_BUTTONS_Y 400 |
| #define | TOVER_BUTTON_X MISC_BUTTONS_X + 32 |
| #define | TOVER_BUTTON_Y MISC_BUTTONS_Y |
| #define | TOVER_BUTTON_W 32 |
| #define | TOVER_BUTTON_H 16 |
| #define | CONFINE_BUTTON_X MISC_BUTTONS_X + 64 |
| #define | CONFINE_BUTTON_Y MISC_BUTTONS_Y |
| #define | CONFINE_BUTTON_W 16 |
| #define | CONFINE_BUTTON_H 16 |
| #define | MENU_BUTTON_X 0 |
| #define | MENU_BUTTON_Y 0 |
| #define | MENU_BUTTON_W 56 |
| #define | MENU_BUTTON_H 24 |
| #define | SELECT_BUTTON_WIN_X 0 |
| #define | SELECT_BUTTON_WIN_W 56 |
| #define | SELECT_BUTTON_WIN_Y 24 |
| #define | SELECT_BUTTON_WIN_H 392 |
| #define | SELECT_BUTTON_WIDTH 16 |
| #define | SELECT_BUTTON_DISTANCE 8 |
| #define | SELECT_BUTTON_INTERVAL (SELECT_BUTTON_WIDTH + SELECT_BUTTON_DISTANCE) |
| #define | PBAR_W 56 |
| #define | PBAR_H 16 |
| #define | PBAR_AREA_X (56+MAIN_WIN_W+16+2) |
| #define | PBAR_AREA_Y 0 |
| #define | PBAR_AREA_H ((PBAR_H * 9) + 8 + 8) |
| #define | PBAR_AREA_W (640 - PBAR_AREA_X + 1) |
| #define | PBAR_TEXT_W (PBAR_AREA_W - 8 - PBAR_W) |
| #define | DATE_W 112 |
| #define | MONEY_W 32 * CHAR_WIDTH |
| #define | TIME_FOR_YEAR_X 320 |
| #define | TIME_FOR_YEAR_Y 470 |
| #define | SELECT_BUTTON_MESSAGE_X MAIN_WIN_X |
| #define | SELECT_BUTTON_MESSAGE_Y 460 |
| #define | STATUS_MESSAGE_1_X MAIN_WIN_X |
| #define | STATUS_MESSAGE_1_Y 440 |
| #define | STATUS_MESSAGE_2_X MAIN_WIN_X |
| #define | STATUS_MESSAGE_2_Y 450 |
| #define | SUST_SCREEN_X 96 |
| #define | SUST_SCREEN_Y 416 |
| #define | SUST_SCREEN_W (60+8) |
| #define | SUST_SCREEN_H 20 |
| #define | MAPPOINT_STATS_X PBAR_AREA_X + 4 |
| #define | MAPPOINT_STATS_Y PBAR_AREA_Y + PBAR_AREA_H + 4 |
| #define | MAPPOINT_STATS_W PBAR_AREA_W - 8 |
| #define | MAPPOINT_STATS_H (11*8) |
| #define | MONTHGRAPH_X PBAR_AREA_X + 4 |
| #define | MONTHGRAPH_Y MAPPOINT_STATS_Y + MAPPOINT_STATS_H + 8 |
| #define | MONTHGRAPH_W PBAR_AREA_W - 8 |
| #define | MONTHGRAPH_H 64 |
| #define | MINI_MAP_AUX_X PBAR_AREA_X + 4 |
| #define | MINI_MAP_AUX_Y MONTHGRAPH_Y + MONTHGRAPH_H + 8 |
| #define | MINI_MAP_AUX_W PBAR_AREA_W - 8 |
| #define | MINI_MAP_AUX_H 16 |
| #define | MINI_SCREEN_W WORLD_SIDE_LEN |
| #define | MINI_SCREEN_H WORLD_SIDE_LEN |
| #define | MINI_SCREEN_X MINI_MAP_AUX_X + ((MINI_MAP_AUX_W - MINI_SCREEN_W) / 2) |
| #define | MINI_SCREEN_Y MINI_MAP_AUX_Y + MINI_MAP_AUX_H + 2 |
| #define | MINI_MAP_AREA_X PBAR_AREA_X + 4 |
| #define | MINI_MAP_AREA_Y MINI_MAP_AUX_Y |
| #define | MINI_MAP_AREA_W PBAR_AREA_W - 8 |
| #define | MINI_MAP_AREA_H MINI_SCREEN_H + MINI_MAP_AUX_H + 2 |
| #define | MS_BUTTON_H 16 |
| #define | MS_BUTTON_W 16 |
| #define | MS_NORMAL_BUTTON_X (MINI_SCREEN_X + MINI_SCREEN_W) |
| #define | MS_NORMAL_BUTTON_Y (MINI_SCREEN_Y) |
| #define | MS_POLLUTION_BUTTON_X (MINI_SCREEN_X + MINI_SCREEN_W) |
| #define | MS_POLLUTION_BUTTON_Y (MINI_SCREEN_Y + 1*16) |
| #define | MS_FIRE_COVER_BUTTON_X (MINI_SCREEN_X + MINI_SCREEN_W) |
| #define | MS_FIRE_COVER_BUTTON_Y (MINI_SCREEN_Y + 2*16) |
| #define | MS_UB40_BUTTON_X (MINI_SCREEN_X + MINI_SCREEN_W) |
| #define | MS_UB40_BUTTON_Y (MINI_SCREEN_Y + 3*16) |
| #define | MS_HEALTH_COVER_BUTTON_X (MINI_SCREEN_X + MINI_SCREEN_W) |
| #define | MS_HEALTH_COVER_BUTTON_Y (MINI_SCREEN_Y + 4*16) |
| #define | MS_COAL_BUTTON_X (MINI_SCREEN_X + MINI_SCREEN_W) |
| #define | MS_COAL_BUTTON_Y (MINI_SCREEN_Y + 5*16) |
| #define | MS_CRICKET_COVER_BUTTON_X (MINI_SCREEN_X + MINI_SCREEN_W + 1*16) |
| #define | MS_CRICKET_COVER_BUTTON_Y (MINI_SCREEN_Y + 1*16) |
| #define | MS_POWER_BUTTON_X (MINI_SCREEN_X + MINI_SCREEN_W + 1*16) |
| #define | MS_POWER_BUTTON_Y (MINI_SCREEN_Y + 2*16) |
| #define | MS_STARVE_BUTTON_X (MINI_SCREEN_X + MINI_SCREEN_W + 1*16) |
| #define | MS_STARVE_BUTTON_Y (MINI_SCREEN_Y + 3*16) |
| #define | MS_OCOST_BUTTON_X (MINI_SCREEN_X + MINI_SCREEN_W + 1*16) |
| #define | MS_OCOST_BUTTON_Y (MINI_SCREEN_Y + 4*16) |
| #define | MARKET_CB_X (PBAR_AREA_X) |
| #define | MARKET_CB_Y (PBAR_AREA_Y) |
Typedefs | |
| typedef rect_struct | Rect |
| typedef screen_geometry_struct | Screen_Geometry |
Functions | |
| void | initialize_geometry (Screen_Geometry *scr) |
| void | resize_geometry (int new_width, int new_height) |
| int | mouse_in_rect (Rect *b, int x, int y) |
| int | pixel_to_mappoint (int px, int py, int *mpx, int *mpy) |
| int | pixel_to_winpoint (int px, int py, int *wpx, int *wpy) |
| void | adjust_main_origin (int new_origin_x, int new_origin_y, int refresh) |
| void | draw_pause (int active) |
| void | draw_slow (int active) |
| void | draw_med (int active) |
| void | draw_fast (int active) |
| void | draw_menu (void) |
| void | draw_load (void) |
| void | draw_save (void) |
| void | draw_quit (void) |
| void | draw_help (void) |
| void | draw_results (void) |
| void | draw_select_button_graphic (int button, char *graphic) |
| void | select_fast (void) |
| void | select_medium (void) |
| void | select_slow (void) |
| void | select_pause (void) |
| void | draw_ms_button (char *graphic) |
| void | draw_ms_text (char *txt) |
| void | draw_small_bezel (int x, int y, int w, int h, int colour) |
| void | draw_bezel (Rect r, short width, int color) |
|
|
Definition at line 134 of file geometry.h. |
|
|
Definition at line 135 of file geometry.h. |
|
|
Definition at line 211 of file geometry.h. |
|
|
Definition at line 210 of file geometry.h. |
|
|
Definition at line 208 of file geometry.h. |
|
|
Definition at line 209 of file geometry.h. |
|
|
Definition at line 262 of file geometry.h. |
|
|
Definition at line 162 of file geometry.h. |
|
|
Definition at line 163 of file geometry.h. |
|
|
Definition at line 160 of file geometry.h. |
|
|
Definition at line 161 of file geometry.h. |
|
|
Definition at line 194 of file geometry.h. |
|
|
Definition at line 193 of file geometry.h. |
|
|
Definition at line 191 of file geometry.h. |
|
|
Definition at line 192 of file geometry.h. |
|
|
Definition at line 178 of file geometry.h. |
|
|
Definition at line 177 of file geometry.h. |
|
|
Definition at line 175 of file geometry.h. |
|
|
Definition at line 176 of file geometry.h. |
|
|
Definition at line 141 of file geometry.h. |
|
|
Definition at line 138 of file geometry.h. |
|
|
Definition at line 139 of file geometry.h. |
|
|
Definition at line 140 of file geometry.h. |
|
|
Definition at line 288 of file geometry.h. |
|
|
Definition at line 287 of file geometry.h. |
|
|
Definition at line 285 of file geometry.h. |
|
|
Definition at line 286 of file geometry.h. |
|
|
Definition at line 334 of file geometry.h. |
|
|
Definition at line 335 of file geometry.h. |
|
|
Definition at line 158 of file geometry.h. |
|
|
Definition at line 159 of file geometry.h. |
|
|
Definition at line 156 of file geometry.h. |
|
|
Definition at line 157 of file geometry.h. |
|
|
Definition at line 216 of file geometry.h. |
|
|
Definition at line 215 of file geometry.h. |
|
|
Definition at line 213 of file geometry.h. |
|
|
Definition at line 214 of file geometry.h. |
|
|
Definition at line 309 of file geometry.h. |
|
|
Definition at line 308 of file geometry.h. |
|
|
Definition at line 306 of file geometry.h. |
|
|
Definition at line 307 of file geometry.h. |
|
|
Definition at line 299 of file geometry.h. |
|
|
Definition at line 298 of file geometry.h. |
|
|
Definition at line 296 of file geometry.h. |
|
|
Definition at line 297 of file geometry.h. |
|
|
Definition at line 302 of file geometry.h. |
|
|
Definition at line 301 of file geometry.h. |
|
|
Definition at line 303 of file geometry.h. |
|
|
Definition at line 304 of file geometry.h. |
|
|
Definition at line 202 of file geometry.h. |
|
|
Definition at line 203 of file geometry.h. |
|
|
Definition at line 263 of file geometry.h. |
|
|
Definition at line 294 of file geometry.h. |
|
|
Definition at line 293 of file geometry.h. |
|
|
Definition at line 290 of file geometry.h. |
|
|
Definition at line 291 of file geometry.h. |
|
|
Definition at line 311 of file geometry.h. |
|
|
Definition at line 312 of file geometry.h. |
|
|
Definition at line 323 of file geometry.h. |
|
|
Definition at line 324 of file geometry.h. |
|
|
Definition at line 325 of file geometry.h. |
|
|
Definition at line 326 of file geometry.h. |
|
|
Definition at line 317 of file geometry.h. |
|
|
Definition at line 318 of file geometry.h. |
|
|
Definition at line 321 of file geometry.h. |
|
|
Definition at line 322 of file geometry.h. |
|
|
Definition at line 313 of file geometry.h. |
|
|
Definition at line 314 of file geometry.h. |
|
|
Definition at line 331 of file geometry.h. |
|
|
Definition at line 332 of file geometry.h. |
|
|
Definition at line 315 of file geometry.h. |
|
|
Definition at line 316 of file geometry.h. |
|
|
Definition at line 327 of file geometry.h. |
|
|
Definition at line 328 of file geometry.h. |
|
|
Definition at line 329 of file geometry.h. |
|
|
Definition at line 330 of file geometry.h. |
|
|
Definition at line 319 of file geometry.h. |
|
|
Definition at line 320 of file geometry.h. |
|
|
Definition at line 150 of file geometry.h. |
|
|
Definition at line 151 of file geometry.h. |
|
|
Definition at line 148 of file geometry.h. |
|
|
Definition at line 149 of file geometry.h. |
|
|
Definition at line 234 of file geometry.h. |
|
|
Definition at line 235 of file geometry.h. |
|
|
Definition at line 232 of file geometry.h. |
|
|
Definition at line 233 of file geometry.h. |
|
|
Definition at line 230 of file geometry.h. |
|
|
Definition at line 237 of file geometry.h. |
|
|
Definition at line 229 of file geometry.h. |
|
|
Definition at line 174 of file geometry.h. |
|
|
Definition at line 173 of file geometry.h. |
|
|
Definition at line 171 of file geometry.h. |
|
|
Definition at line 172 of file geometry.h. |
|
|
Definition at line 199 of file geometry.h. |
|
|
Definition at line 198 of file geometry.h. |
|
|
Definition at line 196 of file geometry.h. |
|
|
Definition at line 197 of file geometry.h. |
|
|
Definition at line 182 of file geometry.h. |
|
|
Definition at line 181 of file geometry.h. |
|
|
Definition at line 179 of file geometry.h. |
|
|
Definition at line 180 of file geometry.h. |
|
|
Definition at line 223 of file geometry.h. |
|
|
Definition at line 224 of file geometry.h. |
|
|
Definition at line 266 of file geometry.h. |
|
|
Definition at line 267 of file geometry.h. |
|
|
Definition at line 222 of file geometry.h. |
|
|
Definition at line 221 of file geometry.h. |
|
|
Definition at line 219 of file geometry.h. |
|
|
Definition at line 218 of file geometry.h. |
|
|
Definition at line 220 of file geometry.h. |
|
|
Definition at line 154 of file geometry.h. |
|
|
Definition at line 155 of file geometry.h. |
|
|
Definition at line 152 of file geometry.h. |
|
|
Definition at line 153 of file geometry.h. |
|
|
Definition at line 146 of file geometry.h. |
|
|
Definition at line 147 of file geometry.h. |
|
|
Definition at line 144 of file geometry.h. |
|
|
Definition at line 145 of file geometry.h. |
|
|
Definition at line 268 of file geometry.h. |
|
|
Definition at line 269 of file geometry.h. |
|
|
Definition at line 270 of file geometry.h. |
|
|
Definition at line 271 of file geometry.h. |
|
|
Definition at line 276 of file geometry.h. |
|
|
Definition at line 275 of file geometry.h. |
|
|
Definition at line 273 of file geometry.h. |
|
|
Definition at line 274 of file geometry.h. |
|
|
Definition at line 264 of file geometry.h. |
|
|
Definition at line 265 of file geometry.h. |
|
|
Definition at line 207 of file geometry.h. |
|
|
Definition at line 206 of file geometry.h. |
|
|
Definition at line 204 of file geometry.h. |
|
|
Definition at line 205 of file geometry.h. |
|
|
Definition at line 18 of file geometry.h. |
|
|
Definition at line 103 of file geometry.h. |
|
||||||||||||||||
|
Definition at line 428 of file geometry.c. 00429 {
00430 Rect* mw = &scr.main_win;
00431
00432 if (new_origin_x < 1) {
00433 new_origin_x = 1;
00434 } else if (new_origin_x > WORLD_SIDE_LEN - mw->w / 16 - 1) {
00435 new_origin_x = WORLD_SIDE_LEN - mw->w / 16 - 1;
00436 }
00437 if (new_origin_y < 1) {
00438 new_origin_y = 1;
00439 } else if (new_origin_y > WORLD_SIDE_LEN - mw->h / 16 - 1) {
00440 new_origin_y = WORLD_SIDE_LEN - mw->h / 16 - 1;
00441 }
00442
00443 if (new_origin_x == main_screen_originx
00444 && new_origin_y == main_screen_originy)
00445 {
00446 return;
00447 }
00448
00449 main_screen_originx = new_origin_x;
00450 main_screen_originy = new_origin_y;
00451
00452 if (refresh) {
00453 hide_mouse ();
00454 refresh_main_screen ();
00455 redraw_mouse ();
00456 }
00457 }
|
|
||||||||||||||||
|
Definition at line 670 of file geometry.c. 00671 {
00672 int i;
00673 int c;
00674 for (i = 0; i < width; i++)
00675 {
00676 c = color + (width - i) * 2;
00677 Fgl_hline (r.x + i, r.y + i, r.x + r.w - i - 1, c);
00678 Fgl_hline (r.x + i, r.y + r.h - i - 1, r.x + r.w - i - 1, c);
00679 Fgl_line (r.x + i, r.y + i, r.x + i, r.y + r.h - i - 1, c);
00680 Fgl_line (r.x + r.w - i - 1, r.y + i, r.x + r.w - i - 1,
00681 r.y + r.h - i - 1, c);
00682 }
00683 }
|
|
|
Definition at line 502 of file geometry.c. 00503 {
00504 Rect* b = &scr.fast_button;
00505 if (active) {
00506 Fgl_putbox (b->x, b->y, 16, 16, fast_button1_on);
00507 Fgl_putbox (b->x + 16, b->y, 16, 16, fast_button2_on);
00508 } else {
00509 Fgl_putbox (b->x, b->y, 16, 16, fast_button1_off);
00510 Fgl_putbox (b->x + 16, b->y, 16, 16, fast_button2_off);
00511 }
00512 }
|
|
|
Definition at line 540 of file geometry.c. 00541 {
00542 /* int menu_bg_color = white(20);*/
00543 /* int menu_bg_color = TEXT_BG_COLOUR; */
00544 /* int menu_bg_color = 14;*/
00545 /* int menu_fg_color = TEXT_FG_COLOUR;*/
00546 int menu_bg_color = 80;
00547 int menu_fg_color = 226;
00548
00549 Rect* b = &scr.help_button;
00550
00551 Fgl_fillbox (b->x, b->y, b->w, b->h, white(20));
00552 Fgl_fillbox (b->x+5, b->y+4, b->w-10, b->h-8, menu_bg_color);
00553
00554 Fgl_hline (b->x+5, b->y+4, b->x + b->w-5, white(8));
00555 Fgl_line (b->x+5, b->y+4, b->x+5, b->y + b->h-4, white(8));
00556 Fgl_hline (b->x+5, b->y + b->h-4, b->x + b->w-5, white(8));
00557 Fgl_line (b->x + b->w-5, b->y+4, b->x + b->w-5, b->y + b->h-4, white(8));
00558
00559 Fgl_setfontcolors (menu_bg_color,menu_fg_color);
00560 Fgl_write (b->x + 13, b->y + 9, _("Help"));
00561 Fgl_setfontcolors (TEXT_BG_COLOUR, TEXT_FG_COLOUR);
00562 }
|
|
|
|
|
|
Definition at line 489 of file geometry.c. 00490 {
00491 Rect* b = &scr.med_button;
00492 if (active) {
00493 Fgl_putbox (b->x, b->y, 16, 16, med_button1_on);
00494 Fgl_putbox (b->x + 16, b->y, 16, 16, med_button2_on);
00495 } else {
00496 Fgl_putbox (b->x, b->y, 16, 16, med_button1_off);
00497 Fgl_putbox (b->x + 16, b->y, 16, 16, med_button2_off);
00498 }
00499 }
|
|
|
Definition at line 515 of file geometry.c. 00516 {
00517 /* int menu_bg_color = white(20);*/
00518 /* int menu_bg_color = TEXT_BG_COLOUR; */
00519 /* int menu_bg_color = 14;*/
00520 /* int menu_fg_color = TEXT_FG_COLOUR;*/
00521 int menu_bg_color = 80;
00522 int menu_fg_color = 226;
00523
00524 Rect* b = &scr.menu_button;
00525
00526 Fgl_fillbox (b->x, b->y, b->w, b->h, white(20));
00527 Fgl_fillbox (b->x+5, b->y+4, b->w-10, b->h-5, menu_bg_color);
00528
00529 Fgl_hline (b->x+5, b->y+4, b->x + b->w-5, white(8));
00530 Fgl_line (b->x+5, b->y+4, b->x+5, b->y + b->h-2, white(8));
00531 Fgl_hline (b->x+5, b->y + b->h-2, b->x + b->w-5, white(8));
00532 Fgl_line (b->x + b->w-5, b->y+4, b->x + b->w-5, b->y + b->h-2, white(8));
00533
00534 Fgl_setfontcolors (menu_bg_color,menu_fg_color);
00535 Fgl_write (b->x + 12, b->y + 10, _("Menu"));
00536 Fgl_setfontcolors (TEXT_BG_COLOUR, TEXT_FG_COLOUR);
00537 }
|
|
|
Definition at line 644 of file geometry.c. 00645 {
00646 Rect* mma = &scr.mini_map_aux;
00647 Fgl_putbox (mma->x + 4, mma->y, 16, 16, graphic);
00648 }
|
|
|
Definition at line 651 of file geometry.c. 00652 {
00653 Rect* mma = &scr.mini_map_aux;
00654 Fgl_write (mma->x + 28, mma->y + 4, txt);
00655 }
|
|
|
Definition at line 463 of file geometry.c. 00464 {
00465 Rect* b = &scr.pause_button;
00466 if (active) {
00467 Fgl_putbox (b->x, b->y, 16, 16, pause_button1_on);
00468 Fgl_putbox (b->x + 16, b->y, 16, 16, pause_button2_on);
00469 } else {
00470 Fgl_putbox (b->x, b->y, 16, 16, pause_button1_off);
00471 Fgl_putbox (b->x + 16, b->y, 16, 16, pause_button2_off);
00472 }
00473 }
|
|
|
|
|
|
Definition at line 565 of file geometry.c. 00566 {
00567 /* int menu_bg_color = white(20);*/
00568 /* int menu_bg_color = TEXT_BG_COLOUR; */
00569 /* int menu_bg_color = 14;*/
00570 /* int menu_fg_color = TEXT_FG_COLOUR;*/
00571 int menu_bg_color = 80;
00572 int menu_fg_color = 226;
00573
00574 Rect* b = &scr.results_button;
00575
00576 Fgl_fillbox (b->x, b->y, b->w, b->h, white(20));
00577 Fgl_fillbox (b->x+5, b->y+4, b->w-10, b->h-8, menu_bg_color);
00578
00579 Fgl_hline (b->x+5, b->y+4, b->x + b->w-5, white(8));
00580 Fgl_line (b->x+5, b->y+4, b->x+5, b->y + b->h-4, white(8));
00581 Fgl_hline (b->x+5, b->y + b->h-4, b->x + b->w-5, white(8));
00582 Fgl_line (b->x + b->w-5, b->y+4, b->x + b->w-5, b->y + b->h-4, white(8));
00583
00584 Fgl_setfontcolors (menu_bg_color,menu_fg_color);
00585 Fgl_write (b->x + 9, b->y + 9, _("Stats"));
00586 Fgl_setfontcolors (TEXT_BG_COLOUR, TEXT_FG_COLOUR);
00587 }
|
|
|
|
|
||||||||||||
|
|
|
|
Definition at line 476 of file geometry.c. 00477 {
00478 Rect* b = &scr.slow_button;
00479 if (active) {
00480 Fgl_putbox (b->x, b->y, 16, 16, slow_button1_on);
00481 Fgl_putbox (b->x + 16, b->y, 16, 16, slow_button2_on);
00482 } else {
00483 Fgl_putbox (b->x, b->y, 16, 16, slow_button1_off);
00484 Fgl_putbox (b->x + 16, b->y, 16, 16, slow_button2_off);
00485 }
00486 }
|
|
||||||||||||||||||||||||
|
Definition at line 658 of file geometry.c. 00659 {
00660 int i;
00661 for (i = 1; i < 4; i++) {
00662 Fgl_hline (x - 1 - i, y - 1 - i, x + w + i, colour + 16);
00663 Fgl_line (x - 1 - i, y - 1 - i, x - 1 - i, y + h + i, colour + 14);
00664 Fgl_hline (x - 1 - i, y + h + i, x + w + i, colour + 22);
00665 Fgl_line (x + w + i, y - 1 - i, x + w + i, y + h + i, colour + 24);
00666 }
00667 }
|
|
|
Definition at line 32 of file geometry.c. 00033 {
00034 scr->border_x = 0;
00035 scr->border_y = 0;
00036
00037 scr->client_w = 640;
00038 scr->client_h = 480;
00039
00040 scr->client_win.x = 0;
00041 scr->client_win.y = 0;
00042 scr->client_win.w = 640;
00043 scr->client_win.h = 480;
00044
00045 scr->main_win.x = MAIN_WIN_X;
00046 scr->main_win.y = MAIN_WIN_Y;
00047 scr->main_win.h = MAIN_WIN_H;
00048 scr->main_win.w = MAIN_WIN_W;
00049
00050 scr->pause_button.x = PAUSE_BUTTON_X;
00051 scr->pause_button.y = PAUSE_BUTTON_Y;
00052 scr->pause_button.h = PAUSE_BUTTON_H;
00053 scr->pause_button.w = PAUSE_BUTTON_W;
00054
00055 scr->slow_button.x = SLOW_BUTTON_X;
00056 scr->slow_button.y = SLOW_BUTTON_Y;
00057 scr->slow_button.h = SLOW_BUTTON_H;
00058 scr->slow_button.w = SLOW_BUTTON_W;
00059
00060 scr->med_button.x = MED_BUTTON_X;
00061 scr->med_button.y = MED_BUTTON_Y;
00062 scr->med_button.h = MED_BUTTON_H;
00063 scr->med_button.w = MED_BUTTON_W;
00064
00065 scr->fast_button.x = FAST_BUTTON_X;
00066 scr->fast_button.y = FAST_BUTTON_Y;
00067 scr->fast_button.h = FAST_BUTTON_H;
00068 scr->fast_button.w = FAST_BUTTON_W;
00069
00070 scr->menu_button.x = MENU_BUTTON_X;
00071 scr->menu_button.y = MENU_BUTTON_Y;
00072 scr->menu_button.h = MENU_BUTTON_H;
00073 scr->menu_button.w = MENU_BUTTON_W;
00074
00075 scr->load_button.x = LOAD_BUTTON_X;
00076 scr->load_button.y = LOAD_BUTTON_Y;
00077 scr->load_button.h = LOAD_BUTTON_H;
00078 scr->load_button.w = LOAD_BUTTON_W;
00079
00080 scr->save_button.x = SAVE_BUTTON_X;
00081 scr->save_button.y = SAVE_BUTTON_Y;
00082 scr->save_button.h = SAVE_BUTTON_H;
00083 scr->save_button.w = SAVE_BUTTON_W;
00084
00085 scr->quit_button.x = QUIT_BUTTON_X;
00086 scr->quit_button.y = QUIT_BUTTON_Y;
00087 scr->quit_button.h = QUIT_BUTTON_H;
00088 scr->quit_button.w = QUIT_BUTTON_W;
00089
00090 scr->help_button.x = HELP_BUTTON_X;
00091 scr->help_button.y = HELP_BUTTON_Y;
00092 scr->help_button.h = HELP_BUTTON_H;
00093 scr->help_button.w = HELP_BUTTON_W;
00094
00095 scr->results_button.x = RESULTS_BUTTON_X;
00096 scr->results_button.y = RESULTS_BUTTON_Y;
00097 scr->results_button.h = RESULTS_BUTTON_H;
00098 scr->results_button.w = RESULTS_BUTTON_W;
00099
00100 scr->tover_button.x = TOVER_BUTTON_X;
00101 scr->tover_button.y = TOVER_BUTTON_Y;
00102 scr->tover_button.h = TOVER_BUTTON_H;
00103 scr->tover_button.w = TOVER_BUTTON_W;
00104
00105 scr->confine_button.x = CONFINE_BUTTON_X;
00106 scr->confine_button.y = CONFINE_BUTTON_Y;
00107 scr->confine_button.h = CONFINE_BUTTON_H;
00108 scr->confine_button.w = CONFINE_BUTTON_W;
00109
00110 scr->module_buttons.x = SELECT_BUTTON_WIN_X;
00111 scr->module_buttons.y = SELECT_BUTTON_WIN_Y;
00112 scr->module_buttons.h = SELECT_BUTTON_WIN_H;
00113 scr->module_buttons.w = SELECT_BUTTON_WIN_W;
00114
00115 scr->pbar_area.x = PBAR_AREA_X;
00116 scr->pbar_area.y = PBAR_AREA_Y;
00117 scr->pbar_area.h = PBAR_AREA_H;
00118 scr->pbar_area.w = PBAR_AREA_W;
00119
00120 scr->pbar_pop.x = PBAR_POP_X;
00121 scr->pbar_pop.y = PBAR_POP_Y;
00122 scr->pbar_pop.h = PBAR_H;
00123 scr->pbar_pop.w = PBAR_W;
00124
00125 scr->pbar_tech.x = PBAR_TECH_X;
00126 scr->pbar_tech.y = PBAR_TECH_Y;
00127 scr->pbar_tech.h = PBAR_H;
00128 scr->pbar_tech.w = PBAR_W;
00129
00130 scr->pbar_food.x = PBAR_FOOD_X;
00131 scr->pbar_food.y = PBAR_FOOD_Y;
00132 scr->pbar_food.h = PBAR_H;
00133 scr->pbar_food.w = PBAR_W;
00134
00135 scr->pbar_jobs.x = PBAR_JOBS_X;
00136 scr->pbar_jobs.y = PBAR_JOBS_Y;
00137 scr->pbar_jobs.h = PBAR_H;
00138 scr->pbar_jobs.w = PBAR_W;
00139
00140 scr->pbar_money.x = PBAR_MONEY_X;
00141 scr->pbar_money.y = PBAR_MONEY_Y;
00142 scr->pbar_money.h = PBAR_H;
00143 scr->pbar_money.w = PBAR_W;
00144
00145 scr->pbar_coal.x = PBAR_COAL_X;
00146 scr->pbar_coal.y = PBAR_COAL_Y;
00147 scr->pbar_coal.h = PBAR_H;
00148 scr->pbar_coal.w = PBAR_W;
00149
00150 scr->pbar_goods.x = PBAR_GOODS_X;
00151 scr->pbar_goods.y = PBAR_GOODS_Y;
00152 scr->pbar_goods.h = PBAR_H;
00153 scr->pbar_goods.w = PBAR_W;
00154
00155 scr->pbar_ore.x = PBAR_ORE_X;
00156 scr->pbar_ore.y = PBAR_ORE_Y;
00157 scr->pbar_ore.h = PBAR_H;
00158 scr->pbar_ore.w = PBAR_W;
00159
00160 scr->pbar_steel.x = PBAR_STEEL_X;
00161 scr->pbar_steel.y = PBAR_STEEL_Y;
00162 scr->pbar_steel.h = PBAR_H;
00163 scr->pbar_steel.w = PBAR_W;
00164
00165 scr->sust.x = SUST_SCREEN_X;
00166 scr->sust.y = SUST_SCREEN_Y;
00167 scr->sust.h = SUST_SCREEN_H;
00168 scr->sust.w = SUST_SCREEN_W;
00169
00170 scr->select_message.x = SELECT_BUTTON_MESSAGE_X;
00171 scr->select_message.y = SELECT_BUTTON_MESSAGE_Y;
00172 scr->select_message.h = 0; /* unused */
00173 scr->select_message.w = 0; /* unused */
00174
00175 scr->date.w = DATE_W;
00176 scr->date.x = scr->main_win.x + scr->main_win.w - scr->date.w;
00177 scr->date.y = scr->main_win.y + scr->main_win.h + 16;
00178 scr->date.h = 16;
00179
00180 scr->money.w = MONEY_W;
00181 scr->money.x = scr->main_win.x;
00182 scr->money.y = scr->main_win.y + scr->main_win.h + 16;
00183 scr->money.h = 16;
00184
00185 scr->time_for_year.x = scr->main_win.x;
00186 scr->time_for_year.y = TIME_FOR_YEAR_Y;
00187 scr->time_for_year.h = 0; /* unused */
00188 scr->time_for_year.w = 0; /* unused */
00189
00190 scr->status_message_1.x = scr->main_win.x;
00191 scr->status_message_1.y = STATUS_MESSAGE_1_Y;
00192 scr->status_message_1.h = 8;
00193 scr->status_message_1.w = scr->main_win.w;
00194
00195 scr->status_message_2.x = scr->main_win.x;
00196 scr->status_message_2.y = STATUS_MESSAGE_2_Y;
00197 scr->status_message_2.h = 8;
00198 scr->status_message_2.w = scr->main_win.w;
00199
00200 scr->mini_map.x = MINI_SCREEN_X;
00201 scr->mini_map.y = MINI_SCREEN_Y;
00202 scr->mini_map.h = MINI_SCREEN_H;
00203 scr->mini_map.w = MINI_SCREEN_W;
00204
00205 scr->mini_map_aux.x = MINI_MAP_AUX_X;
00206 scr->mini_map_aux.y = MINI_MAP_AUX_Y;
00207 scr->mini_map_aux.h = MINI_MAP_AUX_H;
00208 scr->mini_map_aux.w = MINI_MAP_AUX_W;
00209
00210 scr->mini_map_area.x = MINI_MAP_AREA_X;
00211 scr->mini_map_area.y = MINI_MAP_AREA_Y;
00212 scr->mini_map_area.h = MINI_MAP_AREA_H;
00213 scr->mini_map_area.w = MINI_MAP_AREA_W;
00214
00215 #if defined (commentout)
00216 scr->ms_normal_button.x = MS_NORMAL_BUTTON_X;
00217 scr->ms_normal_button.y = MS_NORMAL_BUTTON_Y;
00218 scr->ms_normal_button.h = MS_BUTTON_H;
00219 scr->ms_normal_button.w = MS_BUTTON_W;
00220
00221 scr->ms_pollution_button.x = MS_POLLUTION_BUTTON_X;
00222 scr->ms_pollution_button.y = MS_POLLUTION_BUTTON_Y;
00223 scr->ms_pollution_button.h = MS_BUTTON_H;
00224 scr->ms_pollution_button.w = MS_BUTTON_W;
00225
00226 scr->ms_fire_cover_button.x = MS_FIRE_COVER_BUTTON_X;
00227 scr->ms_fire_cover_button.y = MS_FIRE_COVER_BUTTON_Y;
00228 scr->ms_fire_cover_button.h = MS_BUTTON_H;
00229 scr->ms_fire_cover_button.w = MS_BUTTON_W;
00230
00231 scr->ms_ub40_button.x = MS_UB40_BUTTON_X;
00232 scr->ms_ub40_button.y = MS_UB40_BUTTON_Y;
00233 scr->ms_ub40_button.h = MS_BUTTON_H;
00234 scr->ms_ub40_button.w = MS_BUTTON_W;
00235
00236 scr->ms_coal_button.x = MS_COAL_BUTTON_X;
00237 scr->ms_coal_button.y = MS_COAL_BUTTON_Y;
00238 scr->ms_coal_button.h = MS_BUTTON_H;
00239 scr->ms_coal_button.w = MS_BUTTON_W;
00240
00241 scr->ms_health_cover_button.x = MS_HEALTH_COVER_BUTTON_X;
00242 scr->ms_health_cover_button.y = MS_HEALTH_COVER_BUTTON_Y;
00243 scr->ms_health_cover_button.h = MS_BUTTON_H;
00244 scr->ms_health_cover_button.w = MS_BUTTON_W;
00245
00246 scr->ms_cricket_cover_button.x = MS_CRICKET_COVER_BUTTON_X;
00247 scr->ms_cricket_cover_button.y = MS_CRICKET_COVER_BUTTON_Y;
00248 scr->ms_cricket_cover_button.h = MS_BUTTON_H;
00249 scr->ms_cricket_cover_button.w = MS_BUTTON_W;
00250
00251 scr->ms_power_button.x = MS_POWER_BUTTON_X;
00252 scr->ms_power_button.y = MS_POWER_BUTTON_Y;
00253 scr->ms_power_button.h = MS_BUTTON_H;
00254 scr->ms_power_button.w = MS_BUTTON_W;
00255
00256 scr->ms_starve_button.x = MS_STARVE_BUTTON_X;
00257 scr->ms_starve_button.y = MS_STARVE_BUTTON_Y;
00258 scr->ms_starve_button.h = MS_BUTTON_H;
00259 scr->ms_starve_button.w = MS_BUTTON_W;
00260
00261 scr->ms_ocost_button.x = MS_OCOST_BUTTON_X;
00262 scr->ms_ocost_button.y = MS_OCOST_BUTTON_Y;
00263 scr->ms_ocost_button.h = MS_BUTTON_H;
00264 scr->ms_ocost_button.w = MS_BUTTON_W;
00265 #endif
00266
00267 scr->monthgraph.x = MONTHGRAPH_X;
00268 scr->monthgraph.y = MONTHGRAPH_Y;
00269 scr->monthgraph.h = MONTHGRAPH_H;
00270 scr->monthgraph.w = MONTHGRAPH_W;
00271
00272 scr->mappoint_stats.x = MAPPOINT_STATS_X;
00273 scr->mappoint_stats.y = MAPPOINT_STATS_Y;
00274 scr->mappoint_stats.h = MAPPOINT_STATS_H;
00275 scr->mappoint_stats.w = MAPPOINT_STATS_W;
00276
00277 scr->market_cb = scr->pbar_area;
00278 /* scr->market_cb.x = MARKET_CB_X;
00279 scr->market_cb.y = MARKET_CB_Y;
00280 scr->market_cb.h = MARKET_CB_H;
00281 scr->market_cb.w = MARKET_CB_W; */
00282 }
|
|
||||||||||||||||
|
Definition at line 367 of file geometry.c. 00368 {
00369 return ((x > b->x) && (x < b->x + b->w) &&
00370 (y > b->y) && (y < b->y + b->h));
00371 }
|
|
||||||||||||||||||||
|
Definition at line 392 of file geometry.c. 00393 {
00394 Rect* mw = &scr.main_win;
00395 *mpx = (px - mw->x) / 16;
00396 *mpy = (py - mw->y) / 16;
00397 *mpx += main_screen_originx;
00398 *mpy += main_screen_originy;
00399
00400 if ((px > (mw->x + mw->w)) || (py > (mw->y + mw->h))
00401 || (px < mw->x) || (py < mw->y)) {
00402 return 0;
00403 }
00404
00405 return 1;
00406 }
|
|
||||||||||||||||||||
|
Definition at line 411 of file geometry.c. 00412 {
00413 Rect* mw = &scr.main_win;
00414 *wpx = (px - mw->x) / 16;
00415 *wpy = (py - mw->y) / 16;
00416
00417
00418 if ((px > (mw->x + mw->w)) || (py > (mw->y + mw->h))
00419 || (px < mw->x) || (py < mw->y)) {
00420 return 0;
00421 }
00422
00423 return 1;
00424 }
|
|
||||||||||||
|
Definition at line 285 of file geometry.c. 00286 {
00287 if (display.winW == new_width && display.winH == new_height) {
00288 /* Not a resize event. */
00289 return;
00290 }
00291
00292 /* Reset geometry back to default */
00293 initialize_geometry (&scr);
00294
00295 scr.client_win.w = new_width;
00296 scr.client_win.h = new_height;
00297
00298 if (pix_double) {
00299 new_width = new_width / 2;
00300 new_height = new_height / 2;
00301 }
00302
00303 /* Update display info */
00304 display.winW = new_width;
00305 display.winH = new_height;
00306
00307 /* Expand pixmap if necessary */
00308 scr.client_w = new_width - 2*borderx;
00309 scr.client_h = new_height - 2*bordery;
00310 #if !defined (SVGALIB)
00311 resize_pixmap (scr.client_w, scr.client_h);
00312 #endif
00313
00314 /* Adjust items that need adjusting */
00315
00316 resize_main_win (scr.client_w, scr.client_h);
00317
00318 scr.select_message.y = SELECT_BUTTON_MESSAGE_Y + (scr.client_h - 480);
00319 scr.time_for_year.y = TIME_FOR_YEAR_Y + (scr.client_h - 480);
00320 scr.status_message_1.y = STATUS_MESSAGE_1_Y + (scr.client_h - 480);
00321 scr.status_message_1.w = scr.main_win.w;
00322 scr.status_message_2.y = STATUS_MESSAGE_2_Y + (scr.client_h - 480);
00323 scr.status_message_2.w = scr.main_win.w;
00324
00325 scr.date.y = scr.main_win.y + scr.main_win.h + 16;
00326 scr.date.x = scr.main_win.x + scr.main_win.w - scr.date.w;
00327
00328 scr.pbar_area.x = 56 + scr.main_win.w + 16 + 2;
00329 scr.pbar_pop.x = scr.pbar_area.x + 4;
00330 scr.pbar_tech.x = scr.pbar_area.x + 4;
00331 scr.pbar_food.x = scr.pbar_area.x + 4;
00332 scr.pbar_jobs.x = scr.pbar_area.x + 4;
00333 scr.pbar_money.x = scr.pbar_area.x + 4;
00334 scr.pbar_coal.x = scr.pbar_area.x + 4;
00335 scr.pbar_goods.x = scr.pbar_area.x + 4;
00336 scr.pbar_ore.x = scr.pbar_area.x + 4;
00337 scr.pbar_steel.x = scr.pbar_area.x + 4;
00338
00339 scr.monthgraph.x = scr.pbar_area.x + 4;
00340 scr.mappoint_stats.x = scr.pbar_area.x + 4;
00341 scr.market_cb.x = scr.pbar_area.x;
00342
00343 scr.mini_map_aux.x = scr.pbar_area.x + 4;
00344 scr.mini_map_area.x = scr.pbar_area.x + 4;
00345 scr.mini_map.x = scr.mini_map_aux.x
00346 + ((scr.mini_map_aux.w - scr.mini_map.w) / 2);
00347
00348 scr.money.x = scr.main_win.x;
00349 scr.money.y = scr.main_win.y + scr.main_win.h + 16;
00350
00351 scr.help_button.x = scr.client_w - 56;
00352 scr.help_button.y = scr.client_h - 24;
00353 scr.results_button.x = scr.client_w - 2*56;
00354 scr.results_button.y = scr.client_h - 24;
00355
00356 #if defined (SVGALIB)
00357 mouse_set_range (new_width,new_height);
00358 #endif
00359
00360 /* Complete refresh of the screen required here */
00361 #if !defined (SVGALIB)
00362 screen_full_refresh ();
00363 #endif
00364 }
|
|
|
Definition at line 161 of file timer.c. 00162 {
00163 hide_mouse ();
00164 pause_flag = 0;
00165 draw_pause (0);
00166 slow_flag = 0;
00167 draw_slow (0);
00168 med_flag = 0;
00169 draw_med (0);
00170 fast_flag = 1;
00171 draw_fast (1);
00172 redraw_mouse ();
00173 }
|
|
|
Definition at line 176 of file timer.c. 00177 {
00178 hide_mouse ();
00179 pause_flag = 0;
00180 draw_pause (0);
00181 slow_flag = 0;
00182 draw_slow (0);
00183 med_flag = 1;
00184 draw_med (1);
00185 fast_flag = 0;
00186 draw_fast (0);
00187 redraw_mouse ();
00188 }
|
|
|
Definition at line 206 of file timer.c. 00207 {
00208 if (pause_flag) {
00209 /* unpause it */
00210 if (fast_flag)
00211 select_fast ();
00212 else if (med_flag)
00213 select_medium ();
00214 else if (slow_flag)
00215 select_slow ();
00216 else
00217 select_medium ();
00218 } else {
00219 /* pause it */
00220 hide_mouse ();
00221 pause_flag = 1;
00222 draw_pause (1);
00223 draw_slow (0);
00224 draw_med (0);
00225 draw_fast (0);
00226 redraw_mouse ();
00227 }
00228 }
|
|
|
Definition at line 191 of file timer.c. 00192 {
00193 hide_mouse ();
00194 pause_flag = 0;
00195 draw_pause (0);
00196 slow_flag = 1;
00197 draw_slow (1);
00198 med_flag = 0;
00199 draw_med (0);
00200 fast_flag = 0;
00201 draw_fast (0);
00202 redraw_mouse ();
00203 }
|
1.3.9.1