| 1176 | // showing its strength from 0 (outside of orb) to 100% (exact). |
| 1177 | |
| 1178 | void XChartTransit(flag fTrans, flag fProg) |
| 1179 | { |
| 1180 | TransGraInfo *rgEph; |
| 1181 | word **ppw, *pw, *pw2; |
| 1182 | char sz[cchSzDef]; |
| 1183 | int cYea, dYea, cAsp, cSect, cTot, ymin, x0, y0, x, y, asp, iw, iwFocus = -1, |
| 1184 | nMax, n, obj, iy, yRow, cRow = 0, xWid, xo, yo, iSect, iFrac, xp, yp, yp2, |
| 1185 | dyp, et; |
| 1186 | flag fMonth = us.fInDayMonth, fYear = us.fInDayYear, fEclipse = |
| 1187 | us.fEclipse && !fTrans && !us.fParallel; |
| 1188 | CI ciT; |
| 1189 | real rT, rPct; |
| 1190 | |
| 1191 | // Initialize variables. |
| 1192 | rgEph = (TransGraInfo *)PAllocate(sizeof(TransGraInfo), |
| 1193 | "transit graph grid"); |
| 1194 | if (rgEph == NULL) |
| 1195 | goto LDone; |
| 1196 | ClearB((pbyte)(*rgEph), sizeof(TransGraInfo)); |
| 1197 | |
| 1198 | if (!fTrans && !fProg) |
| 1199 | ciT = ciMain; |
| 1200 | else |
| 1201 | ciT = ciTran; |
| 1202 | cAsp = fTrans && is.fReturn ? aCon : us.nAsp; |
| 1203 | yRow = gi.nScale * 12; |
| 1204 | xo = yRow*3 + fTrans*gi.nScaleT*20; |
| 1205 | ymin = 1-fTrans; |
| 1206 | |
| 1207 | // Determine pixel width of chart based on time period being graphed. |
| 1208 | if (!fMonth) |
| 1209 | cSect = 24; |
| 1210 | else if (!fYear) |
| 1211 | cSect = DayInMonth(ciT.mon, ciT.yea); |
| 1212 | else if (us.nEphemYears <= 1) |
| 1213 | cSect = 12; |
| 1214 | else { |
| 1215 | cYea = Max(us.nEphemYears, 2); cYea = Min(cYea, 21); |
| 1216 | dYea = (cYea - 1) >> 1; |
| 1217 | cSect = cYea*12; |
| 1218 | } |
| 1219 | xWid = (gs.xWin - xo - 2) / cSect; xWid = Max(xWid, 1); |
| 1220 | cTot = cSect * xWid + 1; |
| 1221 | |
| 1222 | // Calculate and fill out aspect strength arrays for each aspect present. |
| 1223 | if (fTrans || fProg) { |
| 1224 | ciCore = ciMain; |
| 1225 | us.fProgress = fFalse; |
| 1226 | CastChart(0); |
| 1227 | cp1 = cp0; |
| 1228 | } |
| 1229 | if (!gs.fAlt) { |
| 1230 | if (!fMonth) |
| 1231 | iwFocus = (int)(ciT.tim * (real)xWid); |
| 1232 | else if (!fYear) |
| 1233 | iwFocus = (int)(((real)(ciT.day-1) + ciT.tim/24.0) * (real)xWid); |
| 1234 | else if (us.nEphemYears <= 1) |
| 1235 | iwFocus = (int)(((real)(ciT.mon-1) + ((real)(ciT.day-1) + |
no test coverage detected