]> cvs.zerfleddert.de Git - micropolis/blame - src/sim/headers/sim.h
XINCLUDE: use /usr/X11R6/include everywhere
[micropolis] / src / sim / headers / sim.h
CommitLineData
6a5fa4e0
MG
1/* sim.h: Main include file
2 *
3 * Micropolis, Unix Version. This game was released for the Unix platform
4 * in or about 1990 and has been modified for inclusion in the One Laptop
5 * Per Child program. Copyright (C) 1989 - 2007 Electronic Arts Inc. If
6 * you need assistance with this program, you may contact:
7 * http://wiki.laptop.org/go/Micropolis or email micropolis@laptop.org.
8 *
9 * This program is free software: you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation, either version 3 of the License, or (at
12 * your option) any later version.
13 *
14 * This program is distributed in the hope that it will be useful, but
15 * WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * General Public License for more details. You should have received a
18 * copy of the GNU General Public License along with this program. If
19 * not, see <http://www.gnu.org/licenses/>.
20 *
21 * ADDITIONAL TERMS per GNU GPL Section 7
22 *
23 * No trademark or publicity rights are granted. This license does NOT
24 * give you any right, title or interest in the trademark SimCity or any
25 * other Electronic Arts trademark. You may not distribute any
26 * modification of this program using the trademark SimCity or claim any
27 * affliation or association with Electronic Arts Inc. or its employees.
28 *
29 * Any propagation or conveyance of this program must include this
30 * copyright notice and these terms.
31 *
32 * If you convey this program (or any modifications of it) and assume
33 * contractual liability for the program to recipients of it, you agree
34 * to indemnify Electronic Arts for any liability that those contractual
35 * assumptions impose on Electronic Arts.
36 *
37 * You may not misrepresent the origins of this program; modified
38 * versions of the program must be marked as such and not identified as
39 * the original program.
40 *
41 * This disclaimer supplements the one included in the General Public
42 * License. TO THE FULLEST EXTENT PERMISSIBLE UNDER APPLICABLE LAW, THIS
43 * PROGRAM IS PROVIDED TO YOU "AS IS," WITH ALL FAULTS, WITHOUT WARRANTY
44 * OF ANY KIND, AND YOUR USE IS AT YOUR SOLE RISK. THE ENTIRE RISK OF
45 * SATISFACTORY QUALITY AND PERFORMANCE RESIDES WITH YOU. ELECTRONIC ARTS
46 * DISCLAIMS ANY AND ALL EXPRESS, IMPLIED OR STATUTORY WARRANTIES,
47 * INCLUDING IMPLIED WARRANTIES OF MERCHANTABILITY, SATISFACTORY QUALITY,
48 * FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT OF THIRD PARTY
49 * RIGHTS, AND WARRANTIES (IF ANY) ARISING FROM A COURSE OF DEALING,
50 * USAGE, OR TRADE PRACTICE. ELECTRONIC ARTS DOES NOT WARRANT AGAINST
51 * INTERFERENCE WITH YOUR ENJOYMENT OF THE PROGRAM; THAT THE PROGRAM WILL
52 * MEET YOUR REQUIREMENTS; THAT OPERATION OF THE PROGRAM WILL BE
53 * UNINTERRUPTED OR ERROR-FREE, OR THAT THE PROGRAM WILL BE COMPATIBLE
54 * WITH THIRD PARTY SOFTWARE OR THAT ANY ERRORS IN THE PROGRAM WILL BE
55 * CORRECTED. NO ORAL OR WRITTEN ADVICE PROVIDED BY ELECTRONIC ARTS OR
56 * ANY AUTHORIZED REPRESENTATIVE SHALL CREATE A WARRANTY. SOME
57 * JURISDICTIONS DO NOT ALLOW THE EXCLUSION OF OR LIMITATIONS ON IMPLIED
58 * WARRANTIES OR THE LIMITATIONS ON THE APPLICABLE STATUTORY RIGHTS OF A
59 * CONSUMER, SO SOME OR ALL OF THE ABOVE EXCLUSIONS AND LIMITATIONS MAY
60 * NOT APPLY TO YOU.
61 */
62
63/* workaround sun c compiler junk */
64
65#ifdef sun
66
67#define _TTYCHARS_
68#define CTRL(c) (#c[0]&037)
69
70#ifndef SOLARIS2
71#define __sys_ioccom_h
72#define _IOCPARM_MASK 0xff /* parameters must be < 256 bytes */
73#define _IOC_VOID 0x20000000 /* no parameters */
74#define _IOC_OUT 0x40000000 /* copy out parameters */
75#define _IOC_IN 0x80000000 /* copy in parameters */
76#define _IOC_INOUT (_IOC_IN|_IOC_OUT)
77#define _IO(x,y) (_IOC_VOID|(#x[0]<<8)|y)
78#define _IOR(x,y,t) (_IOC_OUT|((sizeof(t)&_IOCPARM_MASK)<<16)|(#x[0]<<8)|y)
79#define _IORN(x,y,t) (_IOC_OUT|(((t)&_IOCPARM_MASK)<<16)|(#x[0]<<8)|y)
80#define _IOW(x,y,t) (_IOC_IN|((sizeof(t)&_IOCPARM_MASK)<<16)|(#x[0]<<8)|y)
81#define _IOWN(x,y,t) (_IOC_IN|(((t)&_IOCPARM_MASK)<<16)|(#x[0]<<8)|y)
82#define _IOWR(x,y,t) (_IOC_INOUT|((sizeof(t)&_IOCPARM_MASK)<<16)|(#x[0]<<8)|y)
83#define _IOWRN(x,y,t) (_IOC_INOUT|(((t)&_IOCPARM_MASK)<<16)|(#x[0]<<8)|y)
84#endif
85
86#endif
87
88
89#include <stdio.h>
90#include <stdlib.h>
91#include <assert.h>
92#include <ctype.h>
93#include <setjmp.h>
6a5fa4e0
MG
94#include <errno.h>
95#include <signal.h>
96#include <math.h>
97#include <unistd.h>
98#include <sys/types.h>
99#include <sys/time.h>
100#include <sys/stat.h>
101#include <sys/file.h>
102#include <sys/ioctl.h>
103#include <sys/resource.h>
104#ifndef MSDOS
6a5fa4e0
MG
105#include <sys/mman.h>
106#include <netinet/in.h>
107#include <arpa/inet.h>
108#endif
109
110#ifdef sun
945f1bf1 111#ifdef __SVR4
6a5fa4e0
MG
112#include <sys/systeminfo.h>
113#else
114#include <sys/vadvise.h>
115#endif
116#endif
117
118#ifdef sgi
119#if 0
120#include <audio.h>
121#endif
122#endif
123
124#include <sys/ipc.h>
125#include <sys/shm.h>
126#include <X11/Xlib.h>
127#include <X11/Xutil.h>
128#include <X11/Xatom.h>
129#include <X11/extensions/XShm.h>
130
131//#include <xpmtk.h>
132#include <X11/xpm.h>
133
134/* gcc compat workaround! */
135#define _STDDEF_H
136
137#include "tclxtend.h"
138#include "tclint.h"
139#include "tclunix.h"
140#include "tkconfig.h"
141#include "tkint.h"
142
143#include "mac.h"
144#include "view.h"
145#include "macros.h"
146
147/* Constants */
148
149#define TRUE 1
150#define FALSE 0
151
152#ifdef MEGA
153#define SimWidth (120 * MEGA)
154#define SimHeight (100 * MEGA)
155#else
156#define SimWidth 120
157#define SimHeight 100
158#endif
159
160#define WORLD_X SimWidth
161#define WORLD_Y SimHeight
162#define HWLDX (SimWidth >>1)
163#define HWLDY (SimHeight >>1)
164#define QWX (SimWidth >>2)
165#define QWY (SimHeight >>2)
166#define SmX (SimWidth >>3)
167#define SmY ((SimHeight + 7) >>3)
168
169#define EDITOR_W (WORLD_X * 16)
170#define EDITOR_H (WORLD_Y * 16)
171#define MAP_W (WORLD_X * 3)
172#define MAP_H (WORLD_Y * 3)
173
174#define NIL 0
175#define HORIZ 1
176#define VERT 0
177
178#define PROBNUM 10
179
180#define HISTLEN 480
181#define MISCHISTLEN 240
182
183#define POWERMAPROW ((WORLD_X + 15) / 16)
184
185#ifdef MEGA
186#define POWERMAPLEN ((QUAD)(2 * POWERMAPROW * WORLD_Y))
187#define POWERWORD(x, y) ((((QUAD)(x)) >>4) + (((QUAD)(y)) * POWERMAPROW))
188#else
189#define POWERMAPLEN 1700 /* ??? PWRMAPSIZE */
190#define POWERWORD(x, y) (((x) >>4) + ((y) <<3))
191#endif
192
193#define SETPOWERBIT(x, y) PowerMap[POWERWORD((x), (y))] |= 1 << ((x) & 15)
194#define PWRMAPSIZE (POWERMAPROW * WORLD_Y)
195#define PWRSTKSIZE ((WORLD_X * WORLD_Y) / 4)
196
197#define ALMAP 0 /* all */
198#define REMAP 1 /* residential */
199#define COMAP 2 /* commercial */
200#define INMAP 3 /* industrial */
201
202#define PRMAP 4 /* power */
203#define RDMAP 5 /* road */
204
205#define PDMAP 6 /* population density */
206#define RGMAP 7 /* rate of growth */
207
208#define TDMAP 8 /* traffic density */
209#define PLMAP 9 /* pollution */
210#define CRMAP 10 /* crime */
211#define LVMAP 11 /* land value */
212
213#define FIMAP 12 /* fire radius */
214#define POMAP 13 /* police radius */
215#define DYMAP 14 /* dynamic */
216
217#define NMAPS 15
218
219/* These adjust frequency in Simulate() */
220
221#define VALVERATE 2
222#define CENSUSRATE 4
223#define TAXFREQ 48
224
225/* These are names of the 16 colors */
226#define COLOR_WHITE 0
227#define COLOR_YELLOW 1
228#define COLOR_ORANGE 2
229#define COLOR_RED 3
230#define COLOR_DARKRED 4
231#define COLOR_DARKBLUE 5
232#define COLOR_LIGHTBLUE 6
233#define COLOR_BROWN 7
234#define COLOR_LIGHTGREEN 8
235#define COLOR_DARKGREEN 9
236#define COLOR_OLIVE 10
237#define COLOR_LIGHTBROWN 11
238#define COLOR_LIGHTGRAY 12
239#define COLOR_MEDIUMGRAY 13
240#define COLOR_DARKGRAY 14
241#define COLOR_BLACK 15
242
243/* Status Bits */
244
245#define PWRBIT 32768 /*20 bit 15 */
246#define CONDBIT 16384 /*10 bit 14 */
247#define BURNBIT 8192 /*8 bit 13 */
248#define BULLBIT 4096 /*4 bit 12 */
249#define ANIMBIT 2048 /*2 bit 11 */
250#define ZONEBIT 1024 /*1 bit 10 */
251#define ALLBITS 64512 /* mask for upper 6 bits */
252#define LOMASK 1023 /* mask for low 10 bits */
253
254#define BLBNBIT (BULLBIT+BURNBIT)
255#define BLBNCNBIT (BULLBIT+BURNBIT+CONDBIT)
256#define BNCNBIT (BURNBIT+CONDBIT)
257
258/* Object & Sound Numbers */
259
260#define TRA 1
261#define COP 2
262#define AIR 3
263#define SHI 4
264#define GOD 5
265#define TOR 6
266#define EXP 7
267#define BUS 8
268
269/* Max # of Objects */
270
271#define OBJN 9
272
273/* Graph Histories */
274#define RES_HIST 0
275#define COM_HIST 1
276#define IND_HIST 2
277#define MONEY_HIST 3
278#define CRIME_HIST 4
279#define POLLUTION_HIST 5
280#define HISTORIES 6
281#define ALL_HISTORIES ((1 <<HISTORIES) - 1)
282
283/* Character Mapping */
284
285#define DIRT 0
286#define RIVER 2
287#define REDGE 3
288#define CHANNEL 4
289#define FIRSTRIVEDGE 5
290#define LASTRIVEDGE 20
291#define TREEBASE 21
292#define LASTTREE 36
293#define WOODS 37
294#define UNUSED_TRASH1 38
295#define UNUSED_TRASH2 39
296#define WOODS2 40
297#define WOODS3 41
298#define WOODS4 42
299#define WOODS5 43
300#define RUBBLE 44
301#define LASTRUBBLE 47
302#define FLOOD 48
303#define LASTFLOOD 51
304#define RADTILE 52
305#define UNUSED_TRASH3 53
306#define UNUSED_TRASH4 54
307#define UNUSED_TRASH5 55
308#define FIRE 56
309#define FIREBASE 56
310#define LASTFIRE 63
311#define ROADBASE 64
312#define HBRIDGE 64
313#define VBRIDGE 65
314#define ROADS 66
315#define INTERSECTION 76
316#define HROADPOWER 77
317#define VROADPOWER 78
318#define BRWH 79
319#define LTRFBASE 80
320#define BRWV 95
321#define BRWXXX1 111
322#define BRWXXX2 127
323#define BRWXXX3 143
324#define HTRFBASE 144
325#define BRWXXX4 159
326#define BRWXXX5 175
327#define BRWXXX6 191
328#define LASTROAD 206
329#define BRWXXX7 207
330#define POWERBASE 208
331#define HPOWER 208
332#define VPOWER 209
333#define LHPOWER 210
334#define LVPOWER 211
335#define RAILHPOWERV 221
336#define RAILVPOWERH 222
337#define LASTPOWER 222
338#define UNUSED_TRASH6 223
339#define RAILBASE 224
340#define HRAIL 224
341#define VRAIL 225
342#define LHRAIL 226
343#define LVRAIL 227
344#define HRAILROAD 237
345#define VRAILROAD 238
346#define LASTRAIL 238
347#define ROADVPOWERH 239 /* bogus? */
348#define RESBASE 240
349#define FREEZ 244
350#define HOUSE 249
351#define LHTHR 249
352#define HHTHR 260
353#define RZB 265
354#define HOSPITAL 409
355#define CHURCH 418
356#define COMBASE 423
357#define COMCLR 427
358#define CZB 436
359#define INDBASE 612
360#define INDCLR 616
361#define LASTIND 620
362#define IND1 621
363#define IZB 625
364#define IND2 641
365#define IND3 644
366#define IND4 649
367#define IND5 650
368#define IND6 676
369#define IND7 677
370#define IND8 686
371#define IND9 689
372#define PORTBASE 693
373#define PORT 698
374#define LASTPORT 708
375#define AIRPORTBASE 709
376#define RADAR 711
377#define AIRPORT 716
378#define COALBASE 745
379#define POWERPLANT 750
380#define LASTPOWERPLANT 760
381#define FIRESTBASE 761
382#define FIRESTATION 765
383#define POLICESTBASE 770
384#define POLICESTATION 774
385#define STADIUMBASE 779
386#define STADIUM 784
387#define FULLSTADIUM 800
388#define NUCLEARBASE 811
389#define NUCLEAR 816
390#define LASTZONE 826
391#define LIGHTNINGBOLT 827
392#define HBRDG0 828
393#define HBRDG1 829
394#define HBRDG2 830
395#define HBRDG3 831
396#define RADAR0 832
397#define RADAR1 833
398#define RADAR2 834
399#define RADAR3 835
400#define RADAR4 836
401#define RADAR5 837
402#define RADAR6 838
403#define RADAR7 839
404#define FOUNTAIN 840
405#define INDBASE2 844
406#define TELEBASE 844
407#define TELELAST 851
408#define SMOKEBASE 852
409#define TINYEXP 860
410#define SOMETINYEXP 864
411#define LASTTINYEXP 867
412#define COALSMOKE1 916
413#define COALSMOKE2 920
414#define COALSMOKE3 924
415#define COALSMOKE4 928
416#define FOOTBALLGAME1 932
417#define FOOTBALLGAME2 940
418#define VBRDG0 948
419#define VBRDG1 949
420#define VBRDG2 950
421#define VBRDG3 951
422
423#define TILE_COUNT 960
424
425/*
426 * These describe the wand values, the object dragged around on the screen.
427 */
428
429#define residentialState 0
430#define commercialState 1
431#define industrialState 2
432#define fireState 3
433#define queryState 4
434#define policeState 5
435#define wireState 6
436#define dozeState 7
437#define rrState 8
438#define roadState 9
439#define chalkState 10
440#define eraserState 11
441#define stadiumState 12
442#define parkState 13
443#define seaportState 14
444#define powerState 15
445#define nuclearState 16
446#define airportState 17
447#define networkState 18
448
449
450#define firstState residentialState
451#define lastState networkState
452
453#if 0
454#define specialState 16
455#define monsterGoalState 17
456#define helicopterGoalState 18
457#define blackState 19
458#define whiteState 20
459#define redState 21
460#define orangeState 23
461#define blueState 24
462#define greenState 25
463#define brownState 26
464#endif
465
466
467#define STATE_CMD 0
468#define STATE_TILES 1
469#define STATE_OVERLAYS 2
470#define STATE_GRAPHS 3
471
472
473extern short *Map[WORLD_X]; /* Main Map 120 x 100 */
474extern Byte *PopDensity[HWLDX]; /* 2X2 Maps 60 x 50 */
475extern Byte *TrfDensity[HWLDX];
476extern Byte *PollutionMem[HWLDX];
477extern Byte *LandValueMem[HWLDX];
478extern Byte *CrimeMem[HWLDX];
479extern Byte *tem[HWLDX];
480extern Byte *tem2[HWLDX];
481extern Byte *TerrainMem[QWX]; /* 4X4 Maps 30 x 25 */
482extern Byte *Qtem[QWX];
483extern short RateOGMem[SmX][SmY];
484extern short FireStMap[SmX][SmY]; /* 8X8 Maps 15 x 13 */
485extern short PoliceMap[SmX][SmY];
486extern short PoliceMapEffect[SmX][SmY];
487extern short ComRate[SmX][SmY];
488extern short FireRate[SmX][SmY];
489extern short STem[SmX][SmY];
490extern short SpriteXOffset[OBJN];
491extern short SpriteYOffset[OBJN];
492extern short SMapX, SMapY;
493extern short CChr, CChr9;
494extern short RoadTotal, RailTotal, FirePop;
495extern short ResPop, ComPop, IndPop, TotalPop, LastTotalPop;
496extern short ResZPop, ComZPop, IndZPop, TotalZPop;
497extern short HospPop, ChurchPop, StadiumPop;
498extern short PolicePop, FireStPop;
499extern short CoalPop, NuclearPop, PortPop, APortPop;
500extern short NeedHosp, NeedChurch;
501extern short CrimeAverage, PolluteAverage, LVAverage;
502extern char *MicropolisVersion;
503extern char *CityName;
504extern char *CityFileName;
505extern char *StartupName;
506extern short StartingYear;
507extern QUAD CityTime;
508extern QUAD LastCityTime;
509extern QUAD LastCityMonth;
510extern QUAD LastCityYear;
511extern QUAD LastFunds;
512extern QUAD LastR, LastC, LastI;
513extern short GameLevel;
514extern short Cycle;
515extern short ScenarioID;
516extern short ShakeNow;
517extern QUAD DonDither;
518extern int DoOverlay;
519
520extern short *ResHis, ResHisMax;
521extern short *ComHis, ComHisMax;
522extern short *IndHis, IndHisMax;
523extern short *MoneyHis, *CrimeHis, *PollutionHis, *MiscHis;
524extern short *PowerMap;
525
526extern float roadPercent, policePercent, firePercent;
527extern QUAD RoadSpend, PoliceSpend, FireSpend;
528extern QUAD roadMaxValue, policeMaxValue, fireMaxValue;
529extern QUAD TaxFund, RoadFund, PoliceFund, FireFund;
530extern short RoadEffect, PoliceEffect, FireEffect;
531extern short TaxFlag, CityTax;
532extern QUAD TotalFunds;
533
534extern QUAD costOf[];
535
536extern short flagBlink;
537extern unsigned char tileSynch;
538extern short aniTile[];
539extern unsigned char aniSynch[];
540extern int TilesAnimated;
541extern int DoAnimation;
542extern int DoMessages;
543extern int DoNotices;
544extern unsigned char ColorIntensities[];
545
546extern short MesX, MesY;
547extern short MesNum, MessagePort;
548extern QUAD LastMesTime;
549
550extern short SimSpeed;
551extern short SimMetaSpeed;
552extern short NoDisasters;
553extern short autoBulldoze;
554extern short autoBudget;
555extern short autoGo;
556extern short UserSoundOn;
557
558extern short DisasterEvent;
559extern short DisasterWait;
560
561extern short ResCap, ComCap, IndCap;
562extern short RValve, CValve, IValve;
563extern short PwrdZCnt;
564extern short unPwrdZCnt;
565
566extern char *HomeDir, *ResourceDir, *HostName;
567
568extern short Graph10Max, Graph120Max;
569extern short Res2HisMax, Com2HisMax, Ind2HisMax;
570extern unsigned char *History10[HISTORIES], *History120[HISTORIES];
571extern short CityScore;
572extern short deltaCityScore;
573extern short ScoreType;
574extern short ScoreWait;
575extern short CityClass;
576extern short PolMaxX, PolMaxY;
577extern int PowerStackNum;
578extern short TrafficAverage;
579extern short PosStackN;
580extern short SMapXStack[], SMapYStack[];
581extern short Zsource;
582extern short HaveLastMessage;
583extern short PdestX, PdestY;
584extern short CdestX, CdestY;
585extern int absDist;
586extern short CopFltCnt;
587extern short GodCnt;
588extern short GdestX, GdestY;
589extern short GorgX, GorgY;
590extern short GodControl;
591extern short CopControl;
592extern short CdestX, CdestY;
593extern short TrafMaxX, TrafMaxY;
594extern short CrimeMaxX, CrimeMaxY;
595extern short FloodX, FloodY;
596extern short CrashX, CrashY;
597extern short CCx, CCy;
598extern QUAD CityPop, deltaCityPop;
599extern char *cityClassStr[6];
600extern short CityYes, CityNo;
601extern short ProblemTable[PROBNUM];
602extern short ProblemVotes[PROBNUM];
603extern short ProblemOrder[4];
604extern QUAD CityAssValue;
605
606extern short InitSimLoad;
607extern short DoInitialEval;
608extern int Startup;
609extern int StartupGameLevel;
610extern int PerformanceTiming;
611extern double FlushTime;
612
613extern char *optarg;
614extern int optind;
615extern struct timeval start_time, now_time, beat_time, last_now_time;
616extern Sim *sim;
617extern int WireMode;
618extern int MultiPlayerMode;
619extern int SugarMode;
620extern int sim_delay;
621extern int sim_skips;
622extern int sim_skip;
623extern int sim_paused;
624extern int sim_paused_speed;
625extern int sim_tty;
626#ifdef CAM
627extern int sim_just_cam;
628#endif
629extern int heat_steps;
630extern int heat_flow;
631extern int heat_rule;
632extern int UpdateDelayed;
633extern int DynamicData[32];
634extern int Players;
635extern int Votes;
636extern int BobHeight;
637extern int OverRide;
638extern int Expensive;
639extern int PendingTool;
640extern int PendingX;
641extern int PendingY;
642extern int TreeLevel;
643extern int LakeLevel;
644extern int CurveLevel;
645extern int CreateIsland;
646extern short specialBase;
647extern short PunishCnt;
648extern short Dozing;
649extern short toolSize[];
650extern short toolOffset[];
651extern QUAD toolColors[];
652extern char *Displays;
653extern char *FirstDisplay;
654extern char *dateStr[12];
655
656extern short NewMap;
657extern short NewMapFlags[NMAPS];
658extern short NewGraph;
659extern short ValveFlag;
660extern short MustUpdateFunds;
661extern short MustUpdateOptions;
662extern short CensusChanged;
663extern short EvalChanged;
664extern short MeltX, MeltY;
665extern int NeedRest;
666extern int ExitReturn;
667
668extern Tcl_Interp *tk_mainInterp;
669extern Tk_Window MainWindow;
670extern int FlushStyle;
671extern int GotXError;
672
673extern short Rand(short range);
674extern short RandInt(void);
675
676extern Sim *MakeNewSim();
677extern SimView *MakeNewView();
678extern SimSprite *GetSprite();
679extern SimSprite *MakeSprite();
680extern SimSprite *MakeNewSprite();
681
6a5fa4e0 682extern struct XDisplay *XDisplays;
6f214ac0
MG
683
684/* Functions referenced from other files */
685/* g_ani.c */
686void animateTiles(void);
687/* g_bigmap.c */
688void WireDrawBeegMapRect(SimView *view, short x, short y, short w, short h);
689void MemDrawBeegMapRect(SimView *view, int x, int y, int w, int h);
690/* g_map.c */
691void setUpMapProcs(void);
692void MemDrawMap(SimView *view);
693/* g_setup.c */
694void GetViewTiles(SimView *view);
695void GetPixmaps(XDisplay *xd);
696/* g_smmaps.c */
697void drawAll(SimView *view);
698void drawRes(SimView *view);
699void drawCom(SimView *view);
700void drawInd(SimView *view);
701void drawLilTransMap(SimView *view);
702void drawPower(SimView *view);
703void drawDynamic(SimView *view);
704/* rand.c */
705int sim_rand(void);
706void sim_srand(u_int seed);
707/* sim.c */
708void sim_exit(int val);
709void sim_update_editors(void);
710void sim_update(void);
711void sim_init(void);
712void sim_really_exit(int val);
713void sim_loop(int doSim);
714/* s_alloc.c */
715void initMapArrays(void);
716/* s_disast.c */
717void DoDisasters(void);
718void DoFlood(void);
719void MakeFlood(void);
720void MakeEarthquake(void);
721void MakeMeltdown(void);
722void MakeFire(void);
723void FireBomb(void);
724/* s_eval.c */
725void EvalInit(void);
726void CityEvaluation(void);
727int GetFire(void);
728int GetUnemployment(void);
729int AverageTrf(void);
730/* s_fileio.c */
731int LoadCity(char *filename);
732void SaveCity(void);
733void SaveCityAs(char *filename);
734void LoadScenario(short s);
735/* s_gen.c */
736void ClearMap(void);
737void SmoothTrees(void);
738void SmoothRiver(void);
739void GenerateSomeCity(int r);
740void ClearUnnatural(void);
741void SmoothWater(void);
742void GenerateNewCity(void);
743/* s_init.c */
744void ResetMapState(void);
745void ResetEditorState(void);
746void InitWillStuff(void);
747/* s_msg.c */
748void SendMessages(void);
749void SendMesAt(short Mnum, short x, short y);
750void ClearMes(void);
751int SendMes(int Mnum);
752void SendMesAt(short Mnum, short x, short y);
753void doMessage(void);
754/* s_power.c */
755void PushPowerStack(void);
756void DoPowerScan(void);
757int MoveMapSim (short MDir);
758/* s_scan.c */
759void FireAnalysis(void);
760void PopDenScan(void);
761void CrimeScan(void);
762void PTLScan(void);
763/* s_sim.c */
764void SimFrame(void);
765void DoSimInit(void);
766void SeedRand(int seed);
767void DoMeltdown(int SX, int SY);
768void FireZone(int Xloc, int Yloc, int ch);
769int Rand16(void);
770int Rand16Signed(void);
771void RandomlySeedRand();
772void RepairZone(short ZCent, short zsize);
773void DoSPZone(short PwrOn);
774void UpdateFundEffects(void);
775/* s_traf.c */
776int FindPRoad(void);
777int MakeTraf(int Zt);
778/* s_zone.c */
779void DoZone(void);
780int SetZPower(void);
781int RZPop(int Ch9);
782int CZPop(int Ch9);
783int IZPop(int Ch9);
784int DoFreePop (void);
785/* w_budget.c */
786void UpdateBudgetWindow(void);
787void InitFundingLevel(void);
788void drawCurrPercents(void);
789void DoBudget(void);
790void drawBudgetWindow(void);
791void DoBudgetFromMenu(void);
792void UpdateBudget(void);
793/* w_con.c */
794int ConnecTile(short x, short y, short *TileAdrPtr, short Command);
795/* w_date.c */
796void date_command_init(void);
797/* w_editor.c */
798void DoUpdateEditor(SimView *view);
799void editor_command_init(void);
800void DoNewEditor(SimView *view);
801/* w_eval.c */
802void scoreDoer(void);
803void ChangeEval(void);
804/* w_graph.c */
805void graphDoer(void);
806void initGraphs(void);
807void ChangeCensus(void);
808void doAllGraphs(void);
809void DestroyGraph(SimGraph *graph);
810void InitGraphMax(void);
811void graph_command_init(void);
812int ConfigureSimGraph(Tcl_Interp *interp, SimGraph *graph, int argc, char **argv, int flags);
813/* w_keys.c */
814void ResetLastKeys(void);
815void doKeyUp(SimView *view, short charCode);
816void doKeyDown(SimView *view, short charCode);
817/* w_map.c */
818int DoUpdateMap(SimView *view);
819void map_command_init(void);
820void DoNewMap(SimView *view);
821/* w_resrc.c */
822void GetIndString(char *str, int id, short num);
823/* w_sim.c */
824void sim_command_init(void);
825/* w_sound.c */
826void InitializeSound(void);
827void MakeSound(char *channel, char *id);
828void MakeSoundOn(SimView *view, char *channel, char *id);
829void SoundOff(void);
830void StartBulldozer(void);
831void StopBulldozer(void);
832void sound_command_init(void);
833/* w_sprite.c */
834void MoveObjects(void);
835void MakeExplosion(int x, int y);
836void MakeExplosionAt(int x, int y);
837void GenerateShip(void);
838void GeneratePlane(int x, int y);
839void GenerateCopter(int x, int y);
840void GenerateTrain(int x, int y);
841void MakeMonster(void);
842void MakeTornado(void);
843void MakeAirCrash(void);
844void DestroyAllSprites(void);
845void DrawObjects(SimView *view);
846void sprite_command_init(void);
847/* w_stubs.c */
848void SetFunds(int dollars);
849void Spend(int dollars);
850void DropFireBombs(void);
851QUAD TickCount(void);
852void GameStarted(void);
853void InitGame(void);
854void ReallyQuit(void);
855/* w_tk.c */
856void tk_main(void);
857void StopEarthquake(void);
858void CancelRedrawView(SimView *view);
859void RedrawMaps(void);
860void EventuallyRedrawView(SimView *view);
861void StopToolkit(void);
862void InvalidateEditors(void);
863int Eval(char *buf);
864void DoEarthQuake(void);
865void Kick(void);
866void InvalidateMaps(void);
867int ConfigureTileView(Tcl_Interp *interp, SimView *view, int argc, char **argv, int flags);
868void DidStopPan(SimView *view);
869void RedrawEditors(void);
870void StartMicropolisTimer(void);
871void StopMicropolisTimer(void);
872/* w_tool.c */
873void ToolDrag(SimView *view, int px, int py);
874void ToolUp(SimView *view, int x, int y);
875void ChalkTo(SimView *view, int x, int y);
876void ChalkStart(SimView *view, int x, int y, int color);
877short tally(short tileValue);
878int bulldozer_tool(SimView *view, short x, short y);
879void setWandState(SimView *view, short state);
880void ToolDown(SimView *view, int x, int y);
881void DoTool(SimView *view, short tool, short x, short y);
882/* w_update.c */
883void DoUpdateHeads(void);
884void UpdateFunds(void);
885void UpdateEvaluation(void);
886void UpdateGraphs(void);
887void UpdateEditors(void);
888void UpdateMaps(void);
889void UpdateHeads(void);
890void doTimeStuff(void);
891/* w_util.c */
892void DoNewGame(void);
893void setCityName(char *name);
894void setAnyCityName(char *name);
895void DoSetMapState(SimView *view, short state);
896void makeDollarDecimalStr(char *numStr, char *dollarStr);
897int CurrentYear(void);
898void SetYear(int year);
899void Pause(void);
900void Resume(void);
901void setSpeed(short speed);
902void setSkips(int skips);
903void SetGameLevel(short level);
904void SetGameLevelFunds(short level);
905/* w_x.c */
906void DoTimeoutListen(void);
907void DoStopMicropolis(void);
908void UpdateFlush(void);
909void DoPanTo(struct SimView *view, int x, int y);
910void DoResizeView(SimView *view, int w, int h);
911void DestroyView(SimView *view);
912void ViewToPixelCoords(SimView *view, int x, int y, int *outx, int *outy);
913void FreeInk(Ink *ink);
914void AddInk(Ink *ink, int x, int y);
915void StartInk(Ink *ink, int x, int y);
916void DoPanBy(struct SimView *view, int dx, int dy);
917void ViewToTileCoords(SimView *view, int x, int y, int *outx, int *outy);
918void EraseOverlay(void);
919SimView *InitNewView(SimView *view, char *title, int class, int w, int h);
920void IncRefDisplay(XDisplay *xd);
921void DecRefDisplay(XDisplay *xd);
Impressum, Datenschutz