aboutsummaryrefslogtreecommitdiff
path: root/windows.c
diff options
context:
space:
mode:
authorJacob Nevins <jacobn@chiark.greenend.org.uk>2004-12-22 19:27:26 +0000
committerJacob Nevins <jacobn@chiark.greenend.org.uk>2004-12-22 19:27:26 +0000
commit46fa25240e2e1609c4431a639f6e9c4bb6f50b39 (patch)
treecee90db397ae7ddefe8c1aa3466e070c058aa272 /windows.c
parentec3d23c9d99e5233d40080623c032dfe157d29ac (diff)
downloadpuzzles-46fa25240e2e1609c4431a639f6e9c4bb6f50b39.zip
puzzles-46fa25240e2e1609c4431a639f6e9c4bb6f50b39.tar.gz
puzzles-46fa25240e2e1609c4431a639f6e9c4bb6f50b39.tar.bz2
puzzles-46fa25240e2e1609c4431a639f6e9c4bb6f50b39.tar.xz
Add a `jumble' key (`J') to Net, which scrambles the positions of all unlocked
tiles randomly. (Rachel asked for this; it's been being tested for a good few months now, and Simon didn't care either way, so in it goes :) As part of this, the front end can now be asked to provide a random random seed (IYSWIM). [originally from svn r5019]
Diffstat (limited to 'windows.c')
-rw-r--r--windows.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/windows.c b/windows.c
index 494caae..ac5e20c 100644
--- a/windows.c
+++ b/windows.c
@@ -121,6 +121,14 @@ void fatal(char *fmt, ...)
exit(1);
}
+void get_random_seed(void **randseed, int *randseedsize)
+{
+ time_t *tp = snew(time_t);
+ time(tp);
+ *randseed = (void *)tp;
+ *randseedsize = sizeof(time_t);
+}
+
void status_bar(frontend *fe, char *text)
{
SetWindowText(fe->statusbar, text);
@@ -352,12 +360,10 @@ static frontend *new_window(HINSTANCE inst, char *game_id, char **error)
int x, y;
RECT r, sr;
HDC hdc;
- time_t t;
fe = snew(frontend);
- time(&t);
- fe->me = midend_new(fe, &t, sizeof(t));
+ fe->me = midend_new(fe);
if (game_id) {
*error = midend_game_id(fe->me, game_id, FALSE);