Noble Ape
The Central Directories of the Noble Ape Simulation.
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros
gui.h
Go to the documentation of this file.
1 /****************************************************************
2 
3  gui.h
4 
5  =============================================================
6 
7  Copyright 1996-2014 Tom Barbalet. All rights reserved.
8 
9  Permission is hereby granted, free of charge, to any person
10  obtaining a copy of this software and associated documentation
11  files (the "Software"), to deal in the Software without
12  restriction, including without limitation the rights to use,
13  copy, modify, merge, publish, distribute, sublicense, and/or
14  sell copies of the Software, and to permit persons to whom the
15  Software is furnished to do so, subject to the following
16  conditions:
17 
18  The above copyright notice and this permission notice shall be
19  included in all copies or substantial portions of the Software.
20 
21  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
22  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
23  OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
24  NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
25  HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
26  WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
27  FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
28  OTHER DEALINGS IN THE SOFTWARE.
29 
30  This software and Noble Ape are a continuing work of Tom Barbalet,
31  begun on 13 June 1996. No apes or cats were harmed in the writing
32  of this software.
33 
34  ****************************************************************/
35 
36 #ifndef NOBLEAPE_GUI_H
37 #define NOBLEAPE_GUI_H
38 
39 #ifndef _WIN32
40 
41 #include "../noble/noble.h"
42 #include "../universe/universe.h"
43 #include "../entity/entity.h"
44 
45 #else
46 
47 #include "..\noble\noble.h"
48 #include "..\universe\universe.h"
49 #include "..\entity\entity.h"
50 
51 #endif
52 
53 #undef MULTITOUCH_CONTROLS
54 
55 #define TERRAINWINDOW(alpha) (alpha)
56 #define VIEWWINDOW(alpha) (alpha + TERRAIN_WINDOW_AREA)
57 
58 #ifndef GRAPHLESS_GUI
59 #define GRAPHWINDOW(alpha) (alpha + (MAP_AREA + TERRAIN_WINDOW_AREA))
60 #endif
61 
62 #define IS_WINDOW_KIND(x,y) (((x)>>(y))&1)
63 
65 {
66  COLOUR_GREY = (252),
67  COLOUR_YELLOW = (253),
68  COLOUR_RED_DARK = (254),
69  COLOUR_RED = (255)
70 };
71 
72 enum
73 {
85 };
86 
87 #define NON_INTERPOLATED COLOUR_GREY
88 
89 #define spot_colour(alpha,spx,spy,col) alpha[((spx)|((spy)<<8))]=(col)
90 
91 /* Graphics Metrics */
92 
93 /* Icon Offset */
94 #define ICONOFFSET 27
95 
96 #ifdef MULTITOUCH_CONTROLS
97 
98 typedef enum
99 {
100  TCS_SHOW_NOTHING = 0,
101  TCS_SHOW_CONTROLS,
102  TCS_LEFT_STATE,
103  TCS_LEFT_STATE_CONTROLS,
104  TCS_RIGHT_STATE,
105  TCS_RIGHT_STATE_CONTROLS
106 }touch_control_state;
107 
108 #define TC_OFFSET_Y (40)
109 #define TC_FRACTION_X (40)
110 
111 #endif
112 
113 /*
114  n_uint braincode_standard_deviation(noble_being * local_being);
115  void braincode_number_of_instructions(
116  noble_being * local_being,
117  n_int * no_of_sensors,
118  n_int * no_of_actuators,
119  n_int * no_of_operators,
120  n_int * no_of_conditionals,
121  n_int * no_of_data);
122  */
123 /* graph functions */
124 /*void graph_line(n_byte * buffer, n_int img_width, n_int img_height, n_int prev_x, n_int prev_y, n_int x, n_int y, n_byte r,n_byte g,n_byte b,n_byte thickness);*/
125 void graph_honor_distribution(noble_simulation * sim, n_byte update_type, n_byte * buffer, n_int img_width, n_int img_height);
126 void graph_ideosphere(noble_simulation * sim, n_byte * buffer, n_int img_width, n_int img_height);
127 void graph_genepool(noble_simulation * sim, n_byte * buffer, n_int img_width, n_int img_height);
128 void graph_relationship_matrix(noble_simulation * sim, n_byte * buffer, n_int img_width, n_int img_height);
129 void graph_pathogens(noble_simulation * sim, n_byte update_type, n_byte * buffer, n_int img_width, n_int img_height);
130 void graph_age_demographic(noble_simulation * sim, n_byte * buffer, n_int img_width, n_int img_height);
131 void graph_heights(noble_simulation * sim, n_byte * buffer, n_int img_width, n_int img_height);
132 void graph_phasespace(noble_simulation * sim, n_byte update_type, n_byte * buffer, n_int img_width, n_int img_height, n_byte graph_type, n_byte data_type);
133 void graph_braincode(noble_simulation * sim, noble_being * local_being, n_byte * buffer, n_int img_width, n_int img_height, n_byte clear);
134 
135 void graph_preferences(noble_simulation * sim, n_byte update_type, n_byte * buffer, n_int img_width, n_int img_height);
136 void graph_vascular(noble_being * being,
137  n_byte * buffer,
138  n_int img_width, n_int img_height,
139  n_int tx, n_int ty, n_int bx, n_int by,
140  n_byte thickness,
141  n_byte clear,
142  n_int shoulder_angle, n_int elbow_angle, n_int wrist_angle,
143  n_int hip_angle, n_int knee_angle,
144  n_byte show_skeleton_keypoints);
145 void graph_socialsim(noble_simulation * sim, n_byte update_type, n_byte * buffer, n_int img_width, n_int img_height);
146 void graph_meet_places(noble_simulation * sim, n_byte update_type, n_byte * buffer, n_int img_width, n_int img_height);
147 
149 
151 
153 
155 
157 
158 void draw_fit(n_byte * points, n_byte2 * color_fit);
159 
160 void draw_terrain_coord(n_int * co_x, n_int * co_y);
161 
162 extern n_byte land_points[];
163 
164 void draw_color_time(n_byte2 * color_fit, n_byte2 time);
165 
166 void draw_undraw_clear(void);
167 
168 n_byte * draw_pointer(n_byte which_one);
169 
171 
172 void draw_about(n_constant_string platform);
173 
174 void draw_string(n_constant_string str, n_int off_x, n_int off_y, n_join * draw);
175 
176 void draw_window(n_int dim_x, n_int dim_y);
177 
178 n_int draw_cycle(void);
179 
180 n_byte * draw_offscreen(n_byte * value);
181 
182 #endif /* NOBLEAPE_GUI_H */
183