mirror of
git://projects.qi-hardware.com/ben-scans.git
synced 2024-11-22 08:19:44 +02:00
Minor level.c cleanup.
- solidify/level.c (draw_map): remove, and use draw_image instead - solidify/level.c (scroll_z): removed commented-out root->window initialization
This commit is contained in:
parent
cef7cd5e18
commit
fbbbd29a28
@ -24,7 +24,7 @@
|
|||||||
#define NEAR 1
|
#define NEAR 1
|
||||||
|
|
||||||
|
|
||||||
static void draw_map(GtkWidget *widget, struct face *f)
|
static void draw_image(GtkWidget *widget, struct face *f)
|
||||||
{
|
{
|
||||||
int x, y, z;
|
int x, y, z;
|
||||||
double z0;
|
double z0;
|
||||||
@ -70,13 +70,6 @@ static void draw_map(GtkWidget *widget, struct face *f)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void draw_image(GtkWidget *da, struct face *f)
|
|
||||||
{
|
|
||||||
fprintf(stderr, "%d %g %g\n", f->z_ref, f->fx, f->fy);
|
|
||||||
draw_map(da, f);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static void scroll_z(GtkWidget *da, struct face *f, int up)
|
static void scroll_z(GtkWidget *da, struct face *f, int up)
|
||||||
{
|
{
|
||||||
if (up) {
|
if (up) {
|
||||||
@ -157,7 +150,7 @@ static void make_screen(GtkWidget *root, struct face *f)
|
|||||||
gtk_container_add(GTK_CONTAINER(evbox), da);
|
gtk_container_add(GTK_CONTAINER(evbox), da);
|
||||||
gtk_container_add(GTK_CONTAINER(root), evbox);
|
gtk_container_add(GTK_CONTAINER(root), evbox);
|
||||||
gtk_widget_show_all(root);
|
gtk_widget_show_all(root);
|
||||||
draw_map(da, f);
|
draw_image(da, f);
|
||||||
|
|
||||||
g_signal_connect(G_OBJECT(evbox), "scroll-event",
|
g_signal_connect(G_OBJECT(evbox), "scroll-event",
|
||||||
G_CALLBACK(scroll_event), f);
|
G_CALLBACK(scroll_event), f);
|
||||||
@ -175,11 +168,6 @@ void level(struct face *f)
|
|||||||
root = gtk_window_new(GTK_WINDOW_TOPLEVEL);
|
root = gtk_window_new(GTK_WINDOW_TOPLEVEL);
|
||||||
gtk_window_set_position(GTK_WINDOW(root), GTK_WIN_POS_CENTER);
|
gtk_window_set_position(GTK_WINDOW(root), GTK_WIN_POS_CENTER);
|
||||||
|
|
||||||
#if 0
|
|
||||||
/* get root->window */
|
|
||||||
gtk_widget_show_all(root);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
g_signal_connect(G_OBJECT(root), "destroy",
|
g_signal_connect(G_OBJECT(root), "destroy",
|
||||||
G_CALLBACK(gtk_main_quit), NULL);
|
G_CALLBACK(gtk_main_quit), NULL);
|
||||||
make_screen(root, f);
|
make_screen(root, f);
|
||||||
|
Loading…
Reference in New Issue
Block a user