private void drawLine_plain_spatial(int x0, int y0, int dt,
                                      int length, boolean vertical)  {
    int offset = 0;
    float iz = m_z0;

    if (vertical) {
      length += y0;
      for (int j = 0x8000 + (x0<<16); y0 <= length; ++y0) {
        offset = y0 * SCREEN_WIDTH + (j>>16);
        if (offset < m_pixels.length) {
          if (iz <= m_zbuffer[offset]) {
            m_pixels[offset] = m_stroke;
            m_zbuffer[offset] = iz;
          }
        }
        iz+=dz;
        j+=dt;
      }

    } else {  // horizontal
      length += x0;
      for (int j = 0x8000 + (y0<<16); x0 <= length; ++x0) {
        offset = (j>>16) * SCREEN_WIDTH + x0;
        if (offset < m_pixels.length) {
          if (iz <= m_zbuffer[offset]) {
            m_pixels[offset] = m_stroke;
            m_zbuffer[offset] = iz;
          }
        }
        iz+=dz;
        j+=dt;
      }
    }
  }