|
Re: C# wrapper - RELEASE
[Re: Stromausfall]
#284098
08/11/09 18:19
08/11/09 18:19
|
Joined: Dec 2006
Posts: 434 UK,Terra, SolarSystem, Milky W...
pararealist
Senior Member
|
Senior Member
Joined: Dec 2006
Posts: 434
UK,Terra, SolarSystem, Milky W...
|
@Stromausfall Problem in entity class
public class Actor : ENTITY
{
/*create entity player*/
private static ENTITY m_actor = null;
...
public Actor()
{
// m_actor = new ENTITY(); //CRASH
// m_actor = (ENTITY)EngVar.player; //CRASH
//m_actor = (ENTITY)EngFun.ent_create(null, new Vector(0, 0, 0), null); //CRASH
...
}
...
}
CRASHES in Var.cs
public class Var
{
private NativeVar HiddenVar = new NativeVar();
private IntPtr VarIntPtr = IntPtr.Zero;
private int mValue
{
get
{
if (VarIntPtr != IntPtr.Zero)
{
unsafe
{
HiddenVar = *((NativeVar*)VarIntPtr);
}
}
return HiddenVar.mValue;
}
set
{
HiddenVar.mValue = value;
if (VarIntPtr != IntPtr.Zero) //update structure in unmanaged memory if the var was already used as IntPtr
{
Marshal.StructureToPtr(HiddenVar, VarIntPtr, false); //CRASH HERE
}
}
}
In Main called Actor testactor = new Actor(); Please can you try to reproduce? Thanks.
A8.3x Commercial, AcknexWrapper and VS 2010 Express ○pararealist now.
|
|
|
Re: C# wrapper - RELEASE
[Re: pararealist]
#284111
08/11/09 18:57
08/11/09 18:57
|
Joined: Dec 2002
Posts: 616 Austria
Stromausfall
OP
User
|
OP
User
Joined: Dec 2002
Posts: 616
Austria
|
i wrote the following :
public class Actor : ENTITY
{
private static ENTITY m_actor = null;
public Actor()
{
m_actor = new ENTITY(); //CRASH
m_actor = (ENTITY)EngVar.player; //CRASH
m_actor = (ENTITY)EngFun.ent_create(null, new Vector(0, 0, 0), null); //CRASH
}
}
and in my main method i called
Actor testactor = new Actor();
but this call didn't cause any crash, error or exception : / Do you have another example where this crash happens ?
Last edited by Stromausfall; 08/11/09 19:09.
|
|
|
Re: C# wrapper - RELEASE
[Re: Stromausfall]
#284116
08/11/09 19:13
08/11/09 19:13
|
Joined: Dec 2006
Posts: 434 UK,Terra, SolarSystem, Milky W...
pararealist
Senior Member
|
Senior Member
Joined: Dec 2006
Posts: 434
UK,Terra, SolarSystem, Milky W...
|
No, its just in the actor class OK, i will create the actor class new and see, maybe there is an error in the first one somewhere. Its still the same, each call from constructor crashes in the newly created class. // If i comment out the call in main, all is fine. // Sorted it just now, i had left out public before class, how silly of me. can now use
Actor m_actor = new Actor(models + "cbabe.mdl", new Vector(0, 0, 16), Actor.ActorAction);
Last edited by pararealist; 08/15/09 05:02.
A8.3x Commercial, AcknexWrapper and VS 2010 Express ○pararealist now.
|
|
|
Re: C# wrapper - A7.80 V1.0
[Re: Stromausfall]
#284847
08/15/09 13:25
08/15/09 13:25
|
Joined: Dec 2002
Posts: 616 Austria
Stromausfall
OP
User
|
OP
User
Joined: Dec 2002
Posts: 616
Austria
|
version 1.0 of the wrapper for A7.80 was released, it contains all new features of A7.80 except the Engine Variable "sys_active" which be added when the next version of Gamestudio is released. It also features an alternative way to set flags and masks. The manual was also updated (but only the change list ^^) get it here : http://acknexwrapper.matthias-auer.net
|
|
|
|