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

    int pr = m_stroke & 0xFF0000;
    int pg = m_stroke & 0xFF00;
    int pb = m_stroke & 0xFF;

    int ia = (int) m_a0;

    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]) {
            int alpha = ia >> 16;
            int r0 = m_pixels[offset];
            int g0 = r0 & 0xFF00;
            int b0 = r0 & 0xFF;
            r0 &= 0xFF0000;
            r0 = r0 + (((pr - r0) * alpha) >> 8);
            g0 = g0 + (((pg - g0) * alpha) >> 8);
            b0 = b0 + (((pb - b0) * alpha) >> 8);

            m_pixels[offset] = 0xFF000000 |
              (r0 & 0xFF0000) | (g0 & 0xFF00) | (b0 & 0xFF);
            m_zbuffer[offset] = iz;
          }
        }
        iz +=dz;
        ia += da;
        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]) {
            int alpha = ia >> 16;
            int r0 = m_pixels[offset];
            int g0 = r0 & 0xFF00;
            int b0 = r0 & 0xFF;
            r0&=0xFF0000;
            r0 = r0 + (((pr - r0) * alpha) >> 8);
            g0 = g0 + (((pg - g0) * alpha) >> 8);
            b0 = b0 + (((pb - b0) * alpha) >> 8);

            m_pixels[offset] = 0xFF000000 |
              (r0 & 0xFF0000) | (g0 & 0xFF00) | (b0 & 0xFF);
            m_zbuffer[offset] = iz;
          }
        }
        iz += dz;
        ia += da;
        j += dt;
      }
    }
  }