• Content count

  • Joined

  • Last visited

Community Reputation

4677 Excellent

About WitchLord

  • Rank
    Moderator - AngelCode

Personal Information

  1. Currently the asOBJ_APP_CLASS_ALIGN8 flag is only needed on ARM and MIPS platforms for classes that contain members of type 'double' that require 64bit alignment on these platforms. The flag won't have any effect on other platforms at the moment.
  2. When to use asOBJ_APP_CLASS_ALLINTS

    Yes, pointers are treated by the compilers as pure POD types, same as integers. If you intend to register a pointer as a type, then you should use the flag asOBJ_APP_PRIMITIVE. I believe how an empty struct like this is treated is compiler specific. I would guess that the flags asOBJ_APP_CLASS | asOBJ_APP_CLASS_ALLINTS should be used, but only by testing it can you be certain. It is possible that the compiler treats this type like a primitive too, in which case asOBJ_APP_PRIMITIVE should be used instead.
  3. Excessive spacing without font smoothing

    Why do you say that the spacing is incorrect? The spacing between characters in fonts are defined by the font designer when he (or she) creates the TrueType font. BMFont just converts the TrueType into a bitmap font. The spacing is usually set to keep a consistent and natural "flow" when reading the text, and not necessarily to keep the characters as close together as possible. If you want to modify the original spacing then you can do so by editing the font descriptor file after it has been generated. Or you can do it dynamically at run-time when writing the text using the bitmap font, if you have access to the code for whatever application you're generating the font for.
  4. Floating point precision (CScriptBuilder?)

    Yes, you should probably use '#define CLEAR_FPU_STACK emms'. I would set it to emms by default except that I remember getting error reports from some people in the past when using 'emms'. In my own applications it doesn't make a difference either way, so I never could figure out why some people are getting trouble when using 'emms' rather than 'fninit'.
  5. I did a quick test today with your code, and I didn't have any problem calling println from the script on the registered Console property. The this pointer used when called from AngelScript is the same as when called from C++. You say you're using an old version of AngelScript. Can you show me which version it is? I do remember fixing a few bugs with RegisterGlobalProperty in the past (though it has been a really long time since then).
  6. Search module for string?

    The original source code is not stored in asIScriptModule after the build is complete. The #include directives are resolved by the CScriptBuilder, which also resolves any #if directives. I suggest you look into modifying this add-on to suit your needs.
  7. Ah, you just posted the code that I asked for I'll take a closer look at this later, perhaps do a little debugging to figure out what the problem is.
  8. Floating point precision (CScriptBuilder?)

    AngelScript doesn't require any specific floating point precision. I do not change the floating point precision in the AngelScript code (at least not intentionally). Can you locate where exactly in the code it is being changed? What platform are you working on? Perhaps there is something wrong in the assembler routines for supporting native calling conventions (as_callfunc_XXX). Regards, Andreas
  9. game->angel->getScriptEngine()->RegisterGlobalProperty("DebugConsole@ Console", dbg); This line tells AngelScript that the property "Console" is a handle (a.k.a. pointer) of type DebugConsole. RegisterGlobalProperty expects to receive the address to the value of the type. So you should be informing the address of the pointer to the DebugConsole. Two alternate solutions: 1. add & in front of dbg to inform the address of the pointer as the argument. 2. change the declaration to "DebugConsole Console" to tell AngelScript that the property is not a handle, but is the actual object. I suspect you really want to use alternative 2, unless you intend to allow the script to reassign the property to a different instance of a DebugConsole object in some circumstances. Regards, Andreas
  10. Tepm object on multiple sub-expression

    Hi ASBai, thanks for reminding me of this topic. I cannot promise anything, but I will definitely bump up the priority on fixing this problem. I'm still far away from releasing the next version, and it is quite possible I will find the time to include an improvement for this too. Regards, Andreas
  11. On Linux 64bit AngelScript needs to know a bit more about the type in order to be able to pass POD types to registered native functions. I assume the Vector2 class is actually a structure with 2 floats and nothing else. In that case you should add the flag asOBJ_APP_CLASS_ALLFLOATS to the RegisterObjectType, Regards, Andreas
  12. angelscript in amalgamation form

    I haven't tried it, but I would assume you could put all the code in a single source code file and compile that. Perhaps with a few minor tweaks here and there. I'm skeptical to the actual advantages of this though. A good modern compiler should be able to do full program optimizations without all the code having to be placed in a single source code file. If you think you would get any performance advantages by doing this then I suggest you give it a try. Make sure you measure the performance before and after so you can validate if it was actually worth it. Should you do this I would be very interested in hearing the result of your tests.
  13. WriteConfigToStream fails to reset namespace

    I've fixed this in revision 2397.
  14. WriteConfigToStream fails to reset namespace

    Thanks. I'll have this fixed.
  15. AddScriptSection reads past the terminating character.

    If there was a compelling reason for accepting the null character as EOF I could easily change the code to do so, but I have to agree with Sir Ementaler on this case. It is better to have the compiler produce an error on unexpected null characters since it is more likely a sign of some error (whether intentionally so, or by some mistake).