arpie

Forum Replies Created

Viewing 15 posts - 16 through 30 (of 76 total)
  • Author
    Posts
  • in reply to: mx2cc crash during linkage #14212

    arpie
    Participant

    Finally pinpointed the problem and boiled it down to this runnable example.  Uncomment the final line to cause a linkage error.

    Should polymorphism work on ‘static method’s / ‘class function’s?

    in reply to: Bitmap Fonts #14037

    arpie
    Participant

    Mark, what can I say?  Thank you!  I was expecting this to end up at the end of your probably-already-enormous-to-do list.  But you had to go and implement it immediately!  What were you thinking??  Now I have to find some time to try it out…

    in reply to: Bitmap Fonts #14028

    arpie
    Participant

    I’ve only ever used the text-based .fnt format that was supported by Monkey1 (and output by the littera online tool I linked to in the first post).  Is this the same format as bmglyph? (no macos here).  It got the job done but IIRC doesn’t support kerning.  Kerning support would be great if it’s not too much work.

    One major advantage of bitmap fonts is that (unless I’ve misunderstood something, which is quite possible) most font licences allow them to be distributed (more) freely as baked bitmaps but don’t allow you to distribute the TTF/OTF file with your app.

    in reply to: How can I get the device Width and Height? #13493

    arpie
    Participant

    As a slight tangent to this thread, is anybody aware of a reliable way to detect physical device size?

    I want to be able to vary white-space between buttons instead  of just scaling the buttons to be a proportion of full-screen size.  A button should be ‘finger-sized’ on any device, independant of the screen size.

    Is this possible?  And if it is, is it possible in a reliable way?  I know it creates headaches for creating responsive web pages.

    in reply to: Fuzzy DrawLine() in mojo if thickness > 1 #11998

    arpie
    Participant

    I haven’t really been following the shaders development in much detail but thought I might ask… are they now advanced enough to able to deal with FSAA?

    in reply to: Operator To : Cast Self to Derived Class #11684

    arpie
    Participant

    That would probably work, too but I think it will still be a bit clumsy.  I’ll keep playing around.  I really need to stop getting hung up on programming constructs and actually get on with writing a game 🙂

    in reply to: Operator To : Cast Self to Derived Class #11668

    arpie
    Participant

    @immutableoctet I agree it smells bad on the first sniff… but actually I think in this particular use case it makes sense.

    I have an index (StringMap) of similar objects (all subtypes of a common base class).  Inserting objects into the index is easy because subtypes automatically get ‘cast’ to their base class.  Even then, I have some subtypes that require a bit of special treatment when added to the index, which I can do by overloading the Add() method.  Most of the time, all members of this index can be called via virtual methods (indeed I often iterate over the list, calling the virtual methods).

    But occasionally, I want to be able to use the extra (non-virtual) methods available in the subtypes from within more specialised code.  This is rare enough that I don’t want to bump up that functionality into the base class.

    In reality, all I am trying to do is save a little bit of typing during assignment :

    Local thing:Derived
    thing = Cast<Derived>(GetFromIndex(id))

    or

    Local thing:Derived
    thing = GetDerivedFromIndex(id)

    can be more succinctly written as :

    Local thing:Derived
    thing = GetFromIndex(id)

    But the latter requires an implicit cast (which I am trying to squeeze into an Operator To method).

    Another way to look at it is that downcasting in an Operator To method when fetching items from the index seems to me to be a direct analogue to overloading the Add() methods for inserting items.

    I think for now I am going to go the route of using GetDerivedFromIndex() methods, as this also allows me to do some type checking before doing a cast, which is not possible using an explicit cast.

    in reply to: Operator To : Cast Self to Derived Class #11667

    arpie
    Participant

    Having just praised your error messages, I just typed :

    Local a = 15

    And got the error ‘Expecting end of line’, which seems a bit cryptic.

    I’m sure it used to tell me I had missed out the variable type specifier (or := operator).  Have I imagined that?

    Sorry, I’ve gone off topic!

    in reply to: Operator To : Cast Self to Derived Class #11665

    arpie
    Participant

    Getting a memory access violation was a surprise – you usually do a very thorough job, Mark, of catching this sort of thing at compile time and giving us useful, to-the-point error messages!

    I agree, I could live without downcasting in Operator To, but I don’t see that as a reason not to ‘fix’ this ‘sort-of-bug’ if it is not too complicated (when you have 5 minutes to spare :).  I could also live without ever doing any type casting at all… but one day I might wish it was availaible!

    So for now, to make this work, I can do it like this :

    ?

    Actually, this also seems to work :

    Is there any reason I shouldn’t use this?

    in reply to: Android Permissions #11313

    arpie
    Participant

    I’m in the same boat as kheldar13 – I would love to have somewhere quick and easy to store some internal settings on android.  High-scores, level state, parental controls, etc (in txt / json / csv format).  I would also like these settings to be readable (and ideally writable if possible) by other apps.

    Further into the future, I’d also like to be able to store images derived from cropped/edited photos taken on the device or from other sharing sources (whatsapp, downloads…) to allow custom images to be used in my app.

    in reply to: Continue Line #7192

    arpie
    Participant

    And immediately I will contradict myself – Danilo’s list will need ‘)’ and ‘]’ added to it for my first code example to make sense.

    in reply to: Continue Line #7191

    arpie
    Participant

    How exactly would ‘..’ work to solve the OP’s question, ie. to write a multiline string?  The ‘..’ character would either end up in the string or you would also need to use ‘+ ..’ to concatenate each line, in which case there seems to be no need for the ‘..’ character since a line ending in a single ‘+’ is clearly intended to be a multiline expression (isn’t it?).

    I, personally, would go with Danilo’s suggested list of characters.  I can’t think of any others to add to his list.

    I would however add one extra detail (don’t know how hard this would be to implement).  Can the same list of characters be used at the beginning of a line to trigger a skip of the preceding line break?  I like to write code like this:

    I’m sure some of you will look at the above and go “yuk!”, but, well, you’d be wrong 🙂

    in reply to: SimpleLight : issue with normal/specular textures #6954

    arpie
    Participant

    @pepa, I can’t offer any advice about your lighting issue but am intrigued by your style of English.  I am British, living in France so can sympathise with anybody trying to write in a second language.  Do you mind me asking what is your native language?  I hasten to add that your English is excellent and I have understood everything you have written apart from one thing :

    The only thing I didn’t understand is what do you mean by ‘works but not’?  Do you mean it compiles and runs but the output isn’t what you intended?  Do you mean it mostly works but has a small glitch?  Do you simply mean it doesn’t work?

    Good luck finding the solution!

    in reply to: Mojo Render Lagging #6387

    arpie
    Participant

    There is something lagging, somewhere.  I tried to ignore it but it kept bugging me so I decided to try bypassing mojo and used a direct SDL call to get the mouse coordinates and… they are one frame ahead of mojo’s.  Or at least, they are here, anyway.  Attached is the code I used to test this and a screenshot of how it looks here.  Can anybody else test this?  Is it just my hardware or is it a mojo bug (I suspect the mojo bug atm).

    Attachments:
    in reply to: Mojo Render Lagging #5917

    arpie
    Participant

    Does anybody know if it is possible to get the mouse coordinates when the pointer is outside the app window?

Viewing 15 posts - 16 through 30 (of 76 total)