~ubuntu-branches/debian/squeeze/stella/squeeze

« back to all changes in this revision

Viewing changes to src/macosx/OSystemMACOSX.cxx

  • Committer: Bazaar Package Importer
  • Author(s): Stephen Kitt
  • Date: 2010-07-12 23:49:36 UTC
  • mfrom: (1.1.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20100712234936-juawrr3etzhr2qpv
Tags: 3.1.2-1
* New maintainer (closes: #532039).
* New upstream version (closes: #461121):
  - includes launcher (closes: #396058).
* Fix the reference to the X Window System in the description (closes:
  #411815).
* Move to main, DFSG-free ROMs are available (see README.Debian).
* Enhance the package description.
* Drop the libslang2-dev dependency (closes: #560274).
* Remove the Encoding entry from stella.desktop.
* Avoid ignoring errors when cleaning.
* Add ${misc:Depends} to the package dependencies.
* Provide a doc-base file to install the documentation using doc-base.
* Switch to debhelper 7 with a simplified rules file.
* Use autotools-dev to provide updated configuration files.
* Update to Standards-Version 3.9.0:
  - Move to menu section Applications/Emulators.
  - Move the homepage declaration.
* Re-write the manpage.

Show diffs side-by-side

added added

removed removed

Lines of Context:
8
8
//  SS  SS   tt   ee      ll   ll  aa  aa
9
9
//   SSSS     ttt  eeeee llll llll  aaaaa
10
10
//
11
 
// Copyright (c) 1995-2008 by Bradford W. Mott and the Stella team
 
11
// Copyright (c) 1995-2010 by Bradford W. Mott, Stephen Anthony
 
12
// and the Stella Team
12
13
//
13
 
// See the file "license" for information on usage and redistribution of
 
14
// See the file "License.txt" for information on usage and redistribution of
14
15
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
15
16
//
16
 
// $Id: OSystemMACOSX.cxx,v 1.19 2008/05/16 23:56:31 stephena Exp $
 
17
// $Id: OSystemMACOSX.cxx 2001 2010-04-10 21:37:23Z stephena $
17
18
//============================================================================
18
19
 
19
20
#include <cstdlib>
31
32
#include "OSystemMACOSX.hxx"
32
33
#include "MenusEvents.h"
33
34
 
34
 
#ifdef HAVE_GETTIMEOFDAY
35
 
  #include <time.h>
36
 
  #include <sys/time.h>
37
 
#endif
38
 
 
39
35
extern "C" {
40
36
  void macOpenConsole(char *romname);
41
 
  uInt16 macOSXDisplayWidth(void);
42
 
  uInt16 macOSXDisplayHeight(void);
43
37
  void setEmulationMenus(void);
44
38
  void setLauncherMenus(void);
45
39
  void setOptionsMenus(void);
92
86
OSystemMACOSX::OSystemMACOSX()
93
87
  : OSystem()
94
88
{
95
 
  const string& basedir = string(getenv("HOME")) + "/.stella";
96
 
  setBaseDir(basedir);
97
 
  setConfigFile(basedir + "/stellarc");
 
89
  setBaseDir("~/Library/Application Support/Stella");
 
90
 
 
91
  // This will be overridden, as OSX uses plist files for settings
 
92
  setConfigFile("~/Library/Application Support/Stella/stellarc");
98
93
}
99
94
 
100
95
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
103
98
}
104
99
 
105
100
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
106
 
uInt32 OSystemMACOSX::getTicks() const
107
 
{
108
 
#ifdef HAVE_GETTIMEOFDAY
109
 
  timeval now;
110
 
  gettimeofday(&now, 0);
111
 
 
112
 
  return (uInt32) (now.tv_sec * 1000000 + now.tv_usec);
113
 
#else
114
 
  return (uInt32) SDL_GetTicks() * 1000;
115
 
#endif
116
 
}
117
 
 
118
 
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
119
 
void OSystemMACOSX::getScreenDimensions(int& width, int& height)
120
 
{
121
 
  width  = (int)macOSXDisplayWidth();
122
 
  height = (int)macOSXDisplayHeight();
123
 
}
124
 
 
125
 
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
126
101
void OSystemMACOSX::stateChanged(EventHandler::State state)
127
102
{
128
103
  switch(state)