Method
DoRule
Source from the content-addressed store, hash-verified
| 1062 | |
| 1063 | |
| 1064 | long CellEngine::DoRule() |
| 1065 | { |
| 1066 | int step = 0; |
| 1067 | |
| 1068 | if (!moveImage) { |
| 1069 | DoPhysics(); |
| 1070 | } |
| 1071 | |
| 1072 | if (skips > 0) { |
| 1073 | if (skip > 0) { |
| 1074 | skip--; |
| 1075 | done: |
| 1076 | if (moveImage) { |
| 1077 | DoPhysics(); |
| 1078 | } |
| 1079 | return step; |
| 1080 | } // if |
| 1081 | skip = skips; |
| 1082 | } // if |
| 1083 | |
| 1084 | if (!OnScreen()) goto done; |
| 1085 | |
| 1086 | for (step = 0; |
| 1087 | step < steps; |
| 1088 | step++) { |
| 1089 | |
| 1090 | CopyToBack(); |
| 1091 | |
| 1092 | if (moveImage && |
| 1093 | (step == 0)) { |
| 1094 | DoPhysics(); |
| 1095 | } |
| 1096 | |
| 1097 | PumpToFront(); |
| 1098 | |
| 1099 | } // for step |
| 1100 | |
| 1101 | return step; |
| 1102 | } |
| 1103 | |
| 1104 | |
| 1105 | void CellEngine::PostRule() |