• Content count

  • Joined

  • Last visited

Community Reputation

4678 Excellent

About WitchLord

  • Rank
    Moderator - AngelCode

Personal Information

  1. shared by default

    Including everything from a directory into a single module when compiling sounds like a much easier and less restrictive solution than trying to make everything shared across modules. Your application can easily list all the files in the directory using a name mask (for example *.as) and include each of them as a separate script section (AddScriptSection) in the module before calling Build. The #include directive is not really part of the core language. It is implemented by the application, if desired. The standard add-on ScriptBuilder has a simple implementation that you can use as a base to write your own custom solution.
  2. shared by default

    Not without customizing the library. Why would you want to make everything shared by default? The global variables that you mentioned is one reason. The fact that if everything is shared you'll have difficulty in creating unique logic in separate modules is another. If everything is shared, then why not just put everything in a single module and be done with it. Not at the moment. Support for global shared variables has not yet been implemented. It is on my to-do list though.
  3. error compiling on gcc/x64 with address sanitizer

    That was it. After updating g++ to 5.4.1 the problem was reproduced. I've checked in your fix under revision 2410. Thanks, Andreas
  4. error compiling on gcc/x64 with address sanitizer

    I'm running g++ 4.8.4 on Ubuntu 14.04. I'll upgrade g++ and see if that allow me to reproduce the problem.
  5. error compiling on gcc/x64 with address sanitizer

    I didn't encounter any problem compiling the library using address sanitizer with GNUC and Ubuntu 64bit. What other compiler options are you using? Perhaps it is a specific combination of compiler options that causes the problem you reported. I used the following: g++ -m64 -std=c++11 -fsanitize=address -Wall -fPIC -fno-strict-aliasing -o obj/as_callfunc_x64_gcc.o -c ../../source/as_callfunc_x64_gcc.cpp
  6. Remote visual debugger: asdbg

    Nice work. I look forward to seeing how this evolves. I hope others take interest too and perhaps contribute.
  7. error compiling on gcc/x64 with address sanitizer

    Yes, this is the correct place for reporting problems on AngelScript Thanks for letting me know about the problem and the potential solution. I'll be sure to check it out and if it is correct make the changes as you suggested it. I'll report back when the problem is fixed. Regards, Andreas
  8. Yes, it's true. The tool currently can only recognize UTF8 and UTF16 encoded text files. I'm not sure how to reliably identify other encoding formats.
  9. BMFont: Different results with forcing zero offsets

    I see nothing wrong with the generated font files in either case. For this particular font there shouldn't be any difference between the two. When forcing the offsets to zero BMFont will embed the offsets within the quads themselves, and inspecting the font files I can see that this was done. The difference you see might be a case of rounding errors when drawing the text. Either with the texture coordinates, or the placement of the quads on the screen. For reference, here's the code I use to draw text with: void CFont::InternalWrite(float x, float y, float z, const char *text, int count, float spacing) { if( render->GetGraphics() == 0 ) return; int page = -1; render->Begin(RENDER_QUAD_LIST); y += scale * float(base); for( int n = 0; n < count; ) { int charId = GetTextChar(text, n, &n); SCharDescr *ch = GetChar(charId); if( ch == 0 ) ch = &defChar; // Map the center of the texel to the corners // in order to get pixel perfect mapping float u = (float(ch->srcX)+0.5f) / scaleW; float v = (float(ch->srcY)+0.5f) / scaleH; float u2 = u + float(ch->srcW) / scaleW; float v2 = v + float(ch->srcH) / scaleH; float a = scale * float(ch->xAdv); float w = scale * float(ch->srcW); float h = scale * float(ch->srcH); float ox = scale * float(ch->xOff); float oy = scale * float(ch->yOff); if( ch->page != page ) { render->End(); page = ch->page; render->GetGraphics()->SetTexture(pages ); render->Begin(RENDER_QUAD_LIST); } render->VtxColor(color); render->VtxData(ch->chnl); render->VtxTexCoord(u, v); render->VtxPos(x+ox, y-oy, z); render->VtxTexCoord(u2, v); render->VtxPos(x+w+ox, y-oy, z); render->VtxTexCoord(u2, v2); render->VtxPos(x+w+ox, y-h-oy, z); render->VtxTexCoord(u, v2); render->VtxPos(x+ox, y-h-oy, z); x += a; if( charId == ' ' ) x += spacing; if( n < count ) x += AdjustForKerningPairs(charId, GetTextChar(text,n)); } render->End(); } The complete code can be found here: http://svn.code.sf.net/p/actb/code/trunk/source/gfx/acgfx_font.cpp Regards, Andreas
  10. 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.
  11. 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.
  12. 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.
  13. 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'.
  14. 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).
  15. 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.