3kimr

Members
  • Content count

    25
  • Joined

  • Last visited

Community Reputation

107 Neutral

About 3kimr

  • Rank
    Member
  1. So what is the news on the release of the tools that youall made for the framework? The documentation seems very sparse at this point as well. I, and i am sure many others, are all eager to give the engine a try, but with only the libraries available, there is only so much we can do.
  2. Looks great, but I am curious as to when we will see a Linux port. Is there one in the pipeline? You have all of the other platforms, and Steam on Linux has been confirmed, so why not? Especially if you have the OpenGL renderer in the OSX version.
  3. Returning from AS ( Comprehension Question )

    dynamic_cast uses C++'s RTTI to do its job, so I doubt it is available in C.
  4. Were asBC_PUSH and asBC_POP removed in the latest trunk? Because the jit compiler isn't compiling with the latest version. [code]2>c:\users\mike\projects\irengine\src\deps\angelscript\extensions\as_jit.cpp(544): error C2065: 'asBC_POP' : undeclared identifier 2>c:\users\mike\projects\irengine\src\deps\angelscript\extensions\as_jit.cpp(544): error C2051: case expression not constant 2>c:\users\mike\projects\irengine\src\deps\angelscript\extensions\as_jit.cpp(556): error C2065: 'asBC_PUSH' : undeclared identifier 2>c:\users\mike\projects\irengine\src\deps\angelscript\extensions\as_jit.cpp(556): error C2051: case expression not constant 2>c:\users\mike\projects\irengine\src\deps\angelscript\extensions\as_jit.cpp(1854): error C2065: 'asBC_PUSH' : undeclared identifier 2>c:\users\mike\projects\irengine\src\deps\angelscript\extensions\as_jit.cpp(1854): error C2051: case expression not constant[/code]
  5. We might need more data, such as where the error is actually occurring. That error crops up when you write to a pointer after it has been freed.
  6. Crash In asCScriptFunction::AddReferences

    Sorry it took me so long. Work. Here is what I have. The class type is END_MenuItem, and the function name is the same, so I am assuming it is the constructor. I don't know if script functions are being called at this point or not, but if that is the case then they shouldn't be because I took out all instances of the class to debug this problem. The class is a hierarchy involving a subclass and an interface. See their code below. [code]funcdef void END_MENUITEM_FUNC(END_MenuItem@ item); class END_MenuItem : Widget { private Vector3 m_DrawColor; private END_MENUITEM_FUNC@ m_Func; private string@ m_Font; private string@ m_Text; private int mSize; private bool bStringMeasured; END_MenuItem(string@ font,int size,string@ txt,END_MENUITEM_FUNC@ f) { END_MenuMode mode = END_MenuMode::MAIN; @m_Func = @f; @m_Font = @font; @m_Text = @txt; mSize = size; m_DrawColor = RGBA( 255,255,255,255 ); bStringMeasured = false; } void OnMousePressed(Mouse mouse) { // Left Mouse Button if(mouse == Mouse::ONE) { } } void OnMouseReleased(Mouse mouse) { } void OnRender() { Canvas@ c = Canvas(); c.DrawString( m_Font,Position,m_DrawColor,mSize,m_Text ); } void SetText( string@ txt ) { m_Text = txt; } }; class Widget : IWidget { private IWidget@ mParent; private Rect mGeometry; private Vector2 mPosition; private bool bIsVisible; private uint uiZOrder; private array<IWidget@> arrChildren; Widget( IWidget@ parent = null ) { @mParent = @parent; if(mParent is null) { @mParent = Ir_GUIRoot.Root; } bIsVisible = true; } bool OnUpdate(float delta_t) { return false; } bool OnRender() { return false; } bool OnDestroyed() { return false; } bool OnCharInsert(uint8 ch) { return false; } bool OnKeyPressed(Keys key) { return false; } bool OnKeyReleased(Keys key) { return false; } bool OnMouseMoved(const Vector2&in delta) { return false; } bool OnMousePressed(Mouse mouse) { return false; } bool OnMouseReleased(Mouse mouse) { return false; } bool Update(float delta_t) final { for(uint i=0;i<arrChildren.length;i++) { arrChildren[i].OnUpdate(delta_t); } return false; } bool Render() final { for(uint i=0;i<arrChildren.length;i++) { if(arrChildren[i].IsVisible) arrChildren[i].OnRender(); } return false; } bool Destroyed() final { for(uint i=0;i<arrChildren.length;i++) { arrChildren[i].OnDestroyed(); } return true; } bool CharInsert(uint8 ch) final { for(uint i=arrChildren.length-1;i>=0;i--) { if(arrChildren[i].CharInsert(ch)) { return true; } } return OnCharInsert(ch); } bool KeyPressed(Keys key) final { for(uint i=arrChildren.length-1;i>=0;i--) { if(arrChildren[i].KeyPressed(key)) { return true; } } return OnKeyPressed(key); } bool KeyReleased(Keys key) final { for(uint i=arrChildren.length-1;i>=0;i--) { if(arrChildren[i].KeyReleased(key)) { return true; } } return OnKeyReleased(key); } bool MouseMoved(const Vector2&in delta) final { for(uint i=arrChildren.length-1;i>=0;i--) { arrChildren[i].MouseMoved(delta); } OnMouseMoved(delta); return false; } bool MousePressed(Mouse mouse) final { for(uint i=0;i<arrChildren.length;i++) { // Short Circuit if(arrChildren[i].MousePressed(mouse)) { return true; } } return OnMousePressed(mouse); } bool MouseReleased(Mouse mouse) final { for(uint i=0;i<arrChildren.length;i++) { // Short Circuit if(arrChildren[i].MousePressed(mouse)) { return true; } } return false; } // Methods void AddChild( IWidget@ widget ) { for(uint i=0;i<arrChildren.length;i++) { IWidget@ child = arrChildren[i]; if(widget.ZOrder < child.ZOrder) { arrChildren.insertAt(i,widget); break; } } } // Properties. IWidget@ Parent { get const { return mParent; } } Vector2 Position { get const { return mPosition; } set { mPosition = value; } } Rect Geometry { get const { return mGeometry; } set { mGeometry = value; } } bool IsVisible { get const { return bIsVisible; } set { bIsVisible = value; } } uint ZOrder { get const { return uiZOrder; } set { uiZOrder = value; } } }; interface IWidget { bool Update(float delta_t); bool Render(); bool Destroyed(); bool CharInsert(uint8 ch); bool KeyPressed(Keys key); bool KeyReleased(Keys key); bool MouseMoved(const Vector2&in delta); bool MousePressed(Mouse mouse); bool MouseReleased(Mouse mouse); // Event callbacks. bool OnUpdate(float delta_t); bool OnRender(); bool OnDestroyed(); bool OnCharInsert(uint8 ch); bool OnKeyPressed(Keys key); bool OnKeyReleased(Keys key); bool OnMouseMoved(const Vector2&in delta); bool OnMousePressed(Mouse mouse); bool OnMouseReleased(Mouse mouse); // Methods void AddChild( IWidget@ widget ); // Properties. IWidget@ Parent { get const; } Vector2 Position { get const; set; } Rect Geometry { get const; set; } bool IsVisible { get const; set; } uint ZOrder { get const; set; } }; [/code] EDIT: Just as I thought, excluding the file that defined END_MenuItem allows the program to run.
  7. Crash In asCScriptFunction::AddReferences

    Alright, I'll take a look at the script when I get home from work. I am using the latest version of angelscript (2.23.0 tag in SVN).
  8. Don't really know what is going on here. Maybe you could provide some insight? Stack trace: [code]> IrCore.dll!asCScriptFunction::AddReferences() Line 661 + 0x26 bytes C++ IrCore.dll!asCCompiler::FinalizeFunction() Line 255 C++ IrCore.dll!asCCompiler::CompileFunction(asCBuilder * builder=0x08e23c68, asCScriptCode * script=0x08e33b90, sExplicitSignature * signature=0x00000000, asCScriptNode * func=0x08e8bcc8, asCScriptFunction * outFunc=0x0adb7040) Line 577 C++ IrCore.dll!asCBuilder::CompileFunctions() Line 637 C++ IrCore.dll!asCBuilder::Build() Line 201 C++ IrCore.dll!asCModule::Build() Line 205 + 0xb bytes C++ IrCore.dll!CScriptBuilder::Build() Line 446 + 0x17 bytes C++ IrCore.dll!CScriptBuilder::BuildModule() Line 80 C++ IrCore.dll!Irre::Stage::LoadScriptModule(const std::basic_string<char,std::char_traits<char>,std::allocator<char> > & module_name="Stage", const std::basic_string<char,std::char_traits<char>,std::allocator<char> > & file="Stages/Menu/main.ang") Line 262 + 0xe bytes C++ IrCore.dll!Irre::Stage::LoadStage(const std::basic_string<char,std::char_traits<char>,std::allocator<char> > & name="Menu") Line 629 + 0xa1 bytes C++ IrCore.dll!Irre::System::InitializeSubsystems() Line 218 + 0x34 bytes C++ [/code] Autos as reported by visual studio: [code]- &byteCode 0x0adb70e0 {array=0x0ae18e20 length=0x00000066 maxLength=0x00000066 ...} asCArray<unsigned long> * + array 0x0ae18e20 unsigned long * length 0x00000066 unsigned int maxLength 0x00000066 unsigned int + buf 0x0adb70ec "ÍÍÍÍÍÍÍÍp†á " char [8] asBC_CALL 0x00000009 int asBC_CALLINTF 0x0000008b int - engine 0x08da8338 {isPrepared=true memoryMgr={...} initialContextStackSize=0x00000400 ...} asCScriptEngine * + asIScriptEngine {...} asIScriptEngine isPrepared true bool + memoryMgr {cs={...} scriptNodePool={...} byteInstructionPool={...} } asCMemoryMgr initialContextStackSize 0x00000400 int + defaultArrayObjectType 0x08dc0600 {name={...} nameSpace={...} size=0x00000000 ...} asCObjectType * + scriptTypeBehaviours {name={...} nameSpace={...} size=0xcdcdcdcd ...} asCObjectType + functionBehaviours {name={...} nameSpace={...} size=0xcdcdcdcd ...} asCObjectType + objectTypeBehaviours {name={...} nameSpace={...} size=0xcdcdcdcd ...} asCObjectType + globalPropertyBehaviours {name={...} nameSpace={...} size=0xcdcdcdcd ...} asCObjectType + registeredObjTypes {array=0x08df2ec0 length=0x0000001e maxLength=0x00000020 ...} asCArray<asCObjectType *> + registeredTypeDefs {array=0x00000000 length=0x00000000 maxLength=0x00000000 ...} asCArray<asCObjectType *> + registeredEnums {array=0x08defcc8 length=0x00000005 maxLength=0x00000008 ...} asCArray<asCObjectType *> + registeredGlobalProps {array=0x08e18290 length=0x00000004 maxLength=0x00000004 ...} asCArray<asCGlobalProperty *> + registeredGlobalFuncs {array=0x08e08b68 length=0x00000077 maxLength=0x00000080 ...} asCArray<asCScriptFunction *> + registeredFuncDefs {array=0x00000000 length=0x00000000 maxLength=0x00000000 ...} asCArray<asCScriptFunction *> + stringFactory 0x08dc6908 {refCount={...} gcFlag=false engine=0x08da8338 ...} asCScriptFunction * configFailed false bool + objectTypes {array=0x08e0f200 length=0x00000023 maxLength=0x00000040 ...} asCArray<asCObjectType *> + templateSubTypes {array=0x08da88f8 length=0x00000001 maxLength=0x00000001 ...} asCArray<asCObjectType *> + templateTypes {array=0x0add2ea8 length=0x00000008 maxLength=0x00000008 ...} asCArray<asCObjectType *> + globalProperties {array=0x08e97b60 length=0x0000000c maxLength=0x00000010 ...} asCArray<asCGlobalProperty *> + freeGlobalPropertyIds {array=0x00000000 length=0x00000000 maxLength=0x00000000 ...} asCArray<int> + scriptFunctions {array=0x0add3aa0 length=0x00000488 maxLength=0x00000800 ...} asCArray<asCScriptFunction *> + freeScriptFunctionIds {array=0x00000000 length=0x00000000 maxLength=0x00000000 ...} asCArray<int> + signatureIds {array=0x0adaa2f8 length=0x000000a9 maxLength=0x00000100 ...} asCArray<asCScriptFunction *> + importedFunctions {array=0x00000000 length=0x00000000 maxLength=0x00000000 ...} asCArray<sBindInfo *> + freeImportedFunctionIdxs {array=0x00000000 length=0x00000000 maxLength=0x00000000 ...} asCArray<int> + refCount {value=0x00000004 } asCAtomic + scriptModules {array=0x08da89b0 length=0x00000001 maxLength=0x00000001 ...} asCArray<asCModule *> + lastModule 0x08e6b028 {name={...} engine=0x08da8338 builder=0x08e23c68 ...} asCModule * isBuilding true bool deferValidationOfTemplateTypes false bool + tok {engine=0x08da8338 alphaKeywordMap={...} nonAlphaKeywordMap={...} } asCTokenizer + classTypes {array=0x08e95800 length=0x00000019 maxLength=0x00000020 ...} asCArray<asCObjectType *> + templateInstanceTypes {array=0x0add2f08 length=0x00000008 maxLength=0x00000008 ...} asCArray<asCObjectType *> + funcDefs {array=0x08e960b8 length=0x00000003 maxLength=0x00000004 ...} asCArray<asCScriptFunction *> + scriptSectionNames {array=0x08e27588 length=0x00000016 maxLength=0x00000020 ...} asCArray<asCString *> typeIdSeqNbr 0x00000038 int + mapTypeIdToDataType {root=0x08dd4410 dummy={...} count=0x00000038 } asCMap<int,asCDataType *> + gc {engine=0x08da8338 gcNewObjects={...} gcOldObjects={...} ...} asCGarbageCollector + defaultGroup {groupName={...} refCount=0x00000000 objTypes={...} ...} asCConfigGroup + configGroups {array=0x08da8bc8 length=0x00000001 maxLength=0x00000001 ...} asCArray<asCConfigGroup *> + currentGroup 0x08da8b44 {groupName={...} refCount=0x00000000 objTypes={...} ...} asCConfigGroup * defaultAccessMask 0x00000001 unsigned long + defaultNamespace {length=0x00000000 dynamic=0xcdcdcd00 <Bad Ptr> local=0x08da8bdc "" } asCString msgCallback true bool + msgCallbackFunc {func=0x101f0ac9 baseOffset=0x00000000 callConv=ICC_CDECL ...} asSSystemFunctionInterface msgCallbackObj 0x00000000 void * + jitCompiler 0x00000000 asIJITCompiler * + stringConstants {array=0x0ae06b50 length=0x00000012 maxLength=0x00000020 ...} asCArray<asCString *> + stringToIdMap {root=0x0adf3000 dummy={...} count=0x00000012 } asCMap<asCStringPointer,int> userData 0x08da8030 void * cleanEngineFunc 0x00000000 void (asIScriptEngine *)* cleanModuleFunc 0x00000000 void (asIScriptModule *)* cleanContextFunc 0x00000000 void (asIScriptContext *)* cleanFunctionFunc 0x00000000 void (asIScriptFunction *)* cleanObjectTypeFunc 0x00000000 void (asIObjectType *)* + engineCritical {criticalSection={...} } asCThreadCriticalSection + ep {allowUnsafeReferences=false optimizeByteCode=true copyScriptSections=true ...} asCScriptEngine::<unnamed-type-ep> - engine->scriptFunctions {array=0x0add3aa0 length=0x00000488 maxLength=0x00000800 ...} asCArray<asCScriptFunction *> + array 0x0add3aa0 asCScriptFunction * * length 0x00000488 unsigned int maxLength 0x00000800 unsigned int + buf 0x08da8948 "" char [8] func 0x00000000 int n 0x00000002 unsigned int + this 0x0adb7040 {refCount={...} gcFlag=true engine=0x08da8338 ...} asCScriptFunction * const [/code]
  9. Alright. Maybe bringing this up in the documentation might help others?
  10. I recently ran into a problem that was solved by changing the way I register global objects. Consider: [code] ResourceType* someResource = new ResourceType(resourceData); string decl("ImageResource@ APPREGISTERED_"+resourceName); pScriptEngine->RegisterGlobalProperty(decl.c_str(),someResource); // Then in script. Frame@ frame1 = APPREGISTERED_SomeResource.GetFrame("some_valid_frame_in_the_resource0001"); // C-C-C-C-CRASH! /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // This won't crash, however. string decl("ImageResource APPREGISTERED_"+resourceName); pScriptEngine->RegisterGlobalProperty(decl.c_str(),someResource); // Then in script. Frame@ frame1 = APPREGISTERED_SomeResource.GetFrame("some_valid_frame_in_the_resource0001"); // This does not crash. [/code] Could this possibly be a bug within AngelScript? Perhaps a script warning is in order?
  11. You guys are awesome! Thank you so much for this contribution.
  12. AngelScript 2.22.2 is released

    W00t, nested namespaces work as well!!! [code]namespace R { namespace Images { Resource_Image@ MainMenu = Resource_Image( "Resources/Images/MainMenu.png","MainMenu",512,512); Resource_Image@ Groucho = Resource_Image( "Resources/Images/groucho-fire.jpg","Groucho",500,340); } // namespace Images namespace Spritesheets { Resource_Spritesheet@ Character = Resource_Spritesheet( "Resources/Spritesheets/Character.json","Character"); } // namespace Spritesheets namespace Fonts { Resource_Font@ Console = Resource_Font( "Resources/Fonts/Inconsolata.otf","Console"); } // namespace Fonts } // Namespace R[/code] I love code generation. =)
  13. AngelScript 2.22.2 is released

    So happy to see namespaces implemented. Now I can cut it out with the crazy hacks to organize global script objects. As for the interface, what is it you had in mind? Because a change like this could potentially break alot of existing code. However, something like a modal interface could work. [code]engine->SetNamespace( "Herp" ); engine->RegisterGlobalProperty( "Derp@ FooDerp",fooderp_pointer ); // Becomes Herp::FooDerp engine->SetNamespace(); // Leave blank to go back to the global namespace.[/code]
  14. Object States

    One thing I liked about Unreal Script is that it included within the language a nice clean mechanism for states in objects. [code]class Mutilator extends Object; state Ravage { function Attack() { // do something horrible and barbaric. } } state Weakened { function Attack() { // do something horrible and barbaric, only weakened. } }[/code] This is a criminally simple example, but you can see what I am getting at. What would I want to look at to implement something like this for Angelscript?
  15. Single-reference type question

    I have a global math object that I use. Since you really don't care about the type in this case and only about what it's name is and what it does, you could register your global object as something like [code] r=e->RegisterObjectType( "G_CGameManager",0,asOBJ_REF ); // Behaviors omitted. r=e->RegisterObjectMethod( "G_CGameManager","void BeginGame() const",asMETHOD(CGameManager,BeginGame),asCALL_THISCALL ); [/code] Then you can register an already allocated instance of your game manager like so. [code] r=e->RegisterGlobalProperty( "const G_CGameManager@ CGameManager",(void*)gGameManager ); [/code] Now any time you want to reference it in your script: [code] CGameManager.BeginGame(); [/code] You just need to make sure that your factory function and your AddRef and Release functions don't do anything.