4c9eb0c7d944d4758dab3520e9087ebd568d7172
10 extern byte clrmap
[256*12]; // main.c
11 extern void *scrnh
[3]; // game.c
12 extern int g_trans
; // game.c
13 extern byte transdraw
; // game.c
14 extern void *horiz
; // view.c
15 extern int sky_type
; // view.c
16 extern int lt_time
, lt_type
, lt_side
, lt_ypos
, lt_force
; // game.c
17 extern void *ltn
[2][2]; // game.c
22 static int GM_draw (void) {
25 V_setrect(0, SCRW, 0, SCRH);
26 if (!mnu && !gm_redraw) {
33 if (mnu->type == MENU) {
34 y = (200 - mnu -> n * 16 - 20) / 2;
35 Z_gotoxy(mnu->x, y - 10); Z_printbf(mnu->ttl);
36 for (i = 0; i < mnu->n; ++i) {
37 if (mnu->t[i] == LOAD || mnu->t[i] == SAVE) {
39 V_spr(mnu->x, j, mslotl);
40 for (k = 8; k < 184; k += 8) {
41 V_spr(mnu->x + k, j, mslotm);
43 V_spr(mnu->x+184,j,mslotr);
44 Z_gotoxy(mnu->x+4,j-8);
45 if (input && i == save_mnu.cur) {
46 Z_printsf("%s_", ibuf);
48 Z_printsf("%s", savname[i]);
51 Z_gotoxy(mnu->x + (mnu->t[i] >= SVOLM ? (mnu->t[i] >= PL1CM ? 50 : 152) : 0), y + i * 16 + 20);
54 if (mnu->t[i] == MUSIC) {
55 Z_printbf(" '%.8s'",g_music);
56 } else if(mnu->t[i] == INTERP) {
57 Z_printbf("%s", fullscreen ? "ON" : "OFF");
58 } else if(mnu->t[i] >= PL1CM) {
59 V_manspr(mnu->x + (mnu->t[i] == PL1CM ? 15 : 35), y + i * 16 + 20 + 14, PL_getspr(*panimp, 0), pcolortab[(mnu->t[i] == PL1CM) ? p1color : p2color]);
60 } else if(mnu->t[i]>=SVOLM) {
62 V_spr(mnu->x, j, mbarl);
63 for (k = 8; k < 144; k += 8) {
64 V_spr(mnu->x + k, j, mbarm);
66 V_spr(mnu->x + 144, j, mbarr);
68 case SVOLM: k = snd_vol; break;
69 case MVOLM: k = mus_vol; break;
70 case GAMMAM: k = gammaa << 5; break;
72 V_spr(mnu->x+8+k,j,mbaro);
75 V_spr(mnu->x - 25, y + mnu->cur * 16 + 20 - 8, msklh[(gm_tm / 6) & 1]);
77 Z_gotoxy((320 - strlen(mnu->ttl) * 7) / 2, 90); Z_printsf(mnu->ttl);
78 Z_gotoxy(136, 100); Z_printsf("(Y/N)");
86 static void W_adjust (void) {
87 int MAXX
= FLDW
* CELW
- WD
/ 2;
88 int MAXY
= FLDH
* CELH
- HT
/ 2;
89 if (w_x
< WD
/ 2) w_x
= WD
/ 2;
90 if (w_y
< HT
/ 2) w_y
= HT
/ 2;
91 if (w_x
> MAXX
) w_x
= MAXX
;
92 if (w_y
> MAXY
) w_y
= MAXY
;
95 static void W_draw(void) {
97 V_setrect(0, WD
, w_o
+ 1, HT
);
99 vgaimg
*img
= (vgaimg
*)horiz
;
106 V_rotspr(x
, y
, img
, d
);
109 } while (y
< HT
+ w_o
);
116 V_spr(0, w_o
+ lt_ypos
, ltn
[lt_type
][lt_time
< -5 ? 0 : 1]);
118 V_spr2(WD
- 1, w_o
+ lt_ypos
, ltn
[lt_type
][lt_time
< -5 ? 0 : 1]);
123 V_clr(0, WD
, w_o
+ 1, HT
, 0x97);
125 Z_drawfld((byte
*)fldb
, 1);
136 Z_drawfld((byte
*)fldf
, 0);
138 if(lt_time
== -4 || lt_time
== -2) {
139 V_remap_rect(0, WD
, w_o
+ 1, HT
, clrmap
+ 256 * 11);
148 static void drawview (player_t
*p
) {
149 if (p
->looky
< -SCRH
/ 4) {
150 p
->looky
= -SCRH
/ 4;
151 } else if (p
->looky
> SCRH
/ 4) {
155 w_y
= p
->o
.y
- 12 + p
->looky
;
160 static int get_pu_st (int t
) {
163 } else if((t
/ 9) & 1) {
170 static void pl_info (player_t
*p
, int y
) {
171 dword t
= p
->kills
* 10920 / g_time
;
172 Z_gotoxy(25, y
); Z_printbf("KILLS");
173 Z_gotoxy(25, y
+ 15); Z_printbf("KPM");
174 Z_gotoxy(25, y
+ 30); Z_printbf("SECRETS %u / %u", p
->secrets
, sw_secrets
);
175 Z_gotoxy(255, y
); Z_printbf("%u", p
->kills
);
176 Z_gotoxy(255, y
+ 15); Z_printbf("%u.%u", t
/ 10, t
% 10);
182 if (g_trans
&& !transdraw
) {
195 V_pic(0, 0, scrnh
[0]);
200 V_clr(0, SCRW
, 0, SCRH
, 0);
201 V_pic(0, 0, scrnh
[2]);
206 V_clr(0, SCRW
, 0, SCRH
, 0);
207 V_pic(0, 0, scrnh
[1]);
209 Z_printbf("LEVEL COMPLETE");
210 Z_calc_time(g_time
, &hr
, &mn
, &sc
);
212 Z_printbf("TIME %u:%02u:%02u", hr
, mn
, sc
);
216 Z_printbf("PLAYER ONE");
217 Z_gotoxy(80, h
+ 70);
218 Z_printbf("PLAYER TWO");
223 pl_info(&pl2
, h
+ 70);
229 if (g_st
!= GS_GAME
) {
234 V_copytoscr(0, SCRW
, 0, SCRH
);
260 V_copytoscr(0,SCRW
,0,SCRH
);
265 h
= get_pu_st(pl1
.invl
) * 6;
266 } else if (pl1
.pain
< 15) {
268 } else if (pl1
.pain
< 35) {
270 } else if (pl1
.pain
< 55) {
272 } else if (pl1
.pain
< 75) {
274 } else if (pl1
.pain
< 95) {
280 V_maptoscr(0, SCRW
- 120, 1, _2pl
? SCRH
/ 2 - 2 : SCRH
- 2, clrmap
+ h
* 256);
282 V_copytoscr(0, SCRW
- 120, 1, _2pl
? SCRH
/ 2 - 2 : SCRH
- 2);
285 V_copytoscr(SCRW
- 120, 120, 0, _2pl
? SCRH
/ 2 : SCRH
);
290 h
= get_pu_st(pl2
.invl
) * 6;
291 } else if (pl2
.pain
< 15) {
293 } else if (pl2
.pain
< 35) {
295 } else if (pl2
.pain
< 55) {
297 } else if (pl2
.pain
< 75) {
299 } else if (pl2
.pain
< 95) {
305 V_maptoscr(0, SCRW
- 120, SCRH
/ 2 + 1, SCRH
/ 2 - 2, clrmap
+ h
* 256);
307 V_copytoscr(0, SCRW
- 120, SCRH
/ 2 + 1, SCRH
/ 2 - 2);
310 V_copytoscr(SCRW
- 120, 120, SCRH
/ 2, SCRH
/ 2);