1
General chat / Re: Hi
« on: April 07, 2018 »
Welcome! There's a reason some of us aren't putting our age on here lol
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
void Line(int x0, int y0, int x1, int y1, int hy, int s)
{
register int i;
int sx, sy;
int c,y,h,u0,v0,u1,v1,a,b,h0,h1,h2,h3;
sx = (x1 - x0) / 320;
sy = (y1 - y0) / 320;
for (i = 0; i < 320; i++)
{
u0 = (x0 >> 16) & 0xFF;
a = (x0 >> 8) & 255;
v0 = ((y0 >> 8) & 0xFF00);
b = (y0 >> 8) & 255;
u1 = (u0 + 1) & 0xFF;
v1 = (v0 + 256) & 0xFF00;
h0 = HMap[u0 + v0];
h2 = HMap[u0 + v1];
h1 = HMap[u1 + v0];
h3 = HMap[u1 + v1];
h0 = (h0 << 8) + a * (h1 - h0);
h2 = (h2 << 8) + a * (h3 - h2);
h = ((h0 << 8) + b * (h2 - h0)) >> 16;
h0 = CMap[u0 + v0];
h2 = CMap[u0 + v1];
h1 = CMap[u1 + v0];
h3 = CMap[u1 + v1];
h0 = (h0 << 8) + a * (h1 - h0);
h2 = (h2 << 8) + a * (h3 - h2);
c = ((h0 << 8) + b * (h2 - h0));
y = (((h - hy) * s) >> 11) + (240 / 2);
if (y < (a = LastY[i]))
{
unsigned char *b = DBuf + (a << 8) + (a << 6) + i;
int sc,cc;
if (LastC[i] == -1)
LastC[i] = c;
sc = (c - LastC[i]) / (a - y);
cc = LastC[i];
if (a > 240 - 1)
{
b -= (a - (240 - 1)) * 320;
cc += (a - (240 - 1)) * sc;
a = 240 - 1;
}
if (y < 0)
y = 0;
while (y < a)
{
*b = cc >> 18;
cc += sc;
b -= 320;
a--;
}
LastY[i] = y;
}
LastC[i] = c;
x0 += sx;
y0 += sy;
}
}
FastBitmap a = new FastBitmap(myTexture);
FastBitmap b = new FastBitmap(myBitmap);
for (int x = 0; x < bmp.Width; x++)
{
fixed (int* pDistance = &distanceTable[x, 0])
{
fixed (int* pAngle = &angleTable[x, 0])
{
for (int y = 0; y < bmp.Height; y++)
{
int xp = *(pDistance + y);
int xx = (xp + shiftX) % 128;
int ap = *(pAngle + y);
int yy = (ap + shiftY) % 128;
Color c = a.GetPixel(xx, yy);
b.SetPixel(x, y, c);
}
}
}
}