2006-03-20 17:12:09 +00:00
|
|
|
/*
|
2014-06-01 17:55:23 +00:00
|
|
|
* Portions of this file are copyright Rebirth contributors and licensed as
|
|
|
|
* described in COPYING.txt.
|
|
|
|
* Portions of this file are copyright Parallax Software and licensed
|
|
|
|
* according to the Parallax license below.
|
|
|
|
* See COPYING.txt for license details.
|
|
|
|
|
2006-03-20 17:12:09 +00:00
|
|
|
THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX
|
|
|
|
SOFTWARE CORPORATION ("PARALLAX"). PARALLAX, IN DISTRIBUTING THE CODE TO
|
|
|
|
END-USERS, AND SUBJECT TO ALL OF THE TERMS AND CONDITIONS HEREIN, GRANTS A
|
|
|
|
ROYALTY-FREE, PERPETUAL LICENSE TO SUCH END-USERS FOR USE BY SUCH END-USERS
|
|
|
|
IN USING, DISPLAYING, AND CREATING DERIVATIVE WORKS THEREOF, SO LONG AS
|
|
|
|
SUCH USE, DISPLAY OR CREATION IS FOR NON-COMMERCIAL, ROYALTY OR REVENUE
|
|
|
|
FREE PURPOSES. IN NO EVENT SHALL THE END-USER USE THE COMPUTER CODE
|
|
|
|
CONTAINED HEREIN FOR REVENUE-BEARING PURPOSES. THE END-USER UNDERSTANDS
|
|
|
|
AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE.
|
|
|
|
COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*
|
|
|
|
*
|
|
|
|
* Kill matrix displayed at end of level.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <string.h>
|
|
|
|
#include <ctype.h>
|
|
|
|
#include <stdarg.h>
|
|
|
|
|
2012-07-07 18:35:06 +00:00
|
|
|
#include "dxxerror.h"
|
2006-03-20 17:12:09 +00:00
|
|
|
#include "pstypes.h"
|
|
|
|
#include "gr.h"
|
2010-03-20 13:21:53 +00:00
|
|
|
#include "window.h"
|
2006-03-20 17:12:09 +00:00
|
|
|
#include "key.h"
|
|
|
|
#include "palette.h"
|
|
|
|
#include "game.h"
|
2013-12-26 04:18:28 +00:00
|
|
|
#include "gameseq.h"
|
2010-01-27 04:30:31 +00:00
|
|
|
#include "window.h"
|
2014-07-20 01:09:55 +00:00
|
|
|
#include "physfsx.h"
|
2006-03-20 17:12:09 +00:00
|
|
|
#include "gamefont.h"
|
|
|
|
#include "u_mem.h"
|
|
|
|
#include "newmenu.h"
|
|
|
|
#include "menu.h"
|
|
|
|
#include "player.h"
|
|
|
|
#include "screens.h"
|
|
|
|
#include "cntrlcen.h"
|
|
|
|
#include "mouse.h"
|
|
|
|
#include "joy.h"
|
|
|
|
#include "timer.h"
|
|
|
|
#include "text.h"
|
2009-03-03 12:55:27 +00:00
|
|
|
#include "rbaudio.h"
|
2006-03-20 17:12:09 +00:00
|
|
|
#include "multi.h"
|
|
|
|
#include "kmatrix.h"
|
|
|
|
#include "gauges.h"
|
|
|
|
#include "pcx.h"
|
2013-03-03 19:41:09 +00:00
|
|
|
#include "args.h"
|
2006-03-20 17:12:09 +00:00
|
|
|
|
2007-03-22 11:32:22 +00:00
|
|
|
#ifdef OGL
|
|
|
|
#include "ogl_init.h"
|
|
|
|
#endif
|
|
|
|
|
2006-03-20 17:12:09 +00:00
|
|
|
#define CENTERING_OFFSET(x) ((300 - (70 + (x)*25 ))/2)
|
2007-01-12 14:21:05 +00:00
|
|
|
#define CENTERSCREEN (SWIDTH/2)
|
2009-11-24 09:48:53 +00:00
|
|
|
#define KMATRIX_VIEW_SEC 7 // Time after reactor explosion until new level - in seconds
|
2013-09-22 22:26:27 +00:00
|
|
|
static void kmatrix_redraw_coop();
|
2009-11-24 09:48:53 +00:00
|
|
|
|
2014-09-21 22:10:12 +00:00
|
|
|
static void kmatrix_draw_item(int i, playernum_array_t &sorted)
|
2009-11-24 09:48:53 +00:00
|
|
|
{
|
2014-09-26 02:42:09 +00:00
|
|
|
int x, y;
|
2009-11-24 09:48:53 +00:00
|
|
|
char temp[10];
|
|
|
|
|
|
|
|
y = FSPACY(50+i*9);
|
2014-07-05 16:48:12 +00:00
|
|
|
gr_string(FSPACX(CENTERING_OFFSET(N_players)), y, static_cast<const char *>(Players[sorted[i]].callsign));
|
2009-11-24 09:48:53 +00:00
|
|
|
|
2014-09-26 02:42:09 +00:00
|
|
|
for (int j=0; j<N_players; j++)
|
2009-11-24 09:48:53 +00:00
|
|
|
{
|
|
|
|
x = FSPACX(70 + CENTERING_OFFSET(N_players) + j*25);
|
|
|
|
|
|
|
|
if (sorted[i]==sorted[j])
|
|
|
|
{
|
|
|
|
if (kill_matrix[sorted[i]][sorted[j]] == 0)
|
|
|
|
{
|
|
|
|
gr_set_fontcolor( BM_XRGB(10,10,10),-1 );
|
|
|
|
gr_printf( x, y, "%d", kill_matrix[sorted[i]][sorted[j]] );
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
gr_set_fontcolor( BM_XRGB(25,25,25),-1 );
|
|
|
|
gr_printf( x, y, "-%d", kill_matrix[sorted[i]][sorted[j]] );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (kill_matrix[sorted[i]][sorted[j]] <= 0)
|
|
|
|
{
|
|
|
|
gr_set_fontcolor( BM_XRGB(10,10,10),-1 );
|
|
|
|
gr_printf( x, y, "%d", kill_matrix[sorted[i]][sorted[j]] );
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
gr_set_fontcolor( BM_XRGB(25,25,25),-1 );
|
|
|
|
gr_printf( x, y, "%d", kill_matrix[sorted[i]][sorted[j]] );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (Players[sorted[i]].net_killed_total+Players[sorted[i]].net_kills_total==0)
|
2013-12-24 00:52:32 +00:00
|
|
|
strcpy (temp,"NA");
|
2009-11-24 09:48:53 +00:00
|
|
|
else
|
2013-12-24 00:52:32 +00:00
|
|
|
snprintf (temp,sizeof(temp),"%d%%",(int)((float)((float)Players[sorted[i]].net_kills_total/((float)Players[sorted[i]].net_killed_total+(float)Players[sorted[i]].net_kills_total))*100.0));
|
2009-11-24 09:48:53 +00:00
|
|
|
|
|
|
|
x = FSPACX(60 + CENTERING_OFFSET(N_players) + N_players*25);
|
|
|
|
gr_set_fontcolor( BM_XRGB(25,25,25),-1 );
|
|
|
|
gr_printf( x ,y,"%4d/%s",Players[sorted[i]].net_kills_total,temp);
|
|
|
|
}
|
|
|
|
|
2014-09-21 22:10:12 +00:00
|
|
|
static void kmatrix_draw_coop_item(int i, playernum_array_t &sorted)
|
2009-11-24 09:48:53 +00:00
|
|
|
{
|
|
|
|
int x, y;
|
|
|
|
|
|
|
|
y = FSPACY(50+i*9);
|
2014-07-05 16:48:12 +00:00
|
|
|
gr_string(FSPACX(CENTERING_OFFSET(N_players)), y, static_cast<const char *>(Players[sorted[i]].callsign));
|
2009-11-24 09:48:53 +00:00
|
|
|
x = CENTERSCREEN;
|
|
|
|
gr_set_fontcolor( BM_XRGB(60,40,10),-1 );
|
|
|
|
gr_printf( x, y, "%d", Players[sorted[i]].score );
|
|
|
|
x = CENTERSCREEN+FSPACX(50);
|
|
|
|
gr_set_fontcolor( BM_XRGB(60,40,10),-1 );
|
|
|
|
gr_printf( x, y, "%d", Players[sorted[i]].net_killed_total);
|
|
|
|
}
|
|
|
|
|
2014-09-21 22:10:12 +00:00
|
|
|
static void kmatrix_draw_names(playernum_array_t &sorted)
|
2009-11-24 09:48:53 +00:00
|
|
|
{
|
2014-09-26 02:42:09 +00:00
|
|
|
int x, color;
|
2009-11-24 09:48:53 +00:00
|
|
|
|
2014-09-26 02:42:09 +00:00
|
|
|
for (int j=0; j<N_players; j++)
|
2009-11-24 09:48:53 +00:00
|
|
|
{
|
|
|
|
if (Game_mode & GM_TEAM)
|
|
|
|
color = get_team(sorted[j]);
|
|
|
|
else
|
|
|
|
color = sorted[j];
|
|
|
|
|
|
|
|
x = FSPACX (70 + CENTERING_OFFSET(N_players) + j*25);
|
|
|
|
|
|
|
|
if (Players[sorted[j]].connected==CONNECT_DISCONNECTED)
|
|
|
|
gr_set_fontcolor(gr_find_closest_color(31,31,31),-1);
|
|
|
|
else
|
|
|
|
gr_set_fontcolor(BM_XRGB(player_rgb[color].r,player_rgb[color].g,player_rgb[color].b),-1 );
|
|
|
|
|
2014-07-26 22:45:01 +00:00
|
|
|
gr_printf( x, FSPACY(40), "%c", Players[sorted[j]].callsign[0u] );
|
2009-11-24 09:48:53 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
x = FSPACX(72 + CENTERING_OFFSET(N_players) + N_players*25);
|
|
|
|
gr_set_fontcolor( BM_XRGB(31,31,31),-1 );
|
2013-01-03 16:23:24 +00:00
|
|
|
gr_string( x, FSPACY(40), "K/E");
|
2009-11-24 09:48:53 +00:00
|
|
|
}
|
|
|
|
|
2014-09-21 22:10:12 +00:00
|
|
|
static void kmatrix_draw_coop_names(playernum_array_t &)
|
2009-11-24 09:48:53 +00:00
|
|
|
{
|
|
|
|
gr_set_fontcolor( BM_XRGB(63,31,31),-1 );
|
2013-01-03 16:23:24 +00:00
|
|
|
gr_string( CENTERSCREEN, FSPACY(40), "SCORE");
|
2009-11-24 09:48:53 +00:00
|
|
|
gr_set_fontcolor( BM_XRGB(63,31,31),-1 );
|
2013-01-03 16:23:24 +00:00
|
|
|
gr_string( CENTERSCREEN+FSPACX(50), FSPACY(40), "DEATHS");
|
2009-11-24 09:48:53 +00:00
|
|
|
}
|
|
|
|
|
2013-10-27 22:00:14 +00:00
|
|
|
static void kmatrix_status_msg (fix time, int reactor)
|
2009-11-24 09:48:53 +00:00
|
|
|
{
|
2014-07-20 03:48:27 +00:00
|
|
|
gr_set_curfont(GAME_FONT);
|
2009-11-24 09:48:53 +00:00
|
|
|
gr_set_fontcolor(gr_find_closest_color(255,255,255),-1);
|
|
|
|
|
|
|
|
if (reactor)
|
|
|
|
gr_printf(0x8000, SHEIGHT-LINE_SPACING, "Waiting for players to finish level. Reactor time: T-%d", time);
|
|
|
|
else
|
|
|
|
gr_printf(0x8000, SHEIGHT-LINE_SPACING, "Level finished. Wait (%d) to proceed or ESC to Quit.", time);
|
|
|
|
}
|
|
|
|
|
2014-09-07 18:06:59 +00:00
|
|
|
struct kmatrix_screen : ignore_window_pointer_t
|
2009-11-24 09:48:53 +00:00
|
|
|
{
|
2010-07-27 11:41:43 +00:00
|
|
|
grs_bitmap background;
|
|
|
|
int network;
|
2010-12-10 23:18:17 +00:00
|
|
|
fix64 end_time;
|
2010-07-27 11:41:43 +00:00
|
|
|
int playing;
|
2013-12-22 22:03:07 +00:00
|
|
|
};
|
2009-11-24 09:48:53 +00:00
|
|
|
|
2013-10-27 22:00:14 +00:00
|
|
|
static void kmatrix_redraw(kmatrix_screen *km)
|
2010-07-27 11:41:43 +00:00
|
|
|
{
|
2014-09-26 02:42:09 +00:00
|
|
|
int color;
|
2014-09-21 22:10:12 +00:00
|
|
|
playernum_array_t sorted;
|
2009-11-24 09:48:53 +00:00
|
|
|
|
2010-07-27 11:41:43 +00:00
|
|
|
gr_set_current_canvas(NULL);
|
|
|
|
show_fullscr(&km->background);
|
|
|
|
|
2009-11-24 09:48:53 +00:00
|
|
|
if (Game_mode & GM_MULTI_COOP)
|
|
|
|
{
|
|
|
|
kmatrix_redraw_coop();
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
multi_sort_kill_list();
|
2014-07-20 03:48:27 +00:00
|
|
|
gr_set_curfont(MEDIUM3_FONT);
|
2009-11-24 09:48:53 +00:00
|
|
|
|
2013-03-03 01:03:33 +00:00
|
|
|
#if defined(DXX_BUILD_DESCENT_II)
|
2013-08-11 16:03:47 +00:00
|
|
|
if (game_mode_capture_flag())
|
2009-11-24 09:48:53 +00:00
|
|
|
gr_string( 0x8000, FSPACY(10), "CAPTURE THE FLAG SUMMARY");
|
2013-08-11 16:03:47 +00:00
|
|
|
else if (game_mode_hoard())
|
2009-11-24 09:48:53 +00:00
|
|
|
gr_string( 0x8000, FSPACY(10), "HOARD SUMMARY");
|
|
|
|
else
|
2013-03-03 01:03:33 +00:00
|
|
|
#endif
|
2009-11-24 09:48:53 +00:00
|
|
|
gr_string( 0x8000, FSPACY(10), TXT_KILL_MATRIX_TITLE);
|
|
|
|
|
2014-07-20 03:48:27 +00:00
|
|
|
gr_set_curfont(GAME_FONT);
|
2009-11-24 09:48:53 +00:00
|
|
|
multi_get_kill_list(sorted);
|
|
|
|
kmatrix_draw_names(sorted);
|
|
|
|
|
2014-09-26 02:42:09 +00:00
|
|
|
for (int i=0; i<N_players; i++ )
|
2009-11-24 09:48:53 +00:00
|
|
|
{
|
|
|
|
if (Game_mode & GM_TEAM)
|
|
|
|
color = get_team(sorted[i]);
|
|
|
|
else
|
|
|
|
color = sorted[i];
|
|
|
|
|
|
|
|
if (Players[sorted[i]].connected==CONNECT_DISCONNECTED)
|
|
|
|
gr_set_fontcolor(gr_find_closest_color(31,31,31),-1);
|
|
|
|
else
|
|
|
|
gr_set_fontcolor(BM_XRGB(player_rgb[color].r,player_rgb[color].g,player_rgb[color].b),-1 );
|
|
|
|
|
|
|
|
kmatrix_draw_item( i, sorted );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
gr_palette_load(gr_palette);
|
|
|
|
}
|
|
|
|
|
2013-09-22 22:26:27 +00:00
|
|
|
static void kmatrix_redraw_coop()
|
2009-11-24 09:48:53 +00:00
|
|
|
{
|
2014-09-21 22:10:12 +00:00
|
|
|
int color;
|
|
|
|
playernum_array_t sorted;
|
2009-11-24 09:48:53 +00:00
|
|
|
|
|
|
|
multi_sort_kill_list();
|
2014-07-20 03:48:27 +00:00
|
|
|
gr_set_curfont(MEDIUM3_FONT);
|
2009-11-24 09:48:53 +00:00
|
|
|
gr_string( 0x8000, FSPACY(10), "COOPERATIVE SUMMARY");
|
2014-07-20 03:48:27 +00:00
|
|
|
gr_set_curfont(GAME_FONT);
|
2009-11-24 09:48:53 +00:00
|
|
|
multi_get_kill_list(sorted);
|
|
|
|
kmatrix_draw_coop_names(sorted);
|
|
|
|
|
2014-09-21 22:10:12 +00:00
|
|
|
for (playernum_t i = 0; i < N_players; ++i)
|
2009-11-24 09:48:53 +00:00
|
|
|
{
|
|
|
|
color = sorted[i];
|
|
|
|
|
|
|
|
if (Players[sorted[i]].connected==CONNECT_DISCONNECTED)
|
|
|
|
gr_set_fontcolor(gr_find_closest_color(31,31,31),-1);
|
|
|
|
else
|
|
|
|
gr_set_fontcolor(BM_XRGB(player_rgb[color].r,player_rgb[color].g,player_rgb[color].b),-1 );
|
|
|
|
|
|
|
|
kmatrix_draw_coop_item( i, sorted );
|
|
|
|
}
|
|
|
|
|
|
|
|
gr_palette_load(gr_palette);
|
|
|
|
}
|
|
|
|
|
2014-10-04 21:47:13 +00:00
|
|
|
static window_event_result kmatrix_handler(window *wind,const d_event &event, kmatrix_screen *km)
|
2010-03-20 13:21:53 +00:00
|
|
|
{
|
2014-09-20 23:47:27 +00:00
|
|
|
int k = 0, choice = 0;
|
2010-03-20 13:21:53 +00:00
|
|
|
|
2014-10-04 21:47:13 +00:00
|
|
|
switch (event.type)
|
2009-11-24 09:48:53 +00:00
|
|
|
{
|
2010-03-20 13:21:53 +00:00
|
|
|
case EVENT_KEY_COMMAND:
|
2011-01-14 09:51:13 +00:00
|
|
|
k = event_key_get(event);
|
2010-03-20 13:21:53 +00:00
|
|
|
switch( k )
|
|
|
|
{
|
|
|
|
case KEY_ESC:
|
|
|
|
{
|
2013-12-04 04:18:54 +00:00
|
|
|
newmenu_item nm_message_items[2];
|
|
|
|
nm_set_item_menu(& nm_message_items[0], TXT_YES);
|
|
|
|
nm_set_item_menu(& nm_message_items[1], TXT_NO);
|
2013-12-13 22:40:58 +00:00
|
|
|
choice = newmenu_do( NULL, TXT_ABORT_GAME, 2, nm_message_items, km->network ? multi_endlevel_poll2 : unused_newmenu_subfunction, unused_newmenu_userdata );
|
2010-03-20 13:21:53 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if (choice==0)
|
|
|
|
{
|
|
|
|
Players[Player_num].connected=CONNECT_DISCONNECTED;
|
|
|
|
|
|
|
|
if (km->network)
|
|
|
|
multi_send_endlevel_packet();
|
|
|
|
|
|
|
|
multi_leave_game();
|
|
|
|
window_close(wind);
|
|
|
|
if (Game_wind)
|
|
|
|
window_close(Game_wind);
|
2014-08-06 02:10:49 +00:00
|
|
|
return window_event_result::close;
|
2010-03-20 13:21:53 +00:00
|
|
|
}
|
2014-08-06 02:10:49 +00:00
|
|
|
return window_event_result::handled;
|
2010-03-20 13:21:53 +00:00
|
|
|
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
2011-01-14 21:56:00 +00:00
|
|
|
case EVENT_WINDOW_DRAW:
|
2010-03-20 13:21:53 +00:00
|
|
|
timer_delay2(50);
|
|
|
|
|
|
|
|
if (km->network)
|
|
|
|
multi_do_protocol_frame(0, 1);
|
|
|
|
|
2010-03-27 02:54:41 +00:00
|
|
|
km->playing = 0;
|
|
|
|
|
2010-03-20 13:21:53 +00:00
|
|
|
// Check if all connected players are also looking at this screen ...
|
2014-09-20 23:47:27 +00:00
|
|
|
for (uint_fast32_t i = 0; i < MAX_PLAYERS; i++)
|
2010-03-20 13:21:53 +00:00
|
|
|
if (Players[i].connected)
|
|
|
|
if (Players[i].connected != CONNECT_END_MENU && Players[i].connected != CONNECT_DIED_IN_MINE)
|
|
|
|
km->playing = 1;
|
|
|
|
|
|
|
|
// ... and let the reactor blow sky high!
|
|
|
|
if (!km->playing)
|
|
|
|
Countdown_seconds_left = -1;
|
|
|
|
|
|
|
|
// If Reactor is finished and end_time not inited, set the time when we will exit this loop
|
|
|
|
if (km->end_time == -1 && Countdown_seconds_left < 0 && !km->playing)
|
2010-12-10 23:18:17 +00:00
|
|
|
km->end_time = timer_query() + (KMATRIX_VIEW_SEC * F1_0);
|
2010-03-20 13:21:53 +00:00
|
|
|
|
|
|
|
// Check if end_time has been reached and exit loop
|
2010-12-10 23:18:17 +00:00
|
|
|
if (timer_query() >= km->end_time && km->end_time != -1)
|
2010-03-20 13:21:53 +00:00
|
|
|
{
|
|
|
|
if (km->network)
|
|
|
|
multi_send_endlevel_packet(); // make sure
|
|
|
|
|
2013-03-03 01:03:33 +00:00
|
|
|
#if defined(DXX_BUILD_DESCENT_II)
|
2010-03-20 13:21:53 +00:00
|
|
|
if (is_D2_OEM)
|
2009-11-24 09:48:53 +00:00
|
|
|
{
|
2010-03-20 13:21:53 +00:00
|
|
|
if (Current_level_num==8)
|
|
|
|
{
|
|
|
|
Players[Player_num].connected=CONNECT_DISCONNECTED;
|
|
|
|
|
|
|
|
if (km->network)
|
|
|
|
multi_send_endlevel_packet();
|
|
|
|
|
|
|
|
multi_leave_game();
|
|
|
|
window_close(wind);
|
|
|
|
if (Game_wind)
|
|
|
|
window_close(Game_wind);
|
2014-08-06 02:10:49 +00:00
|
|
|
return window_event_result::close;
|
2010-03-20 13:21:53 +00:00
|
|
|
}
|
2009-11-24 09:48:53 +00:00
|
|
|
}
|
2013-03-03 01:03:33 +00:00
|
|
|
#endif
|
2010-03-20 13:21:53 +00:00
|
|
|
window_close(wind);
|
2014-08-06 02:10:49 +00:00
|
|
|
return window_event_result::close;
|
2010-03-20 13:21:53 +00:00
|
|
|
}
|
2009-11-24 09:48:53 +00:00
|
|
|
|
2010-07-27 11:41:43 +00:00
|
|
|
kmatrix_redraw(km);
|
2010-03-20 13:21:53 +00:00
|
|
|
|
|
|
|
if (km->playing)
|
|
|
|
kmatrix_status_msg(Countdown_seconds_left, 1);
|
|
|
|
else
|
2010-12-10 23:18:17 +00:00
|
|
|
kmatrix_status_msg(f2i(timer_query()-km->end_time), 0);
|
2010-03-20 13:21:53 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case EVENT_WINDOW_CLOSE:
|
|
|
|
game_flush_inputs();
|
2010-07-31 12:09:38 +00:00
|
|
|
newmenu_free_background();
|
2010-03-20 13:21:53 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
break;
|
2009-11-24 09:48:53 +00:00
|
|
|
}
|
2014-08-06 02:10:49 +00:00
|
|
|
return window_event_result::ignored;
|
2010-03-20 13:21:53 +00:00
|
|
|
}
|
2009-11-24 09:48:53 +00:00
|
|
|
|
2010-03-20 13:21:53 +00:00
|
|
|
void kmatrix_view(int network)
|
|
|
|
{
|
|
|
|
window *wind;
|
2013-12-08 16:50:19 +00:00
|
|
|
kmatrix_screen km;
|
|
|
|
gr_init_bitmap_data(&km.background);
|
|
|
|
if (pcx_read_bitmap(STARS_BACKGROUND, &km.background, BM_LINEAR, gr_palette) != PCX_ERROR_NONE)
|
2010-07-27 11:41:43 +00:00
|
|
|
{
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
gr_palette_load(gr_palette);
|
|
|
|
|
2013-12-08 16:50:19 +00:00
|
|
|
km.network = network;
|
|
|
|
km.end_time = -1;
|
|
|
|
km.playing = 0;
|
2010-03-20 13:21:53 +00:00
|
|
|
|
|
|
|
set_screen_mode( SCREEN_MENU );
|
2009-11-24 09:48:53 +00:00
|
|
|
game_flush_inputs();
|
|
|
|
|
2014-09-20 23:47:27 +00:00
|
|
|
for (uint_fast32_t i = 0;i < MAX_PLAYERS;i++)
|
2010-03-20 13:21:53 +00:00
|
|
|
digi_kill_sound_linked_to_object (Players[i].objnum);
|
2009-11-24 09:48:53 +00:00
|
|
|
|
2013-12-01 05:21:47 +00:00
|
|
|
wind = window_create(&grd_curscreen->sc_canvas, 0, 0, SWIDTH, SHEIGHT, kmatrix_handler, &km);
|
2010-03-20 13:21:53 +00:00
|
|
|
if (!wind)
|
|
|
|
{
|
|
|
|
return;
|
2009-11-24 09:48:53 +00:00
|
|
|
}
|
2010-03-20 13:21:53 +00:00
|
|
|
|
|
|
|
while (window_exists(wind))
|
|
|
|
event_process();
|
2013-12-08 16:50:19 +00:00
|
|
|
gr_free_bitmap_data(&km.background);
|
2006-03-20 17:12:09 +00:00
|
|
|
}
|