mirror of
https://github.com/AdAstra-LD/DS-Pokemon-Rom-Editor.git
synced 2026-08-27 21:34:11 -05:00
Handling of fixed-point height [NPCs]
This commit is contained in:
@@ -5908,7 +5908,9 @@ namespace DSPRE {
|
||||
owYMapUpDown.Value = selectedOw.yMapPosition;
|
||||
owXMatrixUpDown.Value = selectedOw.xMatrixPosition;
|
||||
owYMatrixUpDown.Value = selectedOw.yMatrixPosition;
|
||||
owZPositionUpDown.Value = selectedOw.zPosition;
|
||||
|
||||
int zFld = (selectedOw.zPosition >> 4) /*convert from overworld units to fx*/;
|
||||
owZPositionUpDown.Value = zFld / 0x1000; //then convert from fixed point to decimal
|
||||
|
||||
/*ID, Flag and Script number controls */
|
||||
owIDNumericUpDown.Value = selectedOw.owID;
|
||||
@@ -6095,7 +6097,8 @@ namespace DSPRE {
|
||||
return;
|
||||
}
|
||||
|
||||
currentEvFile.overworlds[selection].zPosition = (short)owZPositionUpDown.Value;
|
||||
int zFld = (short)owZPositionUpDown.Value >> 4; //decimal to overworld units
|
||||
currentEvFile.overworlds[selection].zPosition = zFld * 0x1000; //overworld units to fixed point
|
||||
}
|
||||
private void owXMatrixUpDown_ValueChanged(object sender, EventArgs e) {
|
||||
int selection = overworldsListBox.SelectedIndex;
|
||||
|
||||
@@ -119,7 +119,7 @@ namespace DSPRE.ROMFiles {
|
||||
|
||||
public short xMapPosition;
|
||||
public short yMapPosition;
|
||||
public short zPosition;
|
||||
public int zPosition; //fixed point!
|
||||
public ushort xMatrixPosition;
|
||||
public ushort yMatrixPosition;
|
||||
#endregion
|
||||
@@ -292,8 +292,7 @@ namespace DSPRE.ROMFiles {
|
||||
xMatrixPosition = (ushort)(xPosition / MapFile.mapSize);
|
||||
yMatrixPosition = (ushort)(yPosition / MapFile.mapSize);
|
||||
|
||||
zPosition = reader.ReadInt16();
|
||||
unknown3 = reader.ReadUInt16();
|
||||
zPosition = reader.ReadInt32();
|
||||
}
|
||||
}
|
||||
public Overworld(int owID, int xMatrixPosition, int yMatrixPosition) {
|
||||
|
||||
Reference in New Issue
Block a user