[Scummvm-devel] Device capabilities

D G Turner d.g.turner at ntlworld.com
Sat Mar 15 15:58:17 CET 2014


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.

  Will look at sorting out the Github Pull Request later so the
  developers can discuss any proposed implementation.

Thanks,
David Turner

  P.S. I have a Dreamcast myself and have been looking at updating the
  toolchain we use, so it will not be forgotten...

On 15/03/14 11:48, Michael Kronsteiner wrote:
> Sorry for my late answer, and im not an active developer, but how do you
> want to handle this on a dreamcast? i own one WITH extra keyboard and
> mouse, but i guess most users will just have the joypad... compiling
> both supports in is... a bit of heavy lifting which this device already
> does (see dreamcast port)
> 
> On Mon, 2014-03-10 at 23:21 +0200, Eugene Sandulenko wrote:
>> On 10 March 2014 21:48, Dreammaster <dreammaster at scummvm.org> wrote:
>>         Could we perhaps consider introducing defines across all the
>>         systems for features, like "DEVICE_HAS_MOUSE". 
>> Yes, we raised this question in the past and it is a very good idea.





More information about the Scummvm-devel mailing list