Mark Sibly

Forum Replies Created

Viewing 15 posts - 811 through 825 (of 1,431 total)
  • Author
    Posts
  • in reply to: Editor Crashes #7585

    Mark Sibly
    Keymaster

    I can copy and paste canvas.monkey – which is 1600 lines long – until the doc is longer than 200000 lines, at which point the textview knob disappears, which is a bug I’ll look at later.

    But no crash. I am however use plain ted2, not ted2go. What are you using to rebuild? rebuildall or rebuildall2go?

    in reply to: Struct goofiness #7577

    Mark Sibly
    Keymaster

    Structs cannot use ‘extends’ – I’m sure they use to give an error, not sure what happened there but I’ll add the error back.

    Hypothetical structs of common base type could not (easily) be added to a stack anyway, mainly because different derived structs may have different sizes, eg: a ‘Text Extends Drawable’ struct may have an extra ‘text’ field etc, and stacks (or really the underlying arrays) expect elements to be of the same size for sane indexing. This is not a problem with class objects, as elements are just pointers.

    In general, this is the core problem with allowing structs to ‘extend’ other structs – converting a derived struct to a base struct (when assigning to var or passing to function) often means truncating the derived struct – and this really means changing the ‘virtual function table’ pointer in case derived’s virtual methods use fields not in base. This means virtual methods are pretty much useless.

    All in all it gets pretty ugly so I decided to give it a miss.

    in reply to: stream, binary file #7561

    Mark Sibly
    Keymaster

    Hi,

    AssetsDir() is working OK here (see below) although you can’t depend on it being present on all targets (eg: there is no AssetsDir on android).

    I’m happy to add more of these BlahDir()s though if people let me know what they want.

    in reply to: Extracting App view image #7560

    Mark Sibly
    Keymaster

    Yeah, canvas.CopyPixmap is about it right now. GLES2.0 lets you read backbuffer/write textures but not vice versa. It shouldn’t be too hard to ‘fake’ it though – please post an issue on github to remind me!

    in reply to: Static Lib Hell #7559

    Mark Sibly
    Keymaster

    You may need to add something like:

    #Import “mylib/include/*.h”

    #Import “<mylib.h>”

    …to your mylib.monkey2 module file. The first import adds the ‘include dir’ to the module, the second adds the actual header file for the lib.

    Take a look at, say, modules/openal.monkey2 for how to import a ‘prebuilt’ lib.

    in reply to: Initialising array of Aliases give error. #7521

    Mark Sibly
    Keymaster

    Might be time for a new binary release soon…

    in reply to: sort with list #7520

    Mark Sibly
    Keymaster

    …actually, this:

    per_list.Sort(ComparePersons(x, y) )

    looks a bit wrong. This actually calls the ‘ComparePersons’ function, but you probably wanted to pass the function to Sort() instead. The way to do that is simply:

    per_list.Sort( ComparePersons )

    Easy!

    Since there is no ‘()’ after ComparePersons, the function is *not* actually called…

    When you go:

    per_list.Sort( ComparePersons(x,y) )

    …this does actually call ComparePersons (which returns an int) and then passes the returned int as a parameter to Sort(), which is probably not what you meant.

    Basically, ‘func()’ calls a function, while ‘func’ on its own does not. This takes a bit of getting used to but the main idea here is that it allows you to pass functions around just like they were ints or floats or arrays or strings or whatever!

    in reply to: LoadBump() for code generated images? #7519

    Mark Sibly
    Keymaster

    Have a look at the source for LoadBump – it basically just uses Texture.Load,Texture.LoadNormal and Image.SetTexture.

    in reply to: sort with list #7505

    Mark Sibly
    Keymaster

    Here’s the basic idea:

    The ‘lambda’ is an ‘inline’ funtion. You can also use a global function or method here, eg: stack.Sort( MyGlobalCompareFunc ).

    The ‘<=>’ operator might look a bit weird, but it basically just returns an int value <0 if x<y, >0 if x>y and 0 if x=y. This is the default behavior if you just call Sort() with no comparison param.

    in reply to: odd sound (wav) issue #7490

    Mark Sibly
    Keymaster

    I can post audio highlighting the issue if needed?

    …that would be useful.

    in reply to: more sound bugs #7489

    Mark Sibly
    Keymaster

    This is just how openal works – I am ‘faking’ panning by positioning the audio source, and it doesn’t work with stero (kinda understandably).

    I may be able to ‘fake’ stero panning somehow in the future, but it’s very low priority.

    in reply to: In App Purchase stuff #7488

    Mark Sibly
    Keymaster

    I don’t know when in-app purchases will be done. 6 months *sounds* reasonable but I’m up to my neck in 3d stuff right now and am not making any promises. IMO, stick with monkey1 if you want something with IAP for now.

    in reply to: Basic reflection question #7487

    Mark Sibly
    Keymaster

    Nice!

    Do you think Reflection will ever allow generics?

    Not sure yet, possibly, but it’ll never be able to ‘instantiate’ types that haven’t already been instantiated at compile time, so it’ll be more limited. eg: You wont be able to use Stack<Vec> if there isn’t a ‘compiled in’ one to begin with. But this is probably OK for many uses.

    in reply to: Is there a concept of Virtual Resolution? #7477

    Mark Sibly
    Keymaster

    Not yet, you still have to do this manually.

    I want to support it though.

    in reply to: Basic reflection question #7476

    Mark Sibly
    Keymaster

    Ok, haven’t actually tried it but  I think the problem is here:

    Local d:= newObj.GetDecl( key )

    In the case of objects, ‘key’ will contain a ‘:’ char so GetDecl will be returning an ‘invalid’ decl as fields don’t have ‘:’ in their names.

    This isn’t easy to spot, as the debugger is struggling a bit with ‘internal’ types like Decl, Variant etc!

    A better approach may be to use a ‘class’ key in the json and leave field names ‘unmangled’.

Viewing 15 posts - 811 through 825 (of 1,431 total)