1 //**************************************************************************
2 //**
3 //**	##   ##    ##    ##   ##   ####     ####   ###     ###
4 //**	##   ##  ##  ##  ##   ##  ##  ##   ##  ##  ####   ####
5 //**	 ## ##  ##    ##  ## ##  ##    ## ##    ## ## ## ## ##
6 //**	 ## ##  ########  ## ##  ##    ## ##    ## ##  ###  ##
7 //**	  ###   ##    ##   ###    ##  ##   ##  ##  ##       ##
8 //**	   #    ##    ##    #      ####     ####   ##       ##
9 //**
10 //**	$Id: sbar.cpp 4339 2010-12-14 12:07:27Z dj_jl $
11 //**
12 //**	Copyright (C) 1999-2006 Jānis Legzdiņš
13 //**
14 //**	This program is free software; you can redistribute it and/or
15 //**  modify it under the terms of the GNU General Public License
16 //**  as published by the Free Software Foundation; either version 2
17 //**  of the License, or (at your option) any later version.
18 //**
19 //**	This program is distributed in the hope that it will be useful,
20 //**  but WITHOUT ANY WARRANTY; without even the implied warranty of
21 //**  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
22 //**  GNU General Public License for more details.
23 //**
24 //**************************************************************************
25 //**
26 //**	Status bar code.
27 //**
28 //**************************************************************************
29 
30 // HEADER FILES ------------------------------------------------------------
31 
32 #include "gamedefs.h"
33 #include "cl_local.h"
34 #include "drawer.h"
35 
36 // MACROS ------------------------------------------------------------------
37 
38 // TYPES -------------------------------------------------------------------
39 
40 enum
41 {
42 	SB_VIEW_NORMAL,
43 	SB_VIEW_AUTOMAP,
44 	SB_VIEW_FULLSCREEN
45 };
46 
47 // EXTERNAL FUNCTION PROTOTYPES --------------------------------------------
48 
49 // PUBLIC FUNCTION PROTOTYPES ----------------------------------------------
50 
51 // PRIVATE FUNCTION PROTOTYPES ---------------------------------------------
52 
53 // EXTERNAL DATA DECLARATIONS ----------------------------------------------
54 
55 extern refdef_t			refdef;
56 
57 // PUBLIC DATA DEFINITIONS -------------------------------------------------
58 
59 int 					sb_height = 32;
60 
61 // PRIVATE DATA DEFINITIONS ------------------------------------------------
62 
63 // CODE --------------------------------------------------------------------
64 
65 //==========================================================================
66 //
67 //  SB_Init
68 //
69 //==========================================================================
70 
SB_Init()71 void SB_Init()
72 {
73 	sb_height = GClGame->sb_height;
74 }
75 
76 //==========================================================================
77 //
78 //  SB_Ticker
79 //
80 //==========================================================================
81 
SB_Ticker()82 void SB_Ticker()
83 {
84 	if (cls.signon)
85 	{
86 	    GClGame->eventStatusBarUpdateWidgets(host_frametime);
87 	}
88 }
89 
90 //==========================================================================
91 //
92 //	SB_Responder
93 //
94 //==========================================================================
95 
SB_Responder(event_t *)96 bool SB_Responder(event_t *)
97 {
98 	return false;
99 }
100 
101 //==========================================================================
102 //
103 //	SB_Drawer
104 //
105 //==========================================================================
106 
SB_Drawer()107 void SB_Drawer()
108 {
109 	//	Update widget visibility
110 	GClGame->eventStatusBarDrawer(automapactive ? SB_VIEW_AUTOMAP :
111 		refdef.height == ScreenHeight ? SB_VIEW_FULLSCREEN : SB_VIEW_NORMAL);
112 }
113 
114 //==========================================================================
115 //
116 //  SB_Start
117 //
118 //==========================================================================
119 
SB_Start()120 void SB_Start()
121 {
122 	GClGame->eventStatusBarStartMap();
123 }
124