]>
cvs.zerfleddert.de Git - micropolis/blob - src/sim/headers/sim.h
1 /* sim.h: Main include file
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.
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.
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/>.
21 * ADDITIONAL TERMS per GNU GPL Section 7
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.
29 * Any propagation or conveyance of this program must include this
30 * copyright notice and these terms.
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.
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.
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
63 /* workaround sun c compiler junk */
68 #define CTRL(c) (#c[0]&037)
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)
98 #include <sys/types.h>
100 #include <sys/stat.h>
101 #include <sys/file.h>
102 #include <sys/ioctl.h>
103 #include <sys/resource.h>
105 #include <sys/mman.h>
106 #include <netinet/in.h>
107 #include <arpa/inet.h>
112 #include <sys/systeminfo.h>
114 #include <sys/vadvise.h>
126 #include <X11/Xlib.h>
127 #include <X11/Xutil.h>
128 #include <X11/Xatom.h>
129 #include <X11/extensions/XShm.h>
134 /* gcc compat workaround! */
137 #include "tclxtend.h"
140 #include "tkconfig.h"
153 #define SimWidth (120 * MEGA)
154 #define SimHeight (100 * MEGA)
157 #define SimHeight 100
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)
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)
181 #define MISCHISTLEN 240
183 #define POWERMAPROW ((WORLD_X + 15) / 16)
186 #define POWERMAPLEN ((QUAD)(2 * POWERMAPROW * WORLD_Y))
187 #define POWERWORD(x, y) ((((QUAD)(x)) >>4) + (((QUAD)(y)) * POWERMAPROW))
189 #define POWERMAPLEN 1700 /* ??? PWRMAPSIZE */
190 #define POWERWORD(x, y) (((x) >>4) + ((y) <<3))
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)
197 #define ALMAP 0 /* all */
198 #define REMAP 1 /* residential */
199 #define COMAP 2 /* commercial */
200 #define INMAP 3 /* industrial */
202 #define PRMAP 4 /* power */
203 #define RDMAP 5 /* road */
205 #define PDMAP 6 /* population density */
206 #define RGMAP 7 /* rate of growth */
208 #define TDMAP 8 /* traffic density */
209 #define PLMAP 9 /* pollution */
210 #define CRMAP 10 /* crime */
211 #define LVMAP 11 /* land value */
213 #define FIMAP 12 /* fire radius */
214 #define POMAP 13 /* police radius */
215 #define DYMAP 14 /* dynamic */
219 /* These adjust frequency in Simulate() */
225 /* These are names of the 16 colors */
226 #define COLOR_WHITE 0
227 #define COLOR_YELLOW 1
228 #define COLOR_ORANGE 2
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
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 */
254 #define BLBNBIT (BULLBIT+BURNBIT)
255 #define BLBNCNBIT (BULLBIT+BURNBIT+CONDBIT)
256 #define BNCNBIT (BURNBIT+CONDBIT)
258 /* Object & Sound Numbers */
269 /* Max # of Objects */
273 /* Graph Histories */
279 #define POLLUTION_HIST 5
281 #define ALL_HISTORIES ((1 <<HISTORIES) - 1)
283 /* Character Mapping */
289 #define FIRSTRIVEDGE 5
290 #define LASTRIVEDGE 20
294 #define UNUSED_TRASH1 38
295 #define UNUSED_TRASH2 39
301 #define LASTRUBBLE 47
305 #define UNUSED_TRASH3 53
306 #define UNUSED_TRASH4 54
307 #define UNUSED_TRASH5 55
315 #define INTERSECTION 76
316 #define HROADPOWER 77
317 #define VROADPOWER 78
330 #define POWERBASE 208
335 #define RAILHPOWERV 221
336 #define RAILVPOWERH 222
337 #define LASTPOWER 222
338 #define UNUSED_TRASH6 223
344 #define HRAILROAD 237
345 #define VRAILROAD 238
347 #define ROADVPOWERH 239 /* bogus? */
375 #define AIRPORTBASE 709
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
387 #define FULLSTADIUM 800
388 #define NUCLEARBASE 811
391 #define LIGHTNINGBOLT 827
408 #define SMOKEBASE 852
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
423 #define TILE_COUNT 960
426 * These describe the wand values, the object dragged around on the screen.
429 #define residentialState 0
430 #define commercialState 1
431 #define industrialState 2
434 #define policeState 5
439 #define chalkState 10
440 #define eraserState 11
441 #define stadiumState 12
443 #define seaportState 14
444 #define powerState 15
445 #define nuclearState 16
446 #define airportState 17
447 #define networkState 18
450 #define firstState residentialState
451 #define lastState networkState
454 #define specialState 16
455 #define monsterGoalState 17
456 #define helicopterGoalState 18
457 #define blackState 19
458 #define whiteState 20
460 #define orangeState 23
462 #define greenState 25
463 #define brownState 26
468 #define STATE_TILES 1
469 #define STATE_OVERLAYS 2
470 #define STATE_GRAPHS 3
473 extern short *Map
[WORLD_X
]; /* Main Map 120 x 100 */
474 extern Byte
*PopDensity
[HWLDX
]; /* 2X2 Maps 60 x 50 */
475 extern Byte
*TrfDensity
[HWLDX
];
476 extern Byte
*PollutionMem
[HWLDX
];
477 extern Byte
*LandValueMem
[HWLDX
];
478 extern Byte
*CrimeMem
[HWLDX
];
479 extern Byte
*tem
[HWLDX
];
480 extern Byte
*tem2
[HWLDX
];
481 extern Byte
*TerrainMem
[QWX
]; /* 4X4 Maps 30 x 25 */
482 extern Byte
*Qtem
[QWX
];
483 extern short RateOGMem
[SmX
][SmY
];
484 extern short FireStMap
[SmX
][SmY
]; /* 8X8 Maps 15 x 13 */
485 extern short PoliceMap
[SmX
][SmY
];
486 extern short PoliceMapEffect
[SmX
][SmY
];
487 extern short ComRate
[SmX
][SmY
];
488 extern short FireRate
[SmX
][SmY
];
489 extern short STem
[SmX
][SmY
];
490 extern short SpriteXOffset
[OBJN
];
491 extern short SpriteYOffset
[OBJN
];
492 extern short SMapX
, SMapY
;
493 extern short CChr
, CChr9
;
494 extern short RoadTotal
, RailTotal
, FirePop
;
495 extern short ResPop
, ComPop
, IndPop
, TotalPop
, LastTotalPop
;
496 extern short ResZPop
, ComZPop
, IndZPop
, TotalZPop
;
497 extern short HospPop
, ChurchPop
, StadiumPop
;
498 extern short PolicePop
, FireStPop
;
499 extern short CoalPop
, NuclearPop
, PortPop
, APortPop
;
500 extern short NeedHosp
, NeedChurch
;
501 extern short CrimeAverage
, PolluteAverage
, LVAverage
;
502 extern char *MicropolisVersion
;
503 extern char *CityName
;
504 extern char *CityFileName
;
505 extern char *StartupName
;
506 extern short StartingYear
;
507 extern QUAD CityTime
;
508 extern QUAD LastCityTime
;
509 extern QUAD LastCityMonth
;
510 extern QUAD LastCityYear
;
511 extern QUAD LastFunds
;
512 extern QUAD LastR
, LastC
, LastI
;
513 extern short GameLevel
;
515 extern short ScenarioID
;
516 extern short ShakeNow
;
517 extern QUAD DonDither
;
518 extern int DoOverlay
;
520 extern short *ResHis
, ResHisMax
;
521 extern short *ComHis
, ComHisMax
;
522 extern short *IndHis
, IndHisMax
;
523 extern short *MoneyHis
, *CrimeHis
, *PollutionHis
, *MiscHis
;
524 extern short *PowerMap
;
526 extern float roadPercent
, policePercent
, firePercent
;
527 extern QUAD RoadSpend
, PoliceSpend
, FireSpend
;
528 extern QUAD roadMaxValue
, policeMaxValue
, fireMaxValue
;
529 extern QUAD TaxFund
, RoadFund
, PoliceFund
, FireFund
;
530 extern short RoadEffect
, PoliceEffect
, FireEffect
;
531 extern short TaxFlag
, CityTax
;
532 extern QUAD TotalFunds
;
534 extern QUAD costOf
[];
536 extern short flagBlink
;
537 extern unsigned char tileSynch
;
538 extern short aniTile
[];
539 extern unsigned char aniSynch
[];
540 extern int TilesAnimated
;
541 extern int DoAnimation
;
542 extern int DoMessages
;
543 extern int DoNotices
;
544 extern unsigned char ColorIntensities
[];
546 extern short MesX
, MesY
;
547 extern short MesNum
, MessagePort
;
548 extern QUAD LastMesTime
;
550 extern short SimSpeed
;
551 extern short SimMetaSpeed
;
552 extern short NoDisasters
;
553 extern short autoBulldoze
;
554 extern short autoBudget
;
556 extern short UserSoundOn
;
558 extern short DisasterEvent
;
559 extern short DisasterWait
;
561 extern short ResCap
, ComCap
, IndCap
;
562 extern short RValve
, CValve
, IValve
;
563 extern short PwrdZCnt
;
564 extern short unPwrdZCnt
;
566 extern char *HomeDir
, *ResourceDir
, *HostName
;
568 extern short Graph10Max
, Graph120Max
;
569 extern short Res2HisMax
, Com2HisMax
, Ind2HisMax
;
570 extern unsigned char *History10
[HISTORIES
], *History120
[HISTORIES
];
571 extern short CityScore
;
572 extern short deltaCityScore
;
573 extern short ScoreType
;
574 extern short ScoreWait
;
575 extern short CityClass
;
576 extern short PolMaxX
, PolMaxY
;
577 extern int PowerStackNum
;
578 extern short TrafficAverage
;
579 extern short PosStackN
;
580 extern short SMapXStack
[], SMapYStack
[];
581 extern short Zsource
;
582 extern short HaveLastMessage
;
583 extern short PdestX
, PdestY
;
584 extern short CdestX
, CdestY
;
586 extern short CopFltCnt
;
588 extern short GdestX
, GdestY
;
589 extern short GorgX
, GorgY
;
590 extern short GodControl
;
591 extern short CopControl
;
592 extern short CdestX
, CdestY
;
593 extern short TrafMaxX
, TrafMaxY
;
594 extern short CrimeMaxX
, CrimeMaxY
;
595 extern short FloodX
, FloodY
;
596 extern short CrashX
, CrashY
;
597 extern short CCx
, CCy
;
598 extern QUAD CityPop
, deltaCityPop
;
599 extern char *cityClassStr
[6];
600 extern short CityYes
, CityNo
;
601 extern short ProblemTable
[PROBNUM
];
602 extern short ProblemVotes
[PROBNUM
];
603 extern short ProblemOrder
[4];
604 extern QUAD CityAssValue
;
606 extern short InitSimLoad
;
607 extern short DoInitialEval
;
609 extern int StartupGameLevel
;
610 extern int PerformanceTiming
;
611 extern double FlushTime
;
615 extern struct timeval start_time
, now_time
, beat_time
, last_now_time
;
618 extern int MultiPlayerMode
;
619 extern int SugarMode
;
620 extern int LegacyMode
;
621 extern int sim_delay
;
622 extern int sim_skips
;
624 extern int sim_paused
;
625 extern int sim_paused_speed
;
628 extern int sim_just_cam
;
630 extern int heat_steps
;
631 extern int heat_flow
;
632 extern int heat_rule
;
633 extern int UpdateDelayed
;
634 extern int DynamicData
[32];
637 extern int BobHeight
;
639 extern int Expensive
;
640 extern int PendingTool
;
643 extern int TreeLevel
;
644 extern int LakeLevel
;
645 extern int CurveLevel
;
646 extern int CreateIsland
;
647 extern short specialBase
;
648 extern short PunishCnt
;
650 extern short toolSize
[];
651 extern short toolOffset
[];
652 extern QUAD toolColors
[];
653 extern char *Displays
;
654 extern char *FirstDisplay
;
655 extern char *dateStr
[12];
658 extern short NewMapFlags
[NMAPS
];
659 extern short NewGraph
;
660 extern short ValveFlag
;
661 extern short MustUpdateFunds
;
662 extern short MustUpdateOptions
;
663 extern short CensusChanged
;
664 extern short EvalChanged
;
665 extern short MeltX
, MeltY
;
667 extern int ExitReturn
;
669 extern Tcl_Interp
*tk_mainInterp
;
670 extern Tk_Window MainWindow
;
671 extern int FlushStyle
;
672 extern int GotXError
;
674 extern short Rand(short range
);
675 extern short RandInt(void);
677 extern Sim
*MakeNewSim();
678 extern SimView
*MakeNewView();
679 extern SimSprite
*GetSprite(int type
);
680 extern SimSprite
*MakeSprite(int type
, int x
, int y
);
681 extern SimSprite
*MakeNewSprite(int type
, int x
, int y
);
683 extern struct XDisplay
*XDisplays
;
685 /* Functions referenced from other files */
687 void animateTiles(void);
689 void WireDrawBeegMapRect(SimView
*view
, short x
, short y
, short w
, short h
);
690 void MemDrawBeegMapRect(SimView
*view
, int x
, int y
, int w
, int h
);
692 void setUpMapProcs(void);
693 void MemDrawMap(SimView
*view
);
695 void GetViewTiles(SimView
*view
);
696 void GetPixmaps(XDisplay
*xd
);
698 void drawAll(SimView
*view
);
699 void drawRes(SimView
*view
);
700 void drawCom(SimView
*view
);
701 void drawInd(SimView
*view
);
702 void drawLilTransMap(SimView
*view
);
703 void drawPower(SimView
*view
);
704 void drawDynamic(SimView
*view
);
707 void sim_srand(u_int seed
);
709 void sim_exit(int val
);
710 void sim_update_editors(void);
711 void sim_update(void);
713 void sim_really_exit(int val
);
714 void sim_loop(int doSim
);
716 void initMapArrays(void);
718 void DoDisasters(void);
720 void MakeFlood(void);
721 void MakeEarthquake(void);
722 void MakeMeltdown(void);
727 void CityEvaluation(void);
729 int GetUnemployment(void);
730 int AverageTrf(void);
732 int LoadCity(char *filename
);
734 void SaveCityAs(char *filename
);
735 void LoadScenario(short s
);
738 void SmoothTrees(void);
739 void SmoothRiver(void);
740 void GenerateSomeCity(int r
);
741 void ClearUnnatural(void);
742 void SmoothWater(void);
743 void GenerateNewCity(void);
745 void ResetMapState(void);
746 void ResetEditorState(void);
747 void InitWillStuff(void);
749 void SendMessages(void);
750 void SendMesAt(short Mnum
, short x
, short y
);
752 int SendMes(int Mnum
);
753 void SendMesAt(short Mnum
, short x
, short y
);
754 void doMessage(void);
756 void PushPowerStack(void);
757 void DoPowerScan(void);
758 int MoveMapSim (short MDir
);
760 void FireAnalysis(void);
761 void PopDenScan(void);
762 void CrimeScan(void);
766 void DoSimInit(void);
767 void SeedRand(int seed
);
768 void DoMeltdown(int SX
, int SY
);
769 void FireZone(int Xloc
, int Yloc
, int ch
);
771 int Rand16Signed(void);
772 void RandomlySeedRand();
773 void RepairZone(short ZCent
, short zsize
);
774 void DoSPZone(short PwrOn
);
775 void UpdateFundEffects(void);
778 int MakeTraf(int Zt
);
785 int DoFreePop (void);
787 void UpdateBudgetWindow(void);
788 void InitFundingLevel(void);
789 void drawCurrPercents(void);
791 void drawBudgetWindow(void);
792 void DoBudgetFromMenu(void);
793 void UpdateBudget(void);
795 int ConnecTile(short x
, short y
, short *TileAdrPtr
, short Command
);
797 void date_command_init(void);
799 void DoUpdateEditor(SimView
*view
);
800 void editor_command_init(void);
801 void DoNewEditor(SimView
*view
);
803 void scoreDoer(void);
804 void ChangeEval(void);
806 void graphDoer(void);
807 void initGraphs(void);
808 void ChangeCensus(void);
809 void doAllGraphs(void);
810 void DestroyGraph(SimGraph
*graph
);
811 void InitGraphMax(void);
812 void graph_command_init(void);
813 int ConfigureSimGraph(Tcl_Interp
*interp
, SimGraph
*graph
, int argc
, char **argv
, int flags
);
815 void ResetLastKeys(void);
816 void doKeyUp(SimView
*view
, short charCode
);
817 void doKeyDown(SimView
*view
, short charCode
);
819 int DoUpdateMap(SimView
*view
);
820 void map_command_init(void);
821 void DoNewMap(SimView
*view
);
823 void GetIndString(char *str
, int id
, short num
);
825 void sim_command_init(void);
827 void InitializeSound(void);
828 void MakeSound(char *channel
, char *id
);
829 void MakeSoundOn(SimView
*view
, char *channel
, char *id
);
831 void StartBulldozer(void);
832 void StopBulldozer(void);
833 void sound_command_init(void);
835 void MoveObjects(void);
836 void MakeExplosion(int x
, int y
);
837 void MakeExplosionAt(int x
, int y
);
838 void GenerateShip(void);
839 void GeneratePlane(int x
, int y
);
840 void GenerateCopter(int x
, int y
);
841 void GenerateTrain(int x
, int y
);
842 void MakeMonster(void);
843 void MakeTornado(void);
844 void MakeAirCrash(void);
845 void DestroyAllSprites(void);
846 void DrawObjects(SimView
*view
);
847 void sprite_command_init(void);
849 void SetFunds(int dollars
);
850 void Spend(int dollars
);
851 void DropFireBombs(void);
852 QUAD
TickCount(void);
853 void GameStarted(void);
855 void ReallyQuit(void);
858 void StopEarthquake(void);
859 void CancelRedrawView(SimView
*view
);
860 void RedrawMaps(void);
861 void EventuallyRedrawView(SimView
*view
);
862 void StopToolkit(void);
863 void InvalidateEditors(void);
865 void DoEarthQuake(void);
867 void InvalidateMaps(void);
868 int ConfigureTileView(Tcl_Interp
*interp
, SimView
*view
, int argc
, char **argv
, int flags
);
869 void DidStopPan(SimView
*view
);
870 void RedrawEditors(void);
871 void StartMicropolisTimer(void);
872 void StopMicropolisTimer(void);
874 void ToolDrag(SimView
*view
, int px
, int py
);
875 void ToolUp(SimView
*view
, int x
, int y
);
876 void ChalkTo(SimView
*view
, int x
, int y
);
877 void ChalkStart(SimView
*view
, int x
, int y
, int color
);
878 short tally(short tileValue
);
879 int bulldozer_tool(SimView
*view
, short x
, short y
);
880 void setWandState(SimView
*view
, short state
);
881 void ToolDown(SimView
*view
, int x
, int y
);
882 void DoTool(SimView
*view
, short tool
, short x
, short y
);
884 void DoUpdateHeads(void);
885 void UpdateFunds(void);
886 void UpdateEvaluation(void);
887 void UpdateGraphs(void);
888 void UpdateEditors(void);
889 void UpdateMaps(void);
890 void UpdateHeads(void);
891 void doTimeStuff(void);
893 void DoNewGame(void);
894 void setCityName(char *name
);
895 void setAnyCityName(char *name
);
896 void DoSetMapState(SimView
*view
, short state
);
897 void makeDollarDecimalStr(char *numStr
, char *dollarStr
);
898 int CurrentYear(void);
899 void SetYear(int year
);
902 void setSpeed(short speed
);
903 void setSkips(int skips
);
904 void SetGameLevel(short level
);
905 void SetGameLevelFunds(short level
);
907 void DoTimeoutListen(void);
908 void DoStopMicropolis(void);
909 void UpdateFlush(void);
910 void DoPanTo(struct SimView
*view
, int x
, int y
);
911 void DoResizeView(SimView
*view
, int w
, int h
);
912 void DestroyView(SimView
*view
);
913 void ViewToPixelCoords(SimView
*view
, int x
, int y
, int *outx
, int *outy
);
914 void FreeInk(Ink
*ink
);
915 void AddInk(Ink
*ink
, int x
, int y
);
916 void StartInk(Ink
*ink
, int x
, int y
);
917 void DoPanBy(struct SimView
*view
, int dx
, int dy
);
918 void ViewToTileCoords(SimView
*view
, int x
, int y
, int *outx
, int *outy
);
919 void EraseOverlay(void);
920 SimView
*InitNewView(SimView
*view
, char *title
, int class, int w
, int h
);
921 void IncRefDisplay(XDisplay
*xd
);
922 void DecRefDisplay(XDisplay
*xd
);