1 /*
2  *	objinfo.h
3  *	AYM 1998-09-20
4  */
5 
6 
7 /*
8 This file is part of Yadex.
9 
10 Yadex incorporates code from DEU 5.21 that was put in the public domain in
11 1994 by Rapha�l Quinet and Brendon Wyber.
12 
13 The rest of Yadex is Copyright � 1997-2003 Andr� Majorel and others.
14 
15 This program is free software; you can redistribute it and/or modify it under
16 the terms of the GNU General Public License as published by the Free Software
17 Foundation; either version 2 of the License, or (at your option) any later
18 version.
19 
20 This program is distributed in the hope that it will be useful, but WITHOUT
21 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
22 FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
23 
24 You should have received a copy of the GNU General Public License along with
25 this program; if not, write to the Free Software Foundation, Inc., 59 Temple
26 Place, Suite 330, Boston, MA 02111-1307, USA.
27 */
28 
29 
30 #include "edwidget.h"
31 
32 
33 class objinfo_c : public edwidget_c
34    {
35    public :
36       objinfo_c ();
set(int obj_type,int obj_no)37       void set (int obj_type, int obj_no)
38       {
39         this->obj_no   = obj_no;
40 	this->obj_type = obj_type;
41       }
42 
set_y1(int y1)43       void set_y1 (int y1)
44 	 { out_y1 = y1; }
45 
46       /* Methods declared in edwidget_c */
unset()47       void unset ()
48 	 { obj_no = OBJ_NO_NONE; }
49 
50       void draw ();
51 
undraw()52       void undraw ()
53          { }  // Sorry, I don't know how to undraw myself
54 
can_undraw()55       int can_undraw ()
56          { return 0; }  // I don't have the ability to undraw myself
57 
need_to_clear()58       int need_to_clear ()
59 	 { return is_obj (obj_no_disp) && ! is_obj (obj_no); }
60 
clear()61       void clear ()
62       {
63 	for (size_t n = 0; n < MAX_BOXES; n++)
64 	  box_disp[n] = false;
65 	obj_no_disp = OBJ_NO_NONE;
66       }
67 
68    private :
69       static const size_t MAX_BOXES = 10;
70       bool box_disp[MAX_BOXES];	// Is the box already drawn ?
71       int obj_no;        // The no. of the object we should display info about
72       int obj_type;      // The type of the object we should display info about
73       int obj_no_disp;	 // The no. and type of the object for which info
74       int obj_type_disp; // is really displayed.
75       int prev_sector;   // No. of the last sector for which info was displayed
76       int prev_floorh;   // Its floor height.
77       int prev_ceilh;    // Its ceiling height.
78       int out_y1;        // The bottom outer edge of the info window.
79    };
80 
81