added worldarea -> will be responsible for world map rendering
[dboe.git] / startup.c
blob48b42d3fe6c74d44efd99cd3c46acd78812c07bc
2 #include <Windows.h>
3 #include "stdio.h"
5 #include "global.h"
6 #include "newgraph.h"
7 #include "graphics.h"
8 #include "fileio.h"
9 #include "actions.h"
10 #include "dlgutils.h"
11 #include "text.h"
12 #include "gutils.h"
13 #include "items.h"
14 #include "party.h"
15 #include "exlsound.h"
16 #include "startup.h"
17 #include "exlsound.h"
19 extern party_record_type far party;
20 extern pc_record_type far adven[6];
21 extern scen_header_type scen_headers[25];
22 extern Boolean unreg_party_in_scen_not_check;
23 extern Boolean in_startup_mode,registered,play_sounds,party_in_memory;
24 extern long register_flag;
25 extern HWND mainPtr;
26 extern short ulx,uly;
27 extern piles_of_stuff_dumping_type *data_store;
28 extern piles_of_stuff_dumping_type2 *data_store2;
31 //void start_game();
33 RECT startup_button[6];
35 Boolean handle_startup_press(POINT the_point)
38 short i,scen;
39 long dummy;
41 the_point.x -= ulx;
42 the_point.y -= uly;
44 for (i = 0; i < 5; i++)
45 if (PtInRect(&startup_button[i],the_point) == TRUE) {
46 // flash_round_rect(start_button_rects[i],10);
47 //OffsetRect(&start_button_rects[i],ul.h,ul.v);
48 //startup_button_click(start_button_rects[i]);
50 draw_start_button(i,5);
51 if (play_sounds == TRUE)
52 play_sound(37);
53 else Delay(5,&dummy);
54 draw_start_button(i,0);
55 switch (i) {
56 case 0:
57 startup_load();
58 break;
60 case 1:
61 draw_startup(0);
62 start_new_game();
63 update_pc_graphics();
64 draw_startup(0);
65 break;
67 case 2:
68 give_reg_info();
69 draw_startup(0);
70 break;
72 case 3:
73 if (party_in_memory == FALSE) {
74 FCD(867,0);
75 break;
77 scen = pick_prefab_scen();
78 if (scen < 0)
79 break;
80 if ((registered == FALSE) && (scen > 0)) {
81 FCD(913,0);
82 break;
85 switch (scen) {
86 case 0: sprintf(party.scen_name,"valleydy.exs"); break;
87 // if not reg, rub out
88 case 1: sprintf(party.scen_name,"stealth.exs"); break;
89 case 2: sprintf(party.scen_name,"zakhazi.exs"); break;
91 put_party_in_scen();
92 break;
94 case 4: // intro
95 if (party_in_memory == FALSE) {
96 FCD(867,0);
97 break;
99 if (registered == FALSE) {
100 FCD(913,0);
101 break;
103 // if not reg, rub out
105 scen = pick_a_scen();
106 if (scen_headers[scen].prog_make_ver[0] >= 2) {
107 FCD(912,0);
108 break;
110 if (scen >= 0) {
111 if (registered == FALSE)
112 unreg_party_in_scen_not_check = TRUE;
113 sprintf(party.scen_name,"%s",data_store2->scen_names[scen]);
114 put_party_in_scen();
117 break;
119 case 5:
120 Delay(50,&dummy);
121 return TRUE;
122 break;
126 return FALSE;
129 void start_game ()
131 init_party(0);
133 setup_outdoors(party.p_loc);
135 load_area_graphics();
137 draw_main_screen();
139 in_startup_mode = FALSE;
141 adjust_monst_menu();
142 adjust_spell_menus();
146 void startup_load()////
148 load_file();
149 update_pc_graphics();
150 if (in_startup_mode == FALSE) {
151 //end_anim();
152 end_startup();
153 post_load();
155 else {
156 menu_activate(0);
157 draw_startup(0);