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
This commit is contained in:
parent
9edc542277
commit
f6fd885d75
1 changed files with 7 additions and 28 deletions
|
@ -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;
|
||||
|
||||
|
|
Reference in a new issue