Skip to content

Commit

Permalink
Merge pull request #26 from space928/general-updates
Browse files Browse the repository at this point in the history
General updates
  • Loading branch information
space928 authored May 4, 2022
2 parents 8841b67 + 45aa333 commit d419b2a
Show file tree
Hide file tree
Showing 7 changed files with 72 additions and 25 deletions.
32 changes: 32 additions & 0 deletions OmsiHook/OmsiFuncClass.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace OmsiHook
{
public class OmsiFuncClass : OmsiObject
{
public OmsiFuncClass() : base() { }

internal OmsiFuncClass(Memory memory, int address) : base(memory, address) { }

public OmsiPointPair[] Pnts
{
get => Memory.ReadMemoryStructArray<OmsiPointPair>(Address + 0x4);
}

public bool PreNullIsNull
{
get => Memory.ReadMemory<bool>(Address + 0x8);
set => Memory.WriteMemory(Address + 0x8, value);
}
public bool AftNullIsNull
{
get => Memory.ReadMemory<bool>(Address + 0x9);
set => Memory.WriteMemory(Address + 0x9, value);
}

}
}
14 changes: 6 additions & 8 deletions OmsiHook/OmsiMap.cs
Original file line number Diff line number Diff line change
Expand Up @@ -122,17 +122,15 @@ public bool DynHelperActive
public OmsiUnschedVehGroup[] UnschedVehGroups => Memory.MarshalStructs<OmsiUnschedVehGroup, OmsiUnschedVehGroupInternal>(
Memory.ReadMemoryStructArray<OmsiUnschedVehGroupInternal>(Address + 0x100));

/*public void Func_TrafficDensity_Passenger //TFuncClass
public OmsiFuncClass Func_TrafficDensity_Passenger
{
get => omsiMemory.ReadMemory<void>(baseAddress + 0x104);
set => omsiMemory.WriteMemory(baseAddress + 0x104, value);
}*/
get => new(Memory, Memory.ReadMemory<int>(Address + 0x104));
}

/*public void Func_TrafficDensity_Road //TFuncClass
public OmsiFuncClass Func_TrafficDensity_Road
{
get => omsiMemory.ReadMemory<void>(baseAddress + 0x108);
set => omsiMemory.WriteMemory(baseAddress + 0x108, value);
}*/
get => new(Memory, Memory.ReadMemory<int>(Address + 0x108));
}

public float Acct_TrafficDensity_Passenger
{
Expand Down
2 changes: 1 addition & 1 deletion OmsiHook/OmsiPartikel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ namespace OmsiHook
public class OmsiPartikel : OmsiObject
{
internal OmsiPartikel(Memory omsiMemory, int baseAddress) : base(omsiMemory, baseAddress) { }
internal OmsiPartikel() : base() { }
public OmsiPartikel() : base() { }

public D3DVector Position
{
Expand Down
7 changes: 3 additions & 4 deletions OmsiHook/OmsiPartikelemitter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ namespace OmsiHook
public class OmsiPartikelEmitter : OmsiObject
{
internal OmsiPartikelEmitter(Memory omsiMemory, int baseAddress) : base(omsiMemory, baseAddress) { }
internal OmsiPartikelEmitter() : base() { }
public OmsiPartikelEmitter() : base() { }

public uint LastEmitTime
{
Expand Down Expand Up @@ -106,12 +106,11 @@ public bool Spotlight_Calc
get => Memory.ReadMemory<bool>(Address + 0x60);
set => Memory.WriteMemory(Address + 0x60, value);
}
/* TODO:
public OmsiPartikel[] Partikel
{
get => omsiMemory.ReadMemory<OmsiPartikel[]>(baseAddress + 0x64);
get => Memory.ReadMemoryObjArray<OmsiPartikel>(Address + 0x64);
//set => omsiMemory.WriteMemory(baseAddress + 0x64, value);
}*/
}
public int Textur
{
get => Memory.ReadMemory<int>(Address + 0x68);
Expand Down
20 changes: 9 additions & 11 deletions OmsiHook/OmsiPassengerCabin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,32 +9,30 @@ public OmsiSeat[] Seats
{
get => Memory.ReadMemoryStructArray<OmsiSeat>(Address + 0x4);
}
/* TODO:
public OmsiPathPoint[] Entries
{
get => Memory.ReadMemoryStructArray<OmsiPathPoint>(Address + 0x8);
}*/
get => Memory.ReadMemoryObjArray<OmsiPathPoint>(Address + 0x8);
}
public OmsiEntryProp[] EntriesProp
{
get => Memory.ReadMemoryStructArray<OmsiEntryProp>(Address + 0xc);
}
/* TODO:
public OmsiPathPoint[] Exits
{
get => Memory.ReadMemoryStructArray<OmsiPathPoint>(Address + 0x10);
}*/
get => Memory.ReadMemoryObjArray<OmsiPathPoint>(Address + 0x10);
}
public OmsiPassCabinStamper Stamper
{
get => Memory.ReadMemory<OmsiPassCabinStamper>(Address + 0x14);
}
public OmsiPassCabinStamper TicketSale // TODO: Make Strings work
public OmsiPassCabinTicketSale TicketSale
{
get => Memory.ReadMemory<OmsiPassCabinStamper>(Address + 0x28);
get => Memory.MarshalStruct<OmsiPassCabinTicketSale, OmsiPassCabinTicketSaleInternal>(
Memory.ReadMemory<OmsiPassCabinTicketSaleInternal>(Address + 0x28));
}
/* TODO:
public OmsiPathPoint[] LinkToOtherVehicle
{
get => Memory.ReadMemoryStructArray<OmsiPathPoint>(Address + 0x7c);
}*/
get => Memory.ReadMemoryObjArray<OmsiPathPoint>(Address + 0x7c);
}
}
}
2 changes: 1 addition & 1 deletion OmsiHook/OmsiPathPoint.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
public class OmsiPathPoint : OmsiObject
{
internal OmsiPathPoint(Memory omsiMemory, int baseAddress) : base(omsiMemory, baseAddress) { }
internal OmsiPathPoint() : base() { }
public OmsiPathPoint() : base() { }
}
}
20 changes: 20 additions & 0 deletions OmsiHook/OmsiStructs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -417,6 +417,20 @@ public struct OmsiPassCabinTicketSale
public int changePos_parent_idx;
public string changePos_parent_str; // ANSIString
public bool valid;
}
public struct OmsiPassCabinTicketSaleInternal
{
public OmsiPathPoint point;
public D3DVector ticketPos;
public D3DVector moneyPos;
public D3DVector moneyPos_var;
public int moneyPos_parent_idx;
[OmsiStrPtr] public int moneyPos_parent_str; // ANSIString
public D3DVector changePos;
public D3DVector changePos_var;
public int changePos_parent_idx;
[OmsiStrPtr] public int changePos_parent_str; // ANSIString
public bool valid;
}
public struct OmsiTreeInfo
{
Expand Down Expand Up @@ -1110,4 +1124,10 @@ public struct OmsiCollFeedback
public D3DVector position;
public float energie;
}

public struct OmsiPointPair
{
public float x;
public float y;
}
}

0 comments on commit d419b2a

Please sign in to comment.