From 37ae1353fb4ef6013b688b28cd82f06182ad3063 Mon Sep 17 00:00:00 2001 From: "H. Peter Anvin" Date: Tue, 25 Mar 2003 05:28:10 +0000 Subject: Add support for high score tables, including the ability to generate a (hopefully) unique ID for each game that we can use to match identical records. --- keyboard.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'keyboard.c') diff --git a/keyboard.c b/keyboard.c index 06d57b9..69f4732 100644 --- a/keyboard.c +++ b/keyboard.c @@ -26,6 +26,12 @@ static int queuedkeys = 0; */ void push_key(SDL_KeyboardEvent *ke) { + /* Hack to add some nondeterminism into the gameid's */ + if ( !gp.have_id ) { + gp.gameid = (gp.gameid << 5 | gp.gameid >> 59) + + ((uint64_t)SDL_GetTicks() << 32) + genrand_int32(); + } + if ( queuedkeys >= KEYQUEUELEN ) return; /* Drop it */ -- cgit v1.2.3