Mark Sibly

Forum Replies Created

Viewing 15 posts - 1,021 through 1,035 (of 1,431 total)
  • Author
    Posts
  • in reply to: documentation problems #4793

    Mark Sibly
    Keymaster

    Sorry about that, docs are kind of ‘mid-overhaul’.

    The links in the tree should work, but the links in the actual pages don’t. Fixing now…

    Incidentally, what do you think of the font size – too small? Looks good here but I have a 27″ monitor so I’m not sure…

    in reply to: OSX Cmd+Q/menu quit doesn't quit #4792

    Mark Sibly
    Keymaster

    I have never had any problems with menu->Quit in Ted2 so I have no idea what’s up there.

    To be absolutely clear: You are selecting Quit from the Ted2 file menu and nothing happens?

    I mainly added Cmd-Q so that users can quit their own apps in fullscreen (it can be tricky otherwise on Mac) but the latest change shouldn’t really affect Ted2 behaviour, which here at least has never been broken.

    You could try adding a DebugStop() to fileactions->OnQuit to see if it gets that far or if something else is eating the Cmd-Q key.

    Anyone else having problems with File->Quit on the Mac?

    What version MacOS are you on?

    in reply to: few small ted2 bugs. #4791

    Mark Sibly
    Keymaster

    pressing Tab on multiline selection, doesn’t indent the last line in the selection.

    Will fix this in TextView. Just checked and notepad++ does it and that’s what I’m using as a guide for ‘normal’ editor behaviour these days.

    in reply to: Makedocs memory access violation #4779

    Mark Sibly
    Keymaster

    My bad, try latest master!

    in reply to: New chipmunk 2d module issues #4778

    Mark Sibly
    Keymaster

    Oops, forgot to add these. Try latest master.

    The module doesn’t actually use chipmunk_extern.monkey2 any more, it’s really just there for reference.

    I’ve manually copied bits from this into body.monkey2, shape.monkey2 etc, so it’s possible I’ve missed more.

    in reply to: Import from parent directory? #4764

    Mark Sibly
    Keymaster

    Thanks, can reproduce and there’s a fix on the way.

    in reply to: extern C const pointer #4763

    Mark Sibly
    Keymaster

    Ok, major overhaul of chipmunk now up.

    cpSpace, cpBody etc. are now ‘extends void’ objects so you don’t need use ‘Ptr’ with them anymore. You still need to use cp ‘new’ functions to create them though, eg: cpSpaceNew().

    Callbacks for debug draw and collision handlers are now ‘proper’ mx2 function pointers, ie: you can use functions, methods or lambdas with them. Note that other callbacks are still plain ‘C’ function pointers so they need to be used with global functions or you’ll get a ‘null function’ error when they’re invoked. These may or may not be converted over too depending on demand and whether it’s even possible (the function type really needs a ‘userdata’ pointer for mx2 to hook into). There is also some overhead involved in using mx2 function pointers in terms of GC, so that needs to be taken into consideration too.

    I also added a bunch of ‘extension properties’ to most types too, so you can now go…

    space.Gravity=cv( 0,100 )

    …instead of…

    cpSpaceSetGravity( space,cv( 0,100 ) )

    …but either way will work.

    I’m very happy with this as it’s pretty much zero overhead (except for function pointer glue code) so should be nice and fast, yet it still looks mx2-ish.

    I dealt with the ‘const*’ issue inside the function pointer glue code, and I think in general glue code is probably the sanest way to deal with type system problems like this. A bit tedious, but glue code offers full flexibility.

    Maybe c2mx2 will be able to help with writing glue code one day, but in this case at least (where the function pointer was actually a struct field) it was a little more complex than I could imagine doing via c2mx2 so doing it by hand was really the only option. But it wasn’t a big deal, and I expect all modules produced by c2mx2 will require some amount of tweaking.

    in reply to: cpp2mx2? #4759

    Mark Sibly
    Keymaster

    Not for a while yet.

    in reply to: Concurrent list modification error. #4757

    Mark Sibly
    Keymaster

    > I’ll give the above samples a try.

    The above code for iterating through a container is a bit wrong – here’a another example that also removes items as it goes:

     

    Note that you can replace List with Stack or Deque and it will look/work the same way.

    I don’t see that as much of a stunt as its all part of List’s public functionality.

    But it does depend on undocumented behaviour, eg: it assumes a node can still safely be used after it’s been removed from a list, and also that the ‘head’ node has a null value so you know when you’ve reached the end of list. This is what I mean by ‘stunt’ programming – relying on undocumented implementation details. There is a correct (ie: documented) way to do what you want (see above) so IMO it makes sense to use it.

    In fact, your code *does* break here on the latest version, as I cleaned up node remove so that the node could still be inserted elsewhere safely, but I think I’ll give up on try to make a ‘clean’ list class and just concentrate on trying to duplicate bmx’s/monkey1’s quirks instead!

    Think it’s also time to add RemoveIf() too!

    in reply to: Concurrent list modification error. #4742

    Mark Sibly
    Keymaster

    Does that even work? Isn’t link.Succ null after the Remove()?

    Weirdly, I have grown to really dislike  ‘stunt’ list processing!

    And of course, List.Clear() is fastest…

    in reply to: Mojo 2 changes and an Android question #4738

    Mark Sibly
    Keymaster

    Will these come for Monkey 1 as well.

    Nope.

    So no chance to use the Java libraries anymore for Android?

    The plan is to write a little ‘interpreter’ on the java side using reflection so you can execute java code from c++ simply by going JavaExec( “blah” ) or something, but this is some time off yet.

    in reply to: Concurrent list modification error. #4736

    Mark Sibly
    Keymaster

    >Your code on the first post works fine as is

    The code as posted doesn’t compile, and ‘fixing’ it still leaves you with an empty list! I had to add an item to break it.

    It should also be mentioned that peterigz’s solution is faster – List.Remove() needs to find the item’s node using a linear search, while it.Remove() can just remove the node directly.

    in reply to: Module: SQLITE – Is that what I think it is? :) #4734

    Mark Sibly
    Keymaster

    People have requested support for this every now and then, and it since it’s a ‘one file wonder’ it seemed like a good candidate for c2mx2 experiments!

    in reply to: Concurrent list modification error. #4733

    Mark Sibly
    Keymaster

    I wont be changing this – there’s just no easy way to guarantee you’re not completely messing up a list by removing stuff will you’re iterating through it, and I’m sure there’s a fair few ‘sneaky’ bugs out there due to this.

    It showed up fine in the debugger for me, I just had to click on the first non-module function in the debug view.

    Here’s a super-duper fast way to remove stuff while iterating through a stack:

    in reply to: Mark: V1.091 std:read/writecstring #4711

    Mark Sibly
    Keymaster

    Mark. in the latest build you have completely removed ReadCString and WriteCString

    Oops, meant to restore these sorry. Will do so soon.

Viewing 15 posts - 1,021 through 1,035 (of 1,431 total)