From f6fd885d75112b74f21fd803aefee03e9fd30ca8 Mon Sep 17 00:00:00 2001 From: "jason@long.name" Date: Mon, 29 Apr 2013 22:02:13 +0000 Subject: [PATCH] simspeed: do not skip crime/fire/power scans when speed is faster The original Micropolis code has logic where at the faster simulator speeds, the crime/fire/power/etc. scans are performed less frequently, presumably to more efficiently use CPU. However, CPUs are faster now and I would prefer to not have the simulation change behavior based on the speed setting. git-svn-id: https://micropolis.googlecode.com/svn/trunk/micropolis-java@612 d9718cc8-9f43-0410-858b-315f434eb58c --- src/micropolisj/engine/Micropolis.java | 35 ++++++-------------------- 1 file changed, 7 insertions(+), 28 deletions(-) diff --git a/src/micropolisj/engine/Micropolis.java b/src/micropolisj/engine/Micropolis.java index ead64fe..f20a8ae 100644 --- a/src/micropolisj/engine/Micropolis.java +++ b/src/micropolisj/engine/Micropolis.java @@ -498,17 +498,6 @@ public class Micropolis } } - // period of powerScan() - static final int [] spdPwr = { 1, 1, 1, 2, 5 }; - // period of ptlScan() - static final int [] spdPtl = { 1, 1, 1, 2, 5 }; - // period of crimeScan() - static final int [] spdCri = { 1, 1, 1, 2, 5 }; - // period of popDenScan() - static final int [] spdPop = { 1, 1, 1, 2, 5 }; - // period of fireAnalysis() - static final int [] spdFir = { 1, 1, 1, 2, 5 }; - void simulate(int mod16) { final int band = getWidth() / 8; @@ -590,35 +579,25 @@ public class Micropolis break; case 11: - if (scycle % spdPwr[simSpeed.ordinal()] == 0) { - powerScan(); - fireMapOverlayDataChanged(MapState.POWER_OVERLAY); - newPower = true; - } + powerScan(); + fireMapOverlayDataChanged(MapState.POWER_OVERLAY); + newPower = true; break; case 12: - if (scycle % spdPtl[simSpeed.ordinal()] == 0) { - ptlScan(); - } + ptlScan(); break; case 13: - if (scycle % spdCri[simSpeed.ordinal()] == 0) { - crimeScan(); - } + crimeScan(); break; case 14: - if (scycle % spdPop[simSpeed.ordinal()] == 0) { - popDenScan(); - } + popDenScan(); break; case 15: - if (scycle % spdFir[simSpeed.ordinal()] == 0) { - fireAnalysis(); - } + fireAnalysis(); doDisasters(); break;