[Scummvm-devel] Device capabilities

Johannes Schickel lordhoto at gmail.com
Sat Mar 15 16:10:22 CET 2014


On 03/15/2014 03:58 PM, D G Turner wrote:
> Michael,
>    I spoke to Dreammaster who originated this discussion a few days ago
>    about this.  Note that his nickname is not related to the Dreamcast
>    port if that triggered this question.
>
>    I have been meaning to send a note to the list about this, but
>    working code to discuss on Github as a Pull Request would be better
>    so have been holding off till I have time.
>
>    I concluded that the change to the OSystem API would have
>    to be a runtime function of the form of say:
>    virtual bool getPlatformCapability(int32 capabilityToCheck) {
>      // do defaults as case, but for now...
>      return false;
>    }
>
>    This would be declared in common/system.h which would also include
>    the header containing the capabilities i.e. kHasMouse and then each
>    platform would override this and reimplement to return the right
>    value on check.
>
>    The tl;dr here is that the current compile time check would become
>    function calls at runtime. It would only be expected that capabilities
>    are checked once at engine startup... so we are not looking at needing
>    to worry massively about "hotplugging", but we should deal fine with
>    a single build for platforms where a mouse or keyboard _could_ be
>    present, but is not guaranteed/normally i.e. Dreamcast, Wii etc.

Uhm. That sounds overkill. I mean even if you can get a mouse on 
platforms which would define something like "DEVICE_HAS_MOUSE" (though 
we should think of a better name) it should be fine to simply use the 
mouseless codepath because it will still work with it?

// Johannes




More information about the Scummvm-devel mailing list