Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if ((m.connectionType & (1 << 3)) != 0)
- {
- Connection c = m.connectionUp;
- gb.WriteByte(c.bank);
- gb.WriteByte(c.number);
- Map otherMap = Program.form1.getMap(c.bank, c.number);
- if (otherMap == null)
- {
- gb.BufferLocation += 10;
- }
- else
- {
- int p = otherMap.tileDataLocation;
- int h = otherMap.width - m.width;
- if (h > 0)
- p += (h * otherMap.height) + (otherMap.height * 3) + (otherMap.height + 3);
- else
- p += (otherMap.height * otherMap.width) - (otherMap.width * 3);
- c.tileDataPointer = gb.Get2BytePointer(p);
- gb.WriteBytes(new byte[] { (byte)(c.tileDataPointer[0]), c.tileDataPointer[1] });
- gb.WriteBytes(c.memoryOtherPointer);
- gb.WriteBytes(new byte[] { c.height, c.width });
- gb.WriteByte(c.yOffset);
- gb.WriteByte(c.xOffset);
- gb.WriteBytes(c.memoryCurrentPointer);
- }
- }
- if ((m.connectionType & (1 << 2)) != 0)
- {
- Connection c = m.connectionDown;
- gb.WriteByte(c.bank);
- gb.WriteByte(c.number);
- Map otherMap = Program.form1.getMap(c.bank, c.number);
- if (otherMap == null)
- {
- gb.BufferLocation += 10;
- }
- else
- {
- c.tileDataPointer = gb.Get2BytePointer(otherMap.tileDataLocation);
- gb.WriteBytes(c.tileDataPointer);
- gb.WriteBytes(c.memoryOtherPointer);
- gb.WriteBytes(new byte[] { c.height, c.width });
- gb.WriteByte(c.yOffset);
- gb.WriteByte(c.xOffset);
- gb.WriteBytes(c.memoryCurrentPointer);
- }
- }
- if ((m.connectionType & (1 << 1)) != 0)
- {
- Connection c = m.connectionLeft;
- gb.WriteByte(c.bank);
- gb.WriteByte(c.number);
- Map otherMap = Program.form1.getMap(c.bank, c.number);
- if (otherMap == null)
- {
- gb.BufferLocation += 10;
- }
- else
- {
- int p = otherMap.tileDataLocation;
- int h = otherMap.height - m.height;
- if (h > 0)
- p += (h * otherMap.width) - (otherMap.width * 3) + (otherMap.width - 3);
- else
- p += otherMap.width - 3;
- c.tileDataPointer = gb.Get2BytePointer(p);
- gb.WriteBytes(new byte[] { (byte)(c.tileDataPointer[0]), c.tileDataPointer[1] });
- gb.WriteBytes(c.memoryOtherPointer);
- gb.WriteBytes(new byte[] { c.height, c.width });
- gb.WriteByte(c.yOffset);
- gb.WriteByte(c.xOffset);
- gb.WriteBytes(c.memoryCurrentPointer);
- }
- }
- if ((m.connectionType & 1) != 0)
- {
- Connection c = m.connectionRight;
- gb.WriteByte(c.bank);
- gb.WriteByte(c.number);
- Map otherMap = Program.form1.getMap(c.bank, c.number);
- if (otherMap == null)
- {
- gb.BufferLocation += 10;
- }
- else
- {
- c.tileDataPointer = gb.Get2BytePointer(otherMap.tileDataLocation);
- gb.WriteBytes(c.tileDataPointer);
- gb.WriteBytes(c.memoryOtherPointer);
- gb.WriteBytes(new byte[] { c.height, c.width });
- gb.WriteByte(c.yOffset);
- gb.WriteByte(c.xOffset);
- gb.WriteBytes(c.memoryCurrentPointer);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement