Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MicropolisJ: Fixed build.xml for the mac dist and added Mac build ins… #83

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions micropolis-java/INSTALL
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,17 @@ Building the Package
2. Type `ant' to compile the package.


Building the Mac Bundle App (optional)
====================

1. `cd' to the directory containing the package's source code.

2. Create a `mac' directory.

3. Download the appbundler-1.0.jar package available at https://java.net/projects/appbundler into the `mac' directory.

4. Type `ant dist-mac' to build the Mac Bundle.

Installing MicropolisJ
======================

Expand Down
1 change: 1 addition & 0 deletions micropolis-java/build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@
</target>

<target name="dist-mac" depends="build">
<taskdef name="bundleapp" classname="com.oracle.appbundler.AppBundlerTask" classpath="./mac/appbundler-1.0.jar"/>
<bundleapp outputdirectory="./"
name="MicropolisJ"
icon="micropolisj.icns"
Expand Down
52 changes: 26 additions & 26 deletions micropolis-java/graphics/tiles.rc
Original file line number Diff line number Diff line change
Expand Up @@ -51,20 +51,20 @@
38 terrain@0,608
39 terrain@0,624
# BEGIN WOODS (4 frames) #
40 terrain@0,640 (bulldozable)(description=#2)
41 terrain@0,656 (bulldozable)(description=#2)
42 terrain@0,672 (bulldozable)(description=#2)
43 terrain@0,688 (bulldozable)(description=#2)
40 terrain@0,640 (bulldozable)(description=#23)
41 terrain@0,656 (bulldozable)(description=#23)
42 terrain@0,672 (bulldozable)(description=#23)
43 terrain@0,688 (bulldozable)(description=#23)
# BEGIN RUBBLE (4 frames) #
44 terrain@0,704 (bulldozable)(noburn)(description=#3)
45 terrain@0,720 (bulldozable)(noburn)(description=#3)
46 terrain@0,736 (bulldozable)(noburn)(description=#3)
47 terrain@0,752 (bulldozable)(noburn)(description=#3)
# BEGIN FLOODING (4 frames) #
48 terrain@0,768 (noburn)(description=#4)(behavior=FLOOD)
49 terrain@0,784 (noburn)(description=#4)(behavior=FLOOD)
50 terrain@0,800 (noburn)(description=#4)(behavior=FLOOD)
51 terrain@0,816 (noburn)(description=#4)(behavior=FLOOD)
48 terrain@0,768 (noburn)(description=#4)(behavior=FLOOD)(becomes=49)
49 terrain@0,784 (noburn)(description=#4)(behavior=FLOOD)(becomes=50)
50 terrain@0,800 (noburn)(description=#4)(behavior=FLOOD)(becomes=51)
51 terrain@0,816 (noburn)(description=#4)(behavior=FLOOD)(becomes=48)
# BEGIN RADIATION #
52 terrain@0,832 (noburn)(description=#5)(behavior=RADIOACTIVE)(pollution=255)
53 terrain@0,848 (noburn)(description=#5)(behavior=RADIOACTIVE)(pollution=255)
Expand Down Expand Up @@ -433,7 +433,7 @@
406 res_zones@16,816 (conducts)
407 res_zones@32,816 (conducts)
408 res_zones@0,832 (conducts)
409 res_zones@16,832 (zone)(conducts)(building=3x3)(residential-zone)(behavior=HOSPITAL_CHURCH)(description=#10)
409 res_zones@16,832 (zone)(conducts)(building=3x3)(residential-zone)(behavior=HOSPITAL_CHURCH)(description=#27)
410 res_zones@32,832 (conducts)
411 res_zones@0,848 (conducts)
412 res_zones@16,848 (conducts)
Expand All @@ -442,7 +442,7 @@
415 res_zones@16,864 (conducts)
416 res_zones@32,864 (conducts)
417 res_zones@0,880 (conducts)
418 res_zones@16,880 (zone)(conducts)(building=3x3)(residential-zone)(behavior=HOSPITAL_CHURCH)(description=#10)
418 res_zones@16,880 (zone)(conducts)(building=3x3)(residential-zone)(behavior=HOSPITAL_CHURCH)(description=#28)
419 res_zones@32,880 (conducts)
420 res_zones@0,896 (conducts)
421 res_zones@16,896 (conducts)
Expand Down Expand Up @@ -960,22 +960,22 @@
914 ind_zones@32,400|ind08_smoke_frames@128,16 (conducts)(building-part=688,1,0) (becomes=915)(onshutdown=689)
915 ind_zones@32,400|ind08_smoke_frames@176,16 (conducts)(building-part=688,1,0) (becomes=912)(onshutdown=689)
# BEGIN COAL PLANT SMOKE #
916 coal@32,0 |coal_smoke_frames@32,0 (conducts)(building-part=750,1,-1)(becomes=917)(onshutdown=747)
917 coal@32,0 |coal_smoke_frames@96,0 (conducts)(building-part=750,1,-1)(becomes=918)(onshutdown=747)
918 coal@32,0 |coal_smoke_frames@160,0 (conducts)(building-part=750,1,-1)(becomes=919)(onshutdown=747)
919 coal@32,0 |coal_smoke_frames@224,0 (conducts)(building-part=750,1,-1)(becomes=916)(onshutdown=747)
920 coal@48,0 |coal_smoke_frames@48,0 (conducts)(building-part=750,2,-1)(becomes=921)(onshutdown=748)
921 coal@48,0 |coal_smoke_frames@112,0 (conducts)(building-part=750,2,-1)(becomes=922)(onshutdown=748)
922 coal@48,0 |coal_smoke_frames@176,0 (conducts)(building-part=750,2,-1)(becomes=923)(onshutdown=748)
923 coal@48,0 |coal_smoke_frames@240,0 (conducts)(building-part=750,2,-1)(becomes=920)(onshutdown=748)
924 coal@32,16|coal_smoke_frames@32,16 (conducts)(building-part=750,1,0) (becomes=925)(onshutdown=751)
925 coal@32,16|coal_smoke_frames@96,16 (conducts)(building-part=750,1,0) (becomes=926)(onshutdown=751)
926 coal@32,16|coal_smoke_frames@160,16 (conducts)(building-part=750,1,0) (becomes=927)(onshutdown=751)
927 coal@32,16|coal_smoke_frames@224,16 (conducts)(building-part=750,1,0) (becomes=924)(onshutdown=751)
928 coal@48,16|coal_smoke_frames@48,16 (conducts)(building-part=750,2,0) (becomes=929)(onshutdown=752)
929 coal@48,16|coal_smoke_frames@112,16 (conducts)(building-part=750,2,0) (becomes=930)(onshutdown=752)
930 coal@48,16|coal_smoke_frames@176,16 (conducts)(building-part=750,2,0) (becomes=931)(onshutdown=752)
931 coal@48,16|coal_smoke_frames@240,16 (conducts)(building-part=750,2,0) (becomes=928)(onshutdown=752)
916 coal@32,0 |coal_smoke_frames@32,0 (conducts)(description=#25)(building-part=750,1,-1)(becomes=917)(onshutdown=747)
917 coal@32,0 |coal_smoke_frames@96,0 (conducts)(description=#25)(building-part=750,1,-1)(becomes=918)(onshutdown=747)
918 coal@32,0 |coal_smoke_frames@160,0 (conducts)(description=#25)(building-part=750,1,-1)(becomes=919)(onshutdown=747)
919 coal@32,0 |coal_smoke_frames@224,0 (conducts)(description=#25)(building-part=750,1,-1)(becomes=916)(onshutdown=747)
920 coal@48,0 |coal_smoke_frames@48,0 (conducts)(description=#25)(building-part=750,2,-1)(becomes=921)(onshutdown=748)
921 coal@48,0 |coal_smoke_frames@112,0 (conducts)(description=#25)(building-part=750,2,-1)(becomes=922)(onshutdown=748)
922 coal@48,0 |coal_smoke_frames@176,0 (conducts)(description=#25)(building-part=750,2,-1)(becomes=923)(onshutdown=748)
923 coal@48,0 |coal_smoke_frames@240,0 (conducts)(description=#25)(building-part=750,2,-1)(becomes=920)(onshutdown=748)
924 coal@32,16|coal_smoke_frames@32,16 (conducts)(description=#25)(building-part=750,1,0) (becomes=925)(onshutdown=751)
925 coal@32,16|coal_smoke_frames@96,16 (conducts)(description=#25)(building-part=750,1,0) (becomes=926)(onshutdown=751)
926 coal@32,16|coal_smoke_frames@160,16 (conducts)(description=#25)(building-part=750,1,0) (becomes=927)(onshutdown=751)
927 coal@32,16|coal_smoke_frames@224,16 (conducts)(description=#25)(building-part=750,1,0) (becomes=924)(onshutdown=751)
928 coal@48,16|coal_smoke_frames@48,16 (conducts)(description=#25)(building-part=750,2,0) (becomes=929)(onshutdown=752)
929 coal@48,16|coal_smoke_frames@112,16 (conducts)(description=#25)(building-part=750,2,0) (becomes=930)(onshutdown=752)
930 coal@48,16|coal_smoke_frames@176,16 (conducts)(description=#25)(building-part=750,2,0) (becomes=931)(onshutdown=752)
931 coal@48,16|coal_smoke_frames@240,16 (conducts)(description=#25)(building-part=750,2,0) (becomes=928)(onshutdown=752)
# BEGIN STADIUM PLAYFIELD #
# Note: the original source code made these unburnable, which doesn't make sense
932 misc_animation@0,1680 (conducts)(description=#24)(becomes=933)
Expand Down
17 changes: 12 additions & 5 deletions micropolis-java/src/micropolisj/engine/Micropolis.java
Original file line number Diff line number Diff line change
Expand Up @@ -1983,6 +1983,8 @@ void loadMisc(DataInputStream dis)
resCap = false;
comCap = false;
indCap = false;

lastCityPop = calcPopulation();
}

void writeMisc(DataOutputStream out)
Expand Down Expand Up @@ -2491,7 +2493,7 @@ void makeExplosionAt(int x, int y)
void checkGrowth()
{
if (cityTime % 4 == 0) {
int newPop = (resPop + comPop * 8 + indPop * 8) * 20;
int newPop = calcPopulation();
if (lastCityPop != 0) {
MicropolisMessage z = null;
if (lastCityPop < 500000 && newPop >= 500000) {
Expand All @@ -2506,13 +2508,18 @@ void checkGrowth()
z = MicropolisMessage.POP_2K_REACHED;
}
if (z != null) {
sendMessage(z);
sendMessageAt(z, centerMassX, centerMassY);
}
}
lastCityPop = newPop;
}
}

int calcPopulation()
{
return (resPop + comPop * 8 + indPop * 8) * 20;
}

void doMessages()
{
//MORE (scenario stuff)
Expand Down Expand Up @@ -2582,12 +2589,12 @@ void doMessages()
break;
case 35:
if (pollutionAverage > 60) { // FIXME, consider changing threshold to 80
sendMessage(MicropolisMessage.HIGH_POLLUTION);
sendMessageAt(MicropolisMessage.HIGH_POLLUTION, pollutionMaxLocationX, pollutionMaxLocationY);
}
break;
case 42:
if (crimeAverage > 100) {
sendMessage(MicropolisMessage.HIGH_CRIME);
sendMessageAt(MicropolisMessage.HIGH_CRIME, crimeMaxLocationX, crimeMaxLocationY);
}
break;
case 45:
Expand Down Expand Up @@ -2622,7 +2629,7 @@ void doMessages()
break;
case 63:
if (trafficAverage > 60) {
sendMessage(MicropolisMessage.HIGH_TRAFFIC);
sendMessageAt(MicropolisMessage.HIGH_TRAFFIC, trafficMaxLocationX, trafficMaxLocationY);
}
break;
default:
Expand Down
2 changes: 2 additions & 0 deletions micropolis-java/src/micropolisj/engine/MicropolisMessage.java
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ public enum MicropolisMessage
POP_500K_REACHED.useNotificationPane = true;
HIGH_CRIME.useNotificationPane = true;
HIGH_POLLUTION.useNotificationPane = true;
HIGH_TRAFFIC.useNotificationPane = true;

// location-specific
FLOOD_REPORT.useNotificationPane = true;
Expand All @@ -87,5 +88,6 @@ public enum MicropolisMessage
SHIPWRECK_REPORT.useNotificationPane = true;
COPTER_CRASH_REPORT.useNotificationPane = true;
PLANECRASH_REPORT.useNotificationPane = true;
FIREBOMBING_REPORT.useNotificationPane = true;
}
}
2 changes: 2 additions & 0 deletions micropolis-java/src/micropolisj/gui/MainWindow.java
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,7 @@ public void windowClosed(WindowEvent ev)
engine.addListener(this);
engine.addEarthquakeListener(this);
reloadFunds();
updateDateLabel();
reloadOptions();
startTimer();
makeClean();
Expand Down Expand Up @@ -312,6 +313,7 @@ public void setEngine(Micropolis newEngine)
demandInd.setEngine(engine);
graphsPane.setEngine(engine);
reloadFunds();
updateDateLabel();
reloadOptions();
notificationPane.setVisible(false);

Expand Down
Loading