Logo Search packages:      
Sourcecode: scummvm version File versions  Download package

bool OSystem::setGraphicsMode ( const char *  name  ) 

Switch to the graphics mode with the given name. If 'name' is unknown, or if switching to the new mode failed, this method returns false.

Parameters:
name the name of the new graphics mode
Returns:
true if the switch was successful, false otherwise
Note:
This is implemented via the setGraphicsMode(int) method, as well as getSupportedGraphicsModes() and getDefaultGraphicsMode(). In particular, backends do not have to overload this!

Definition at line 48 of file system.cpp.

References getDefaultGraphicsMode(), getSupportedGraphicsModes(), OSystem::GraphicsMode::id, OSystem::GraphicsMode::name, and setGraphicsMode().

                                              {
      if (!name)
            return false;

      // Special case for the 'default' filter
      if (!scumm_stricmp(name, "normal") || !scumm_stricmp(name, "default")) {
            return setGraphicsMode(getDefaultGraphicsMode());
      }

      const GraphicsMode *gm = getSupportedGraphicsModes();

      while (gm->name) {
            if (!scumm_stricmp(gm->name, name)) {
                  return setGraphicsMode(gm->id);
            }
            gm++;
      }

      return false;
}


Generated by  Doxygen 1.6.0   Back to index