-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathshared.h
More file actions
224 lines (176 loc) · 5.71 KB
/
shared.h
File metadata and controls
224 lines (176 loc) · 5.71 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
/****************************************************************
shared.h
=============================================================
Copyright 1996-2026 Tom Barbalet. All rights reserved.
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without
restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or
sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following
conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
****************************************************************/
#ifndef SIMULATEDAPE_SHARED_H
#define SIMULATEDAPE_SHARED_H
#include <stdint.h>
#ifndef _WIN32
#include "./toolkit/toolkit.h"
#else
#include ".\toolkit\toolkit.h"
#endif
typedef enum
{
SHARED_CYCLE_OK = 0,
SHARED_CYCLE_QUIT,
SHARED_CYCLE_DEBUG_OUTPUT,
SHARED_CYCLE_NEW_APES
} shared_cycle_state;
#define NUM_VIEW (0)
#define NUM_TERRAIN (1)
#define NUM_CONTROL (2)
#define NUM_NIL (3)
enum
{
NA_MENU_PAUSE = 0,
NA_MENU_WEATHER,
NA_MENU_BRAIN,
NA_MENU_BRAINCODE,
NA_MENU_TIDEDAYLIGHT,
NA_MENU_TERRITORY,
NA_MENU_PREVIOUS_APE,
NA_MENU_NEXT_APE,
NA_MENU_CLEAR_ERRORS,
NA_MENU_FLOOD,
NA_MENU_HEALTHY_CARRIER,
NA_MENU_FOLLOW,
NA_MENU_SOCIAL_WEB
};
void shared_color_8_bit_to_48_bit( n_byte2 *fit );
void shared_dimensions( n_int *dimensions );
n_int shared_init( n_int view, n_uint random );
void shared_close( void );
n_int shared_simulation_started(void);
n_int shared_menu( n_int menuValue );
n_uint shared_max_fps( void );
void shared_rotate( n_double num, n_int wwind );
void shared_delta( n_double delta_x, n_double delta_y, n_int wwind );
void shared_zoom( n_double num, n_int wwind );
void shared_keyReceived( n_int value, n_int localIdentification );
void shared_keyUp( void );
void shared_mouseOption( n_byte option );
void shared_mouseReceived( n_double valX, n_double valY, n_int localIdentification );
void shared_mouseUp( void );
void shared_mouseReceived_ios( n_double valX, n_double valY );
void shared_about( void );
n_byte * shared_draw( n_int fIdentification, n_int dim_x, n_int dim_y, n_byte size_changed );
void shared_draw_ios( n_byte4 *outputBuffer, n_int dim_x, n_int dim_y );
shared_cycle_state shared_cycle( n_uint ticks, n_int localIdentification );
shared_cycle_state shared_cycle_ios( n_uint ticks );
n_byte *shared_legacy_draw( n_byte fIdentification, n_int dim_x, n_int dim_y );
n_int shared_new( n_uint seed );
n_int shared_new_agents( n_uint seed );
n_byte shared_openFileName( n_constant_string cStringFileName, n_int isScript );
void shared_saveFileName( n_constant_string cStringFileName );
void shared_script_debug_handle( n_constant_string cStringFileName );
void shared_process(const char* fileUrl);
n_int shared_being_number( void );
void shared_being_name( n_int number, n_string name );
void shared_being_select( n_int number);
typedef struct
{
int32_t index;
float x;
float y;
float z;
float facing;
float energy;
float age_days;
float height;
float mass;
uint8_t speaking;
uint8_t female;
uint8_t pregnant;
uint8_t pigmentation;
uint8_t hair;
uint8_t frame;
uint8_t eye_color;
uint8_t eye_shape;
uint16_t state;
uint8_t carrying_child;
uint8_t goal_type;
uint8_t honor;
uint8_t social_friend_foe;
uint8_t social_attraction;
uint16_t social_familiarity;
uint8_t social_relationship;
uint8_t territory_familiarity;
uint8_t observer_territory_familiarity;
uint8_t episodic_event;
uint8_t episodic_recency;
uint8_t episodic_firsthand;
uint8_t episodic_intention;
int16_t episodic_affect;
uint8_t drive_hunger;
uint8_t drive_social;
uint8_t drive_fatigue;
uint8_t drive_sex;
} shared_immersiveape_being_snapshot;
typedef struct
{
float x;
float y;
float z;
float intensity;
uint8_t food_type;
uint8_t vegetation;
uint8_t rain;
uint8_t reserved;
} shared_immersiveape_food_snapshot;
typedef struct
{
int32_t has_selection;
int32_t selected_index;
uint32_t date;
uint32_t time;
uint32_t world_seed;
float daylight;
float sun_angle;
float tide;
float water_level;
uint8_t weather;
uint8_t nearby_count;
uint8_t food_count;
uint8_t reserved0;
shared_immersiveape_being_snapshot selected;
} shared_immersiveape_scene_snapshot;
int32_t shared_immersiveape_capture_scene(
shared_immersiveape_scene_snapshot *scene,
shared_immersiveape_being_snapshot *nearby,
int32_t max_nearby,
shared_immersiveape_food_snapshot *food,
int32_t max_food );
void shared_immersiveape_fill_terrain_patch(
int32_t center_x,
int32_t center_y,
int32_t half_extent,
int32_t resolution,
float *heights,
uint8_t *materials,
uint8_t *clouds,
float *water_heights );
#ifndef _WIN32
n_int sim_thread_console_quit( void );
void sim_thread_console( void );
#endif
#endif /* SIMULATEDAPE_SHARED_H */