Have each game declare a name which is used for window titles etc.

[originally from svn r4167]
This commit is contained in:
Simon Tatham
2004-04-28 17:46:04 +00:00
parent e96f53452a
commit 64e6afdeed
5 changed files with 8 additions and 2 deletions

2
cube.c
View File

@ -10,6 +10,8 @@
#include "puzzles.h"
const char *const game_name = "Cube";
#define MAXVERTICES 20
#define MAXFACES 20
#define MAXORDER 4

1
gtk.c
View File

@ -314,6 +314,7 @@ static frontend *new_window(void)
midend_new_game(fe->me, NULL);
fe->window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
gtk_window_set_title(GTK_WINDOW(fe->window), game_name);
#if 0
gtk_window_set_resizable(GTK_WINDOW(fe->window), FALSE);
#else

2
net.c
View File

@ -11,6 +11,8 @@
#include "puzzles.h"
#include "tree234.h"
const char *const game_name = "Net";
#define PI 3.141592653589793238462643383279502884197169399
#define MATMUL(xr,yr,m,x,y) do { \

View File

@ -93,6 +93,7 @@ void random_free(random_state *state);
/*
* Game-specific routines
*/
extern const char *const game_name;
game_params *default_params(void);
int game_fetch_preset(int i, char **name, game_params **params);
void free_params(game_params *params);

View File

@ -234,7 +234,7 @@ static frontend *new_window(HINSTANCE inst)
(WS_THICKFRAME | WS_MAXIMIZEBOX | WS_OVERLAPPED),
TRUE, 0);
fe->hwnd = CreateWindowEx(0, "puzzle", "puzzle",
fe->hwnd = CreateWindowEx(0, game_name, game_name,
WS_OVERLAPPEDWINDOW &~
(WS_THICKFRAME | WS_MAXIMIZEBOX),
CW_USEDEFAULT, CW_USEDEFAULT,
@ -489,7 +489,7 @@ int WINAPI WinMain(HINSTANCE inst, HINSTANCE prev, LPSTR cmdline, int show)
wndclass.hCursor = LoadCursor(NULL, IDC_ARROW);
wndclass.hbrBackground = NULL;
wndclass.lpszMenuName = NULL;
wndclass.lpszClassName = "puzzle";
wndclass.lpszClassName = game_name;
RegisterClass(&wndclass);
}