mirror of
git://git.tartarus.org/simon/puzzles.git
synced 2025-04-21 08:01:30 -07:00
Have each game declare a name which is used for window titles etc.
[originally from svn r4167]
This commit is contained in:
2
cube.c
2
cube.c
@ -10,6 +10,8 @@
|
|||||||
|
|
||||||
#include "puzzles.h"
|
#include "puzzles.h"
|
||||||
|
|
||||||
|
const char *const game_name = "Cube";
|
||||||
|
|
||||||
#define MAXVERTICES 20
|
#define MAXVERTICES 20
|
||||||
#define MAXFACES 20
|
#define MAXFACES 20
|
||||||
#define MAXORDER 4
|
#define MAXORDER 4
|
||||||
|
1
gtk.c
1
gtk.c
@ -314,6 +314,7 @@ static frontend *new_window(void)
|
|||||||
midend_new_game(fe->me, NULL);
|
midend_new_game(fe->me, NULL);
|
||||||
|
|
||||||
fe->window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
|
fe->window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
|
||||||
|
gtk_window_set_title(GTK_WINDOW(fe->window), game_name);
|
||||||
#if 0
|
#if 0
|
||||||
gtk_window_set_resizable(GTK_WINDOW(fe->window), FALSE);
|
gtk_window_set_resizable(GTK_WINDOW(fe->window), FALSE);
|
||||||
#else
|
#else
|
||||||
|
2
net.c
2
net.c
@ -11,6 +11,8 @@
|
|||||||
#include "puzzles.h"
|
#include "puzzles.h"
|
||||||
#include "tree234.h"
|
#include "tree234.h"
|
||||||
|
|
||||||
|
const char *const game_name = "Net";
|
||||||
|
|
||||||
#define PI 3.141592653589793238462643383279502884197169399
|
#define PI 3.141592653589793238462643383279502884197169399
|
||||||
|
|
||||||
#define MATMUL(xr,yr,m,x,y) do { \
|
#define MATMUL(xr,yr,m,x,y) do { \
|
||||||
|
@ -93,6 +93,7 @@ void random_free(random_state *state);
|
|||||||
/*
|
/*
|
||||||
* Game-specific routines
|
* Game-specific routines
|
||||||
*/
|
*/
|
||||||
|
extern const char *const game_name;
|
||||||
game_params *default_params(void);
|
game_params *default_params(void);
|
||||||
int game_fetch_preset(int i, char **name, game_params **params);
|
int game_fetch_preset(int i, char **name, game_params **params);
|
||||||
void free_params(game_params *params);
|
void free_params(game_params *params);
|
||||||
|
@ -234,7 +234,7 @@ static frontend *new_window(HINSTANCE inst)
|
|||||||
(WS_THICKFRAME | WS_MAXIMIZEBOX | WS_OVERLAPPED),
|
(WS_THICKFRAME | WS_MAXIMIZEBOX | WS_OVERLAPPED),
|
||||||
TRUE, 0);
|
TRUE, 0);
|
||||||
|
|
||||||
fe->hwnd = CreateWindowEx(0, "puzzle", "puzzle",
|
fe->hwnd = CreateWindowEx(0, game_name, game_name,
|
||||||
WS_OVERLAPPEDWINDOW &~
|
WS_OVERLAPPEDWINDOW &~
|
||||||
(WS_THICKFRAME | WS_MAXIMIZEBOX),
|
(WS_THICKFRAME | WS_MAXIMIZEBOX),
|
||||||
CW_USEDEFAULT, CW_USEDEFAULT,
|
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.hCursor = LoadCursor(NULL, IDC_ARROW);
|
||||||
wndclass.hbrBackground = NULL;
|
wndclass.hbrBackground = NULL;
|
||||||
wndclass.lpszMenuName = NULL;
|
wndclass.lpszMenuName = NULL;
|
||||||
wndclass.lpszClassName = "puzzle";
|
wndclass.lpszClassName = game_name;
|
||||||
|
|
||||||
RegisterClass(&wndclass);
|
RegisterClass(&wndclass);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user