public void Draw() { grcolor color = GlobalVariables.color_red; int i; object p = null; Signal t = this; i = 0; /* RR */ if (t._interpreterData == null || (p = FindIcon()) == null) { if (t.fleeted) { if (t.status == trkstat.ST_GREEN) { if (t.nowfleeted) { i = 2; /* GG */ } else { i = 1; /* GR */ } } else if (t.nowfleeted) { i = 3; /* RO */ } switch (t.direction) { case trkdir.W_E: p = GlobalVariables.signal_traditional ? (t.signalx != 0 ? GlobalVariables.e_sig2x_pmap[i] : GlobalVariables.e_sig2_pmap[i]) : GlobalVariables.e_sigP_pmap[i]; break; case trkdir.E_W: p = GlobalVariables.signal_traditional ? (t.signalx != 0 ? GlobalVariables.w_sig2x_pmap[i] : GlobalVariables.w_sig2_pmap[i]) : GlobalVariables.w_sigP_pmap[i]; break; case trkdir.N_S: p = t.signalx != 0 ? GlobalVariables.s_sig2x_pmap[i] : GlobalVariables.s_sig2_pmap[i]; break; case trkdir.S_N: p = t.signalx != 0 ? GlobalVariables.n_sig2x_pmap[i] : GlobalVariables.n_sig2_pmap[i]; break; } if (p != null) { GlobalFunctions.draw_pixmap(t.x, t.y, p); } if (GlobalVariables.editing && GlobalVariables.show_links && t.controls != null) { GlobalFunctions.draw_link(t.x, t.y, t.controls.x, t.controls.y, GlobalVariables.conf.linkcolor); } return; } if (t.status == trkstat.ST_GREEN) { i = 1; } switch (t.direction) { case trkdir.W_E: p = t.signalx != 0 ? GlobalVariables.e_sigx_pmap[i] : GlobalVariables.e_sig_pmap[i]; break; case trkdir.E_W: p = t.signalx != 0 ? GlobalVariables.w_sigx_pmap[i] : GlobalVariables.w_sig_pmap[i]; break; case trkdir.N_S: p = t.signalx != 0 ? GlobalVariables.s_sigx_pmap[i] : GlobalVariables.s_sig_pmap[i]; break; case trkdir.S_N: p = t.signalx != 0 ? GlobalVariables.n_sigx_pmap[i] : GlobalVariables.n_sig_pmap[i]; break; } } if (p != null) { GlobalFunctions.draw_pixmap(t.x, t.y, p); } if (GlobalVariables.editing && GlobalVariables.show_links && t.controls != null) { GlobalFunctions.draw_link(t.x, t.y, t.controls.x, t.controls.y, GlobalVariables.conf.linkcolor); } }
public void DrawLineCenterCell(int x0, int y0, int x1, int y1, grcolor col) { // DrawLineCenterCellRGB(x0, y0, x1, y1, (colortable[col][0] << 16) | (colortable[col][1] << 8) | colortable[col][2]); }