Commit b62a727d authored by Steven Fuller's avatar Steven Fuller

several week old gtk+ code changes...

parent f4003e54
......@@ -3,11 +3,12 @@ complete:
07/22/01 fix cmap problem at 8bit (Want to change cmaps when going into/from gtk+ menu)
07/23/01 New Game
------------------
finished double buffered gtk+ image
finish double buffered gtk+ image
Save Game, Load Game
find keyboard way of changing focus
fix sprite snapping
find keyboard way of changing focus (and change focus when keyboard accelerator used)
all visuals (loader and drawer code will need to be modified)
fix sprite snapping
get rid of byteswapping
check bigendianesss
choose difficulty (with graphics from game if possible)
Psyched bar
......@@ -37,12 +38,13 @@ try to speed drawing up
play through testing
update copyrights where needed
Documentation
website (no sourceforge this time)
--------- release one anytime after this point ---------
SDL support (for full screen), optional
configure (automake, autoconf, etc?)
website (no sourceforge this time)
finish opengl version
SDL support (for full screen), optional
in game menus instead of gtk+ gui
finish opengl version
experiement with software interpolation at truecolor modes
level editor
TODO:
......
......@@ -374,7 +374,9 @@ void PlayLoop(void)
} while ((Timer-LastTicCount) < Delay);
TicCount = (Timer-LastTicCount);
/*
if (TicCount > 1)
printf("Timer: %d, Tic = %d\n", Timer, TicCount);
*/
gamestate.playtime += TicCount;
......
......@@ -53,6 +53,22 @@ static int image_focus = 1;
void Quit();
void RestoreColors()
{
int i;
for (i = 0; i < cmap->size; i++)
gdk_color_change(cmap, &default_colors[i]);
}
void UpdateColors()
{
int i;
for (i = 0; i < cmap->size; i++)
gdk_color_change(cmap, &game_colors[i]);
}
gint delete_event(GtkWidget *widget, GdkEvent *event, gpointer data)
{
g_print("delete_event\n");
......@@ -64,61 +80,59 @@ void destroy(GtkWidget *widget, gpointer data)
Quit(NULL);
}
static void menu_file_quit(GtkWidget *w, gpointer data)
{
destroy(w, data);
}
static void menu_file_newgame(GtkWidget *w, gpointer data)
{
longjmp(ResetJmp, EX_NEWGAME);
}
void RestoreColors()
static void menu_file_savegame(GtkWidget *w, gpointer data)
{
int i;
for (i = 0; i < cmap->size; i++)
gdk_color_change(cmap, &default_colors[i]);
}
void UpdateColors()
static void menu_file_loadgame(GtkWidget *w, gpointer data)
{
int i;
for (i = 0; i < cmap->size; i++)
gdk_color_change(cmap, &game_colors[i]);
}
static void menu_file_quit(GtkWidget *w, gpointer data)
{
destroy(w, data);
}
static void image_focus_in(GtkWidget *widget, GdkEventButton *event, gpointer data)
static gboolean image_focus_in(GtkWidget *widget, GdkEventButton *event, gpointer data)
{
UpdateColors();
image_focus = 1;
return FALSE;
}
static void image_focus_out(GtkWidget *widget, GdkEventButton *event, gpointer data)
static gboolean image_focus_out(GtkWidget *widget, GdkEventButton *event, gpointer data)
{
RestoreColors();
image_focus = 0;
return FALSE;
}
static int KeyPressed;
void keyboard_handler(int key, int press);
static void key_press(GtkWidget *widget, GdkEventKey *event, gpointer data)
static gboolean key_press(GtkWidget *widget, GdkEventKey *event, gpointer data)
{
/* g_print("press\n"); */
keyboard_handler(event->keyval, 1);
return FALSE;
}
static void key_release(GtkWidget *widget, GdkEventKey *event, gpointer data)
static gboolean key_release(GtkWidget *widget, GdkEventKey *event, gpointer data)
{
/* g_print("release\n"); */
keyboard_handler(event->keyval, 0);
KeyPressed = 1;
return FALSE;
}
static void draw(GtkWidget *widget, GdkRectangle *area, gpointer user_data)
......@@ -134,6 +148,10 @@ static void draw_default(GtkWidget *widget, gpointer user_data)
static GtkItemFactoryEntry menu_items[] = {
{ "/_File", NULL, NULL, 0, "<Branch>" },
{ "/File/New Game", NULL, menu_file_newgame, 0, NULL },
{ "/File/_", NULL, NULL, 0, "<Separator>" },
{ "/File/Save Game", NULL, menu_file_savegame, 0, NULL },
{ "/File/Load Game", NULL, menu_file_loadgame, 0, NULL },
{ "/File/_", NULL, NULL, 0, "<Separator>" },
{ "/File/Quit", "<control>Q", menu_file_quit, 0, NULL }
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment