Commit Graph
100 Commits
Author SHA1 Message Date
Glenn Maynard 000a896258 use implicit initialization of POD types to simplify SubscriptionManager,
so it's not essentially a templated singleton type (old version will be
phased out)
2005-12-30 07:59:59 +00:00
Glenn Maynard 6e6fcb746a "XToThemedString" uses theme metrics. We don't want DateTime
(used by XmlFile) to depend on THEME, so use localized strings.

We may *always* want LocalizedString.  One reason we may not
is if we start using the DynamicThemeMetric paradigm more.
That evaluates expressions when they're used, which allows
metrics to change dynamically.  However, we may really not
want to do that for localized strings, since it would complicate
translation, so we may want to restrict localized strings to
pre-evaluation anyway.
2005-12-30 07:24:30 +00:00
Glenn Maynard b9f3b4a790 if localizer already registered on construction, refresh 2005-12-30 07:14:21 +00:00
Glenn Maynard 622a6e6698 return ref, to allow returning it from functions that also return ref 2005-12-30 07:12:52 +00:00
Glenn Maynard 9225fa0196 SMPackage includes lua now. Merge DateTimeLua back into DateTime. 2005-12-30 06:20:41 +00:00
Glenn Maynard b6cda2fc47 simplify 2005-12-30 06:12:31 +00:00
Glenn Maynard 65336b7e5c partial test fix 2005-12-30 06:08:57 +00:00
Glenn Maynard 9de5ac05a1 compile fix 2005-12-30 05:48:45 +00:00
Glenn Maynard f939b76f49 i dumb 2005-12-30 05:38:20 +00:00
Glenn Maynard d67288d8a3 simplify 2005-12-30 05:38:02 +00:00
Glenn Maynard 6b26684c8a Don't SaveMappingsToDisk on game change. We save explicitly
when we change mappings.
2005-12-30 04:42:24 +00:00
Glenn Maynard 395b06b5c0 fix comment 2005-12-30 04:36:53 +00:00
Glenn Maynard 8bab05a98a fix weird dependency 2005-12-30 04:25:41 +00:00
Glenn Maynard 61c5ab9cb1 unued 2005-12-30 04:22:04 +00:00
Glenn Maynard 2570959691 cleanup 2005-12-30 04:20:12 +00:00
Glenn Maynard aa2ca76c17 prefs out of PrefsMan 2005-12-30 04:19:55 +00:00
Glenn Maynard 166b57b497 the game loop boosts priority; it's now its job to unboost it, too 2005-12-30 04:10:43 +00:00
Glenn Maynard b078d742ba unneeded include 2005-12-30 04:07:06 +00:00
Glenn Maynard 21da00170d unneeded includes 2005-12-30 04:06:45 +00:00
Glenn Maynard 0330792ab6 unneeded include, fix compile 2005-12-30 04:06:00 +00:00
Glenn Maynard b61ab59e03 use HOOKS->AppHasFocus() 2005-12-30 04:00:05 +00:00
Glenn Maynard c0a86d6c44 use HOOKS->SetHasFocus 2005-12-30 03:59:10 +00:00
Glenn Maynard fcdb6602ab Move focus handling from StepMania.cpp to ArchHooks. Arch-specific
code calls HOOKS->SetHasFocus when focus is lost or regained; user
code calls HOOKS->AppHasFocus as needed.  This moves the very
simple task of remembering focus to ArchHooks, and removes a
few annoying dependencies on StepMania.cpp.  (That's the highest-
level code there is, so very few things should depend on it.)

The original design of HOOKS is to be a place where portable
code calls to do platform-specific things, not to be a place
for nonportable code to call to do generic things.  These
state calls (SetHasFocus, SetToggleWindowed, SetUserQuit) don't
quite fit that.  But there's currently no better place to put
these, and they're just as low-level, so it's not really a
layering violation.  Hmm.

(This also eliminates GameLoop's dependency on StepMania.cpp.  Keeping
GL.cpp independent of SM.cpp is helpful.  It's not as useful to
split apart two files, if the two files are cross-dependent anyway;
you still have to know how both files work in order to understand
either of them.)
2005-12-30 03:57:01 +00:00
Glenn Maynard f06fd4b416 No input driver should ever send a button pressed event without later
sending a corresponding release event.  This results in "stuck
keys" in InputFilter's image of the devices.  We've worked around
this by forcibly releasing all keys when focus is lost, but it's
still a bug in the input driver.  Fix this, by releasing devices
when we discard events.
2005-12-30 02:30:23 +00:00
Glenn Maynard fd072a7da5 FAIL for "impossible" cases where we want a trace; not Throw 2005-12-30 01:15:37 +00:00
Glenn Maynard 4a66ba6267 cleanup 2005-12-29 19:38:58 +00:00
Glenn Maynard e8b9863052 static 2005-12-29 19:34:28 +00:00
Glenn Maynard 3bbd5cd612 cleanup includes 2005-12-29 19:21:27 +00:00
Glenn Maynard 1f1f4a9b69 move out of Screens into Data Structures (which has inadvertently
become "everything else", but better than Screens)
2005-12-29 19:20:49 +00:00
Glenn Maynard 05fc1ac307 includes 2005-12-29 19:16:25 +00:00
Glenn Maynard cea50ab97c header cleanup 2005-12-29 18:33:57 +00:00
Glenn Maynard cdd516fd74 Eliminate SCREEN_WIDTH/HEIGHT from RDisplay. It's up to the
user code to pass the desired camera space dimensions to
LoadMenuPerspective (normally done by Screen).  SDimensions.h
is high-level.
2005-12-29 18:33:03 +00:00
Glenn Maynard c580fc15ef remove old comment; EnterPerspectiveMode is gone 2005-12-29 09:20:40 +00:00
Glenn Maynard 9c5863a751 unneeded 2005-12-29 09:16:33 +00:00
Glenn Maynard 02cdc08486 Nothing else uses these, and we don't even bother exporting them
to Lua.  Remove them to eliminate an SDimensions.h dependency.
2005-12-29 08:49:54 +00:00
Glenn Maynard bbaf375a33 forgot this was stored here. Not sure if it's better for the AR to be stored here, or if ScreenDimensions::GetScreenAspectRatio should be moved to a RDisplay. After all, the dimensions of the screen (the AR preference) are RageDisplay's domain, not the theme's (just as GetThemeAspectRatio belongs to the high-level theme code and not RDisplay). 2005-12-29 08:44:51 +00:00
Glenn Maynard 6855fa9b2c yuck, need GetScreenAspectRatio for ASPECT_AUTO. better approach coming ... 2005-12-29 08:41:18 +00:00
Glenn Maynard 933669684b reduce use of ScreenDimensions in RDisplay 2005-12-29 08:35:04 +00:00
Glenn Maynard c7a3cbc5fb missed a piece 2005-12-29 08:14:52 +00:00
Glenn Maynard 580ff0716a Centering is a user preference, to adjust the screen, not a theme
setting.  It's usually tied to the screen resolution (will usually
need readjustment anyway if the resolution changes).  Treat the
values as pixels, as if we were using glViewport to do this.
(Reduces dependencies on ScreenDimensions.h, and we don't need
to worry about calling ChangeCentering when the theme changes.)
2005-12-29 08:12:51 +00:00
Glenn Maynard 336e3be92b call base (even though it happens to be a no-op right now) 2005-12-29 07:45:06 +00:00
Glenn Maynard eb50b6fc7e unneeded 2005-12-29 07:44:38 +00:00
Glenn Maynard 1f58f31a51 clarify 2005-12-29 07:35:23 +00:00
Glenn Maynard b704036996 refactor so StringToDeviceButton doesn't iterate over every button 2005-12-29 05:10:11 +00:00
Glenn Maynard 8d970cc4ea add SetOneUnthemedChoice for common case
don't theme dynamic choices and already-themed choices
2005-12-29 04:19:22 +00:00
Glenn Maynard a13cbcaafb simplify edit_stop 2005-12-29 04:01:54 +00:00
Glenn Maynard e0c221396d comment 2005-12-29 03:33:00 +00:00
Glenn Maynard 242e8b65fd merge undo handling 2005-12-29 03:29:20 +00:00
Glenn Maynard 9f5b83f65c Rename SM_Success -> SM_SaveSuccessful and SM_Failure to SM_SaveFailed
in the editor, to avoid confusion with the SM_Success message sent when
Prompt pops itself.

Merge completion prompts in home and full mode.  Only show a full
ScreenPrompt if we're about to exit the screen.
2005-12-29 03:27:21 +00:00
Glenn Maynard 6657db528d old comment 2005-12-29 03:05:07 +00:00
Glenn Maynard a373237962 simplify 2005-12-29 03:00:33 +00:00
Glenn Maynard 72bb71d50e use SM_Success; don't duplicate it 2005-12-29 02:59:23 +00:00
Glenn Maynard 18d29783ba compile fix 2005-12-29 02:34:27 +00:00
Glenn Maynard ae17e2ffe3 simplify 2005-12-29 02:24:12 +00:00
Glenn Maynard 5303e7aab9 This isn't right: it'll add a period to the end, even when there was no
extension at all.  Remove it; it wasn't meant to be committed to begin
with.
2005-12-29 02:10:18 +00:00
Glenn Maynard 0e946835b6 filter filenames, so creating an edit named "foo 2/3" doesn't fail when
writing
2005-12-29 01:22:23 +00:00
Glenn Maynard 86572cc1f3 add MakeValidFilename 2005-12-29 01:20:33 +00:00
Glenn Maynard 6177fe5884 fixup 2005-12-29 00:42:03 +00:00
Glenn Maynard 983a34dde4 style 2005-12-28 23:34:10 +00:00
Glenn Maynard b73fe69ff2 style 2005-12-28 23:33:11 +00:00
Glenn Maynard 88fb796c6b cleanup 2005-12-28 21:08:10 +00:00
Glenn Maynard c48acf2b16 use enum_add2 2005-12-28 21:05:43 +00:00
Glenn Maynard 71c7380f44 device-neutral 2005-12-28 20:56:49 +00:00
Glenn Maynard ce93d6be50 fix overlap between keyboard digits and numbered joystick buttons 2005-12-28 20:53:54 +00:00
Glenn Maynard 87dc61af3e operator< for use in maps 2005-12-28 20:53:42 +00:00
Glenn Maynard 70d67b6e5e fix slightly excessive memory usage 2005-12-28 20:50:12 +00:00
Glenn Maynard 3193f1b774 fix slow STestInput 2005-12-28 20:41:51 +00:00
Glenn Maynard 4664c25bee fix excessive memory usage by m_ButtonState 2005-12-28 20:41:24 +00:00
Glenn Maynard 76e78a1bc4 avoid iterating over all buttons 2005-12-28 19:21:01 +00:00
Glenn Maynard 4631c30ca7 remove unused 2005-12-28 19:16:17 +00:00
Glenn Maynard 29422da7d3 MAX_DEVICE_BUTTONS -> NUM_DeviceButton 2005-12-28 19:15:48 +00:00
Glenn Maynard 445df4ea85 Don't poll and acquire the same device in both the input thread and Update. 2005-12-28 19:02:50 +00:00
Glenn Maynard 906179d035 cleanup 2005-12-28 19:00:40 +00:00
Glenn Maynard 596d672d7f remove unused 2005-12-28 18:59:25 +00:00
Glenn Maynard dd04d0d85e cleanup 2005-12-28 18:09:52 +00:00
Glenn Maynard 400580d842 change warnings to assertions 2005-12-28 09:53:03 +00:00
Glenn Maynard 841bbf4c1f remove GetNumDeviceButtons 2005-12-28 09:48:32 +00:00
Glenn Maynard 2d1ad839fa remove old 2005-12-28 09:32:31 +00:00
Glenn Maynard f9140c92ab update use of old function 2005-12-28 09:23:14 +00:00
Glenn Maynard 028cae7117 cosmetic 2005-12-28 09:15:33 +00:00
Glenn Maynard 8f6dcdbecc blind updates (probably incomplete, since this driver differs more widely
from my code)
2005-12-28 09:14:15 +00:00
Glenn Maynard 13087c9585 blind updates 2005-12-28 09:09:55 +00:00
Glenn Maynard 6571f6b475 merge input symbols 2005-12-28 09:04:51 +00:00
Glenn Maynard 31729a349c remove unused 2005-12-28 08:57:30 +00:00
Glenn Maynard c294e8eb74 merge input symbols 2005-12-28 08:55:13 +00:00
Glenn Maynard 7039cafa9a Merge input symbols: any device can have any input key.
- This reduces the number of types associated with input; adding a
   distinct input type doesn't introduce a whole new enumerated type
   and related functions.
 - Special handling for different devices is needed less often.  If you
   want to respond to an F1 press, simply check for KEY_F1; the device
   type doesn't really matter (though it'll usually be a keyboard).
 - This allows cleaner support for generalized USB devices.  While they're
   usually of the traditional classes (keyboard, joystick) with associated
   inputs, they don't have to be.
 - Forced casts between parallel types can be removed, and weakly-specified
   variables (ints instead of the enum type) can be fixed.

Some things that might have been merged havn't; for example, arrow keys
on a keyboard (KEY_UP) are still distinct from axes on a joystick (JOY_UP).
These may or may not be merged in the future.

Some were: removed PUMP_ symbols.  Treat them as generic buttons, and just
give them names with GetDeviceSpecificInputString.  It's not worth
introducing more special names for something only used in one place.
2005-12-28 08:52:20 +00:00
Glenn Maynard 9869b7c196 convenience 2005-12-28 08:49:09 +00:00
Glenn Maynard 9597cf13a4 fixup (this worked because NO_DEFAULT_KEY is defined to -1: "-1-1-1-1") 2005-12-28 08:23:25 +00:00
Glenn Maynard d9862d3ac8 static, typo 2005-12-28 08:21:39 +00:00
Glenn Maynard 7c70c416d8 At some point (1989), ISO-639 changed several language codes, after
the standard had already been released.  What's the point of having
standard language abbreviations if they're subject to change?

"Annex B" in ISO 639-1:2001 (over a decade later, if that's a year) says
"The changes were publicised, but they have not been included in printed
versions of ISO 639."  The first google hit for ISO-639 still makes no mention
of these changes (http://www.w3.org/WAI/ER/IG/ert/iso639.htm).  That rules.

Remove "XS?"; as far as I can tell that's just an error in the "native language"
page.
2005-12-28 06:32:33 +00:00
Glenn Maynard 1ff91344b1 missed commit: cleanups 2005-12-28 06:07:17 +00:00
Glenn Maynard bc372e308b cosmetic changes only 2005-12-28 03:30:37 +00:00
Glenn Maynard 4671102354 cleanup 2005-12-24 07:36:27 +00:00
Glenn Maynard e7e136566b no, seriously, save to disk 2005-12-24 06:07:39 +00:00
Glenn Maynard 0a087099b6 fix possible crash if GetVolumeInformation fails: szVolumeNameBuffer would
be uninitialized
2005-12-24 06:06:45 +00:00
Glenn Maynard 635434ea17 fix for confusingly similar error codes
do log when the file already exists
2005-12-24 03:16:20 +00:00
Glenn Maynard b923d82f90 cleanup 2005-12-24 03:10:22 +00:00
Glenn Maynard 53800b79a3 try to avoid writing to the device to do a wirte check 2005-12-24 03:09:33 +00:00
Glenn Maynard 792f8a4008 unused header
this stuff shouldn't be an input handler anymore ...
2005-12-24 02:38:31 +00:00
Glenn Maynard 33f7552be5 fix potential crash if QueryDosDevice fails, or returns more data than expected 2005-12-24 02:37:06 +00:00