Date:2010-09-24 03:30:47 (8 years 8 months ago)
Author:Werner Almesberger
Commit:fbbbd29a2806354ffd5e0b8be3c8c7e3e3af6803
Message: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
Files: solidify/level.c (4 diffs)

Change Details

solidify/level.c
2424#define NEAR 1
2525
2626
27static void draw_map(GtkWidget *widget, struct face *f)
27static void draw_image(GtkWidget *widget, struct face *f)
2828{
2929    int x, y, z;
3030    double z0;
...... 
7070}
7171
7272
73static void draw_image(GtkWidget *da, struct face *f)
74{
75    fprintf(stderr, "%d %g %g\n", f->z_ref, f->fx, f->fy);
76    draw_map(da, f);
77}
78
79
8073static void scroll_z(GtkWidget *da, struct face *f, int up)
8174{
8275    if (up) {
...... 
157150    gtk_container_add(GTK_CONTAINER(evbox), da);
158151    gtk_container_add(GTK_CONTAINER(root), evbox);
159152    gtk_widget_show_all(root);
160    draw_map(da, f);
153    draw_image(da, f);
161154
162155    g_signal_connect(G_OBJECT(evbox), "scroll-event",
163156        G_CALLBACK(scroll_event), f);
...... 
175168    root = gtk_window_new(GTK_WINDOW_TOPLEVEL);
176169    gtk_window_set_position(GTK_WINDOW(root), GTK_WIN_POS_CENTER);
177170
178#if 0
179    /* get root->window */
180    gtk_widget_show_all(root);
181#endif
182
183171    g_signal_connect(G_OBJECT(root), "destroy",
184172        G_CALLBACK(gtk_main_quit), NULL);
185173    make_screen(root, f);

Archive Download the corresponding diff file

Branches:
master



interactive