Advertisement Jump to content
  • Advertisement


  • Content Count

  • Joined

  • Last visited

Community Reputation

226 Neutral

About zppz

  • Rank
  1. Yes, I'm ok now :) Thanks for your help.
  2. cc1plus: error: unrecognised debug output level "dwarf"   But looking through the man pages I just happened to notice this one, which lets me compile and run ok: -fno-dwarf2-cfi-asm     "Emit DWARF unwind info as compiler generated .eh_frame section instead of using GAS .cfi_* directives."
  3. Thanks for the tips. Here are the differences between the defines as given by that command you mentioned:   Defined in cross-compiler but not native     #define __pentiumpro__ 1    #define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_1 1    #define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_2 1    #define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4 1    #define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_8 1    #define __GNUC_PATCHLEVEL__ 3    #define __i686 1    #define __USING_SJLJ_EXCEPTIONS__ 1    #define __i686__ 1    #define __VERSION__ "4.5.3 20110428 (Fedora MinGW 4.5.3-1.fc15)"    #define __pentiumpro 1    #define __GNUC_MINOR__ 5   Defined in native but not cross-compiler:     #define __ORDER_LITTLE_ENDIAN__ 1234    #define __GNUC_PATCHLEVEL__ 2    #define _thiscall __attribute__((__thiscall__))    #define __GCC_HAVE_DWARF2_CFI_ASM 1    #define __tune_i386__ 1    #define __DECIMAL_BID_FORMAT__ 1    #define __VERSION__ "4.6.2"    #define __FLOAT_WORD_ORDER__ __ORDER_LITTLE_ENDIAN__    #define __ORDER_PDP_ENDIAN__ 3412    #define __thiscall __attribute__((__thiscall__))    #define __DBL_DECIMAL_DIG__ 17    #define __ORDER_BIG_ENDIAN__ 4321    #define __BYTE_ORDER__ __ORDER_LITTLE_ENDIAN__    #define __GNUC_MINOR__ 6    #define __FLT_DECIMAL_DIG__ 9   I tried compiling past releases to see where the problem first shows up, it's between 2.30.2 and 2.31.0. In the as_callfunc_x86.cpp file of 2.31.0 some assembler within ifdef __OPTIMIZE__ sections has been modified, and moved from the end of the functions to the beginning, eg: I have no idea what the assembler is doing, but I just reverted this change back to how it was in 2.30.2 and I can build and run ok with the cross-compiler.   So my problem is dealt with now, but let me know if I can try anything else on the cross-compiler if it helps.
  4. Hello! Thanks for all your work on Angelscript and the support here! I am having trouble updating from 2.25.2 to 2.31.2 (yes, a long break). In my program code it was mostly just a case of replacing  asIObjectType with asITypeInfo, but I also had some unexpected problems with building Angelscript itself. On Linux and Windows I had to define __STDC_LIMIT_MACROS to avoid a problem with UINT64_MAX being undefined (Mac seems to be ok without this change). Further, for Windows (mingw32 cross-compiling on Linux) I had a strange compile error from as_callfunc_x86.cpp: {standard input}: Assembler messages: {standard input}:86: Error: CFI instruction used without previous .cfi_startproc {standard input}:87: Error: CFI instruction used without previous .cfi_startproc (... and so on for about 50 lines like this)   I found I could avoid that by defining AS_MAX_PORTABILITY but then I get runtime problems, when my program starts up I want to register some global functions like this: scriptEngine->RegisterGlobalFunction("float rnd()", asFUNCTION(rnd), asCALL_CDECL); ... which returns asNOT_SUPPORTED.   On native Windows (again mingw32 but of course not cross-compiled) I do not need to define AS_MAX_PORTABILITY and all is ok without it. But if I define it I get the same problem so it looks like I just need to avoid it if I can. So I guess the question is, how can I get around that "CFI instruction used..." error without using AS_MAX_PORTABILITY?   If it helps, I'm running on Fedora15 x64 and the mingw32 cross-compiler I'm using is pretty standard, I just did "yum install mingw32*" to have the package manager install everything. I'm using cmake to compile, I only changed one line in CMakeLists.txt to add the two defines I mentioned above: add_definitions(-DANGELSCRIPT_EXPORT -D_LIB -D__STDC_LIMIT_MACROS -DAS_MAX_PORTABILITY) Then I just build like this: mingw32-cmake . mingw32-make
  5. I think the appeal of cocos2d-x is that it allows you to create cross platform apps using C/C++. These languages have been around far longer than Java, so there are dozens of very good IDEs, and hundreds of existing libraries to use. People porting an existing ObjC game to be cross-platform will find it much easier to use than converting the game to libGDX, especially if the existing game uses cocos2d-iphone (which is a pretty good number of them). The app will also run faster in many cases, although usually only noticeable for heavy calculation.
  6. oh... it's apology time again. I don't know why I didn't think of it before (amazing how a nights sleep makes your brain work properly again), but I had two threads touching the same script engine, without appropriate guards to prevent concurrency problems. I think the memory of that earlier thread just clouded my mind and made me jump to conclusions. Sorry for the bother!   As for why it did not occur on lin64, each lib was compiled using the cmake file with no options given, but my lin64 machine has substantially better hardware specs than the others. I guess when threading issues come into the picture, this could be relevant. Thanks again for the help!
  7. I am making an RTS game where the script can get an array of units from the application, and select one of them as a target to shoot at. The function to do this is registered like: se->RegisterObjectMethod("Entity", "Entity@[]@ getAttackableEnemies()", asMETHOD(Entity,getAttackableEnemies), asCALL_THISCALL); ... and this is implemented by filling a CScriptArray of the type given by: se->GetTypeIdByDecl("array<Entity@>")  ... and the script uses it like this: Entity@[] enemies = getAttackableEnemies(); The class itself is registered like: se->RegisterObjectType("Entity", 0, asOBJ_REF); se->RegisterObjectBehaviour("Entity", asBEHAVE_ADDREF, "void f()", asMETHOD(Entity,AddRef), asCALL_THISCALL); se->RegisterObjectBehaviour("Entity", asBEHAVE_RELEASE, "void f()", asMETHOD(Entity,Release), asCALL_THISCALL); The AddRef and Release functions do nothing.   I have been using this on 64-bit Linux for many weeks with no problems, but now on every other platform that I'm trying to port it to (lin32, win32, mac64) it crashes with the failed assertion:   as_gc.cpp:273: void asCGarbageCollector::GetStatistics(asUINT*, asUINT*, asUINT*, asUINT*, asUINT*) const: Assertion `numAdded == gcNewObjects.GetLength() + gcOldObjects.GetLength() + numDestroyed' failed   I have also floundered around trying various other combinations such as registering the function signature as Entity@[]&, or making the script use Entity@[]@ with not much improvement. This is all very similar to a question I asked a while ago here, but obviously I did not completely understand the reason for the solution then, so I am sheepishly returning here again....   In that previous question, the object type was a wrapper for the real C++ class, and was registered with asOBJ_VALUE | asOBJ_POD | asOBJ_APP_CLASS and the script was allowed to instantiate it. I guess I could rewrite everything to do it that way again, but I was wondering if there is something I'm missing with this function registration that would let the script have a direct handle on the C++ class.
  8. argh... apologies again. I was using 2.26.3 and the problem does not occur with 2.27.1 - thanks for all your hard work!!
  9. Hello! Apologies if this has already been brought up somewhere, but I found a crash in the scriptstdstring addon when attempting to use a concatenated string as part of a nested conditional expression. I am using Angelscript for the AI in an RTS game, and I had this to let the script show a label for the units: string s = "Status: " +  ( (m_actionState == AS_MOVETO) ? "moving" : (m_actionState == AS_FIRE_AT_POINT) ? "firing at point" : (m_actionState == AS_FIRE_AT_UNIT) ? "firing at unit" : "idle" ) + "\n"; ... and that worked fine, so I am assuming the problem is not with the nesting of conditional expressions per se.   Next I wanted to show the current speed of movement, so I changed the "moving" part to a concatenated string like this: string s = "Status: " + ( (m_actionState == AS_MOVETO) ? ("moving"+10) : (m_actionState == AS_FIRE_AT_POINT) ? "firing at point" : (m_actionState == AS_FIRE_AT_UNIT) ? "firing at unit" : "idle" ) + "\n"; ...and this caused a crash in the CopyConstructString function. It appears that the 'other' parameter being given to the function is not a string. Obviously the literal 10 is not the value I really want to use, but after some experimentation I narrowed the problem down to the presence of the concatenation operator. It also crashed with concatenation of two strings.   If the branch of the conditional with the concatenation was never used (eg. no units ever entered the AS_MOVETO state), the program would run ok but random garbage characters would show for the text, and a crash would subsequently occur when releasing the asIScriptEngine object.   This is trivial to work around and is not causing me any real problems, but it seems pretty odd so I thought I would report it anyway.    
  10. You are quite correct. I had these incorrect registrations littered all throughout my app :) Perhaps the page I mentioned above could show the corresponding example registration to use, might avoid this problem. I seem to remember at the time I first started instantiating and returning arrays to the script, that I was puzzled for a while about what to do when body[] did not work, and then very pleased with myself when I discovered that body[]& worked. It seems like no harm is done either way though. The only reason I come across this now is because I'm making a command-line mode for my app, so I see these messages showing up on stderr whereas when running in GUI mode they are easier to miss. I have not checked Windows yet, but interestingly these messages were not showing on Linux. Anyhow, it feels good to fix these little niggling things, thanks Andreas!
  11. I am creating a CScriptArray instance and returning it to the script as shown at the bottom of this page:   The script function that receives this is registered like:   scriptEngine->RegisterGlobalFunction("body[]& duplicate(const body[] &in)", asFUNCTION(duplicate_bodies), asCALL_CDECL);   On MacOS, after using this function and then exiting the program I see the "GC cannot free an object of type 'array'" message. Just wondering if I'm doing something wrong, and if I can avoid this somehow.
  12. Yo dawg, we heard you like script engines.... :)
  13. zppz

    What happened to string::split?

    oh... not sure how I managed to miss that. Thanks!
  14. The docs and change notes say that the string class should have a split(string delimiter) function, but I can't find any trace of it in the current source code... just wondering what happened to it.   For now I am using this: string[] split(string str, string delimiter) { string[] parts; int startPos = 0; while (true) { int index = str.findFirst(delimiter, startPos); if ( index == -1 ) { parts.insertLast( str.substr(startPos) ); break; } else { parts.insertLast( str.substr(startPos, index - startPos) ); startPos = index + delimiter.length; } } return parts; }
  15. I did notice the access mask feature, but I did not look into them much because using separate engines worked ok and did not require any managing of masks for each document that the user might open.
  • Advertisement

Important Information

By using, you agree to our community Guidelines, Terms of Use, and Privacy Policy. is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!