Crossfire Client, Branch
R11627
|
Go to the source code of this file.
Functions | |
void | addsmooth (uint16 face, uint16 smooth_face) |
Referenced from common/commands.c. | |
void | allocate_colors (Display *disp, Window w, long screen_num, Colormap *colormap, XColor discolor[16]) |
int | associate_cache_entry (Cache_Entry *ce, int pixnum) |
This functions associates image_data in the cache entry with the specific pixmap number. | |
void | bind_key (const char *params) |
void | check_x_events (void) |
void | cleanup_connection (void) |
Called from disconnect command - that closes the socket - we just need to do the gtk cleanup. | |
void | client_pickup (uint32 pickup) |
We get pickup information from server, update our status. | |
void | client_tick (uint32 tick) |
X11 client doesn't care about this. | |
void | close_container (item *op) |
Open and close_container are now no-ops - since these are now drawn inline as treestores, we don't need to update what we are drawing were. | |
void | command_show (const char *params) |
void | configure_keys (KeyCode k, KeySym keysym) |
int | create_and_rescale_image_from_data (Cache_Entry *ce, int pixmap_num, uint8 *rgba_data, int width, int height) |
Takes the pixmap to put the data into, as well as the rgba data (ie, already loaded with png_to_data). | |
void | display_map_doneupdate (int redraw, int notice) |
Do the map drawing. | |
void | display_map_newmap (void) |
The player has changed maps, so any info we have (for fog of war) is bogus, so clear out all that old info. | |
void | display_map_startupdate (void) |
This isn't used - it is basically a prequel - we know we got a map command from the server, but have digested it all yet. | |
int | display_mapscroll (int dx, int dy) |
void | draw_color_info (int colr, const char *buf) |
Display information in color. | |
void | draw_info (const char *str, int color) |
Add text to the informational message windows. | |
void | draw_lists (void) |
Redraws inventory and look windows when necessary. | |
void | draw_magic_map (void) |
Draws the magic map - basically, it is just a simple encoding of space X is color C. | |
void | draw_message_window (int redraw) |
Updates the stats pain - hp, sp, etc labels. | |
void | draw_prompt (const char *str) |
Draws a prompt. | |
void | draw_stats (int redraw) |
Draws the stats window. | |
void | end_windows (void) |
int | error_handler (Display *dp, XErrorEvent *xe) |
void | event_loop (void) |
event loop iteration stuff | |
int | find_face_in_private_cache (char *face, int checksum) |
int | get_info_width (void) |
This is used by the common help system to determine when to wrap. | |
void | get_map_image_size (int face, uint8 *w, uint8 *h) |
char * | get_metaserver (void) |
Constructs the metaserver dialog and handles metaserver selection. | |
void | image_update_download_status (int start, int end, int total) |
Draws a status bar showing where we our in terms of downloading all the image data. | |
void | init_cache_data (void) |
Initializes the data for image caching Create question mark to display in each supported rendering mode when an image is not cached. | |
void | init_keys (void) |
int | init_pngx_loader (Display *display) |
int | init_sounds (void) |
Opens the audio device, and reads relevant configuration files. | |
int | init_windows (int argc, char **argv) |
void | item_event_container_clearing (item *container) |
void | item_event_item_changed (item *it) |
void | item_event_item_deleting (item *it) |
void | load_defaults (void) |
This function processes the user saved settings file and establishes the configuration of the client. | |
void | magic_map_flash_pos (void) |
Flash the player position on the magic map. | |
int | main (int argc, char *argv[]) |
The client entry point. | |
void | menu_clear (void) |
Clears all the message panels. | |
void | MusicCmd (const char *data, int len) |
void | open_container (item *op) |
void | parse_key (char key, KeyCode keycode, KeySym keysym, int repeated) |
void | parse_key_release (KeyCode kc, KeySym ks) |
void | parse_keybind_line (char *buf, int line, int standard) |
uint8 * | png_to_data (uint8 *data, int len, uint32 *width, uint32 *height) |
int | png_to_xpixmap (Display *display, Drawable draw, unsigned char *data, int len, Pixmap *pix, Pixmap *mask, Colormap *cmap, unsigned long *width, unsigned long *height) |
long | pngx_find_color (Display *display, Colormap *cmap, int red, int green, int blue) |
void | redisplay_stats (void) |
uint8 * | rescale_rgba_data (uint8 *data, int *width, int *height, int scale) |
Takes png data and scales it accordingly. | |
void | reset_image_data (void) |
Connecting to different servers, try to clear out any old images. | |
void | reset_map (void) |
Request a map update from the server. | |
void | resize_map_window (int x, int y) |
Resize_map_window is a NOOP for the time being - not sure if it will in fact need to do something, since there are scrollbars for the map window now. | |
int | rgba_to_xpixmap (Display *display, Drawable draw, uint8 *pixels, Pixmap *pix, Pixmap *mask, Colormap *cmap, unsigned long width, unsigned long height) |
void | save_defaults (void) |
This function saves user settings chosen using the configuration popup dialog. | |
void | save_winpos (void) |
Handles saving of the window positions when the Client | Save Window Position menu item is executed. | |
void | set_autorepeat (const char *s) |
A stub function that does nothing. | |
void | set_scroll (const char *s) |
A stub function that does nothing. | |
void | set_show_icon (const char *s) |
void | set_show_weight (const char *s) |
void | set_weight_limit (uint32 wlim) |
No reason to divide by 1000 everytime we do the display, so do it once and store it here. | |
void | set_window_pos (void) |
void | signal_pipe (int i) |
void | Sound2Cmd (unsigned char *data, int len) |
void | SoundCmd (unsigned char *data, int len) |
? | |
void | unbind_key (const char *params) |
void | write_ch (char key) |
void | x_set_echo (void) |
Referenced from common/commands.c.
face | |
smooth_face |
Definition at line 360 of file image.c.
References pixmaps, and PixmapInfo::smooth_face.
void allocate_colors | ( | Display * | disp, |
Window | w, | ||
long | screen_num, | ||
Colormap * | colormap, | ||
XColor | discolor[16] | ||
) |
Definition at line 172 of file xutil.c.
References colorname.
Referenced by get_game_display(), and get_root_display().
int associate_cache_entry | ( | Cache_Entry * | ce, |
int | pixnum | ||
) |
This functions associates image_data in the cache entry with the specific pixmap number.
Currently, there is no failure condition, but there is the potential that in the future, we want to more closely look at the data and if it isn't valid, return the failure code.
Definition at line 372 of file image.c.
References Cache_Entry::image_data, and pixmaps.
void bind_key | ( | const char * | params | ) |
Definition at line 648 of file keys.c.
References bind_buf, bind_flags, bind_keycode, bind_keysym, commandkey, commandkeysym, completekey, completekeysym, Configure_Keys, cpl, draw_info(), firekey, firekeysym, Player_Struct::input_state, KEYF_EDIT, KEYF_FIRE, KEYF_MODIFIERS, KEYF_NORMAL, KEYF_RUN, MAX_BUF, NDI_BLACK, NDI_RED, nextkey, nextkeysym, prevkey, prevkeysym, runkey, and runkeysym.
void check_x_events | ( | void | ) |
Definition at line 2567 of file x11.c.
References buttonpress_in_info(), buttonpress_in_list(), clear_fire_run(), CONFIG_CACHE, CONFIG_SPLITWIN, cpl, display, display_map_doneupdate(), do_key_press(), draw_all_info(), draw_all_list(), draw_all_message(), draw_lists(), draw_magic_map(), draw_stats(), event, FALSE, Player_Struct::input_state, LOG(), LOG_INFO, magic_map_flash_pos(), Metaserver_Select, monitorChilds(), newimages, noautorepeat, parse_game_button_press(), parse_key_release(), resize_list_info(), resize_win_info(), resize_win_message(), resize_win_root(), Player_Struct::showmagic, TRUE, update_icons_list(), want_config, itemlist::win, win_game, InfoData::win_info, win_message, win_root, win_stats, and wm_delete_window.
Referenced by event_loop(), and get_metaserver().
void cleanup_connection | ( | void | ) |
Called from disconnect command - that closes the socket - we just need to do the gtk cleanup.
Definition at line 329 of file gx11.c.
References cleanup_textmanagers(), and csocket_fd.
void client_pickup | ( | uint32 | pickup | ) |
We get pickup information from server, update our status.
Definition at line 4524 of file gx11.c.
References no_recurse, num_pickups, pickup_count, pickup_mode, pmode, and PU_RATIO.
void client_tick | ( | uint32 | tick | ) |
X11 client doesn't care about this.
Definition at line 4510 of file gx11.c.
References CFG_DM_SDL, CONFIG_DISPLAYMODE, draw_map(), gtk_draw_map(), inventory_tick(), mapdata_animation(), sdl_gen_map(), and use_config.
void close_container | ( | item * | op | ) |
Open and close_container are now no-ops - since these are now drawn inline as treestores, we don't need to update what we are drawing were.
and since the activation of a container will cause the list to be redrawn, don't need to worry about making an explicit call here.
op |
Definition at line 1342 of file inventory.c.
References Player_Struct::below, client_send_apply(), closebutton, CONFIG_APPLY_CONTAINER, cpl, draw_list(), draw_lists(), itemlist::env, FALSE, set_look_list_env(), item_struct::tag, itemlist::title, update_list_labels(), and use_config.
void command_show | ( | const char * | params | ) |
params |
Definition at line 1153 of file inventory.c.
References draw_info(), itemlist::env, inv_notebook, item_struct::inv_updated, MAX_BUF, name, NDI_RED, NUM_INV_LISTS, num_inv_notebook_pages, show_all, show_applied, show_cursed, show_locked, show_magical, show_mask, show_nonmagical, show_unapplied, show_unlocked, show_unpaid, itemlist::show_what, and TYPE_LISTS.
void configure_keys | ( | KeyCode | k, |
KeySym | keysym | ||
) |
Definition at line 998 of file xutil.c.
References bind_buf, bind_flags, bind_keycode, bind_keysym, cpl, draw_info(), draw_message_window(), Player_Struct::fire_on, firekey, Player_Struct::input_state, insert_key(), KEYF_FIRE, KEYF_MODIFIERS, KEYF_RUN, Keys::keysym, MAX_BUF, NDI_BLACK, Playing, Player_Struct::run_on, runkey, and save_keys().
int create_and_rescale_image_from_data | ( | Cache_Entry * | ce, |
int | pixmap_num, | ||
uint8 * | rgba_data, | ||
int | width, | ||
int | height | ||
) |
Takes the pixmap to put the data into, as well as the rgba data (ie, already loaded with png_to_data).
Scales and stores the relevant data into the pixmap structure.
ce | can be NULL |
pixmap_num | |
rgba_data | |
width | |
height |
Definition at line 252 of file image.c.
References BPP, CFG_DM_OPENGL, CFG_DM_PIXMAP, CFG_DM_SDL, colormap, CONFIG_DISPLAYMODE, CONFIG_ICONSCALE, CONFIG_MAPSCALE, create_icon_image(), create_map_image(), DEFAULT_IMAGE_SIZE, display, free_pixmap(), PixmapInfo::height, height, PixmapInfo::icon_height, PixmapInfo::icon_image, PixmapInfo::icon_mask, icon_rescale_factor, PixmapInfo::icon_width, Cache_Entry::image_data, image_size, PixmapInfo::map_height, PixmapInfo::map_image, PixmapInfo::map_mask, PixmapInfo::map_width, PixmapInfo::mask, mask, MAX_ICON_SPACES, MAXPIXMAPNUM, PixmapInfo::pixmap, pixmap, pixmaps, redraw_needed, rescale_rgba_data(), rgba_to_xpixmap(), use_config, PixmapInfo::width, width, and win_game.
void display_map_doneupdate | ( | int | redraw, |
int | notice | ||
) |
Do the map drawing.
If redraw is set, force redraw of all tiles.
If notice is set, another call will follow soon.
Do the map drawing.
this should perhaps be removed, and left to being done from from the main event loop.
redraw | If set, force redraw of all tiles. |
notice | If set, another call will follow soon. |
Do the map drawing.
If notice is set, another call will follow soon.
Definition at line 5300 of file gx11.c.
References Map::cells, CFG_DM_SDL, CONFIG_DISPLAYMODE, CONFIG_MAPHEIGHT, CONFIG_MAPWIDTH, cpl, display, display_mapcell(), gc_floor, gtk_draw_map(), magic_map_flash_pos(), map_updated, MapCell::need_update, pl_pos, redraw_needed, sdl_gen_map(), Player_Struct::showmagic, the_map, TRUE, updatelock, use_config, PlayerPosition::x, and PlayerPosition::y.
void display_map_newmap | ( | void | ) |
The player has changed maps, so any info we have (for fog of war) is bogus, so clear out all that old info.
Definition at line 5319 of file gx11.c.
References reset_map().
void display_map_startupdate | ( | void | ) |
This isn't used - it is basically a prequel - we know we got a map command from the server, but have digested it all yet.
This can be useful if there is info we know we need to store away or the like before it is destroyed, but there isn't anything like that for the gtk client.
int display_mapscroll | ( | int | dx, |
int | dy | ||
) |
dx | |
dy |
Definition at line 88 of file map.c.
References CFG_DM_SDL, CONFIG_DISPLAYMODE, CONFIG_MAPHEIGHT, CONFIG_MAPWIDTH, display, gc_copy, image_size, sdl_mapscroll(), use_config, and win_game.
void draw_color_info | ( | int | colr, |
const char * | buf | ||
) |
Display information in color.
This function simply calls draw_info() with the parameter order swapped, and it provides no unique features. Since it is called from common, it is likely a legacy function that should probably be considered deprecated. Important: This function calls draw_info(), so if a color other than black is specified, the text is routed to both the primary and secondary (critical) message panes.
colr | The color to use when displaying text. |
buf | The text to display. |
Definition at line 1851 of file gx11.c.
References draw_info().
void draw_info | ( | const char * | str, |
int | color | ||
) |
Add text to the informational message windows.
Colored text implies some level of importance, and results in the messge being auto-routed to the critical message panel. Note that with the textbufs, it seems you need to manually set it to the bottom of the screen - otherwise, the scrollbar just stays at the top. However, this does not seem ideal if you are trying to scroll back while new stuff comes in. Question: Is there a good reason for draw_info() and draw_color_info() to write directly to the message panel when add_to_textbuf() does this? Does it really make sense to use color to determine if a message is critical?.
str | Pointer to displayable text. |
color | Color of the text. |
Definition at line 1773 of file gx11.c.
References Info_Pane::adjustment, InfoData::bar_pos, InfoLine::color, Command_Mode, CONFIG_SPLITINFO, CONFIG_TIMESTAMP, CONFIG_TRIMINFO, cpl, InfoData::data, discolor, display, draw_info(), draw_info_freeze1, draw_info_freeze2, draw_info_scrollbar(), FALSE, FONTHEIGHT, FONTWIDTH, InfoData::gc_info, gtkwin_info_text, gtkwin_info_text2, InfoData::has_scrollbar, InfoLine::info, info1_max_chars, info1_num_chars, info2_max_chars, info2_num_chars, InfoData::info_chars, info_pane, InfoData::infoline, InfoData::infopos, Player_Struct::input_state, Player_Struct::input_text, last_str, InfoData::lastcolor, LOG(), LOG_INFO, InfoData::maxdisp, InfoData::maxlines, MIN, NDI_BLACK, NDI_GREY, NDI_WHITE, InfoData::numlines, Reply_Many, root_color, InfoData::scroll_info_window, TRUE, use_config, and InfoData::win_info.
void draw_lists | ( | void | ) |
Redraws inventory and look windows when necessary.
Definition at line 1029 of file inventory.c.
References Player_Struct::below, Player_Struct::container, cpl, draw_inv(), draw_list(), draw_look_list(), item_struct::env, itemlist::env, inv_notebook, item_struct::inv_updated, and Player_Struct::ob.
void draw_magic_map | ( | void | ) |
Draws the magic map - basically, it is just a simple encoding of space X is color C.
Definition at line 4571 of file gx11.c.
References closebutton, cpl, discolor, display, draw_info(), FACE_COLOR_MASK, FALSE, gc_game, gtkwin_magicmap, LOG(), LOG_WARNING, magic_map, magic_map_gc, MAGIC_MAP_PAGE, magicgdkpixmap, Player_Struct::magicmap, map_color, map_notebook, mapvbox, Player_Struct::mapxres, Player_Struct::mapyres, Player_Struct::mmapx, Player_Struct::mmapy, NDI_BLACK, root_color, TRUE, and win_game.
void draw_message_window | ( | int | redraw | ) |
Updates the stats pain - hp, sp, etc labels.
redraw |
Definition at line 2458 of file gx11.c.
References CONFIG_FOODBEEP, cpl, display, draw_stat_bar(), Stat_struct::exp, exp_table, exp_table_max, FALSE, Player_Struct::fire_on, Stat_struct::flags, Stat_struct::food, itemlist::gc_text, Stat_struct::grace, Stat_struct::hp, Stat_struct::level, MAX_BARS_MESSAGE, Stat_struct::maxgrace, Stat_struct::maxhp, Stat_struct::maxsp, messagehint, NUM_RESISTS, Stat_struct::resist_change, resists, Stat_struct::resists, resists_name, Player_Struct::run_on, SF_FIREON, SF_RUNON, Stat_struct::sp, Player_Struct::stats, TRUE, update_stat(), updatelock, use_config, and win_message.
void draw_stats | ( | int | redraw | ) |
Draws the stats window.
If redraw is true, it means we need to redraw the entire thing, and not just do an updated
Definition at line 2015 of file gx11.c.
References StatWindow::ac, Stat_struct::ac, StatWindow::armor, StatWindow::Cha, Stat_struct::Cha, StatWindow::Con, Stat_struct::Con, CONFIG_FOODBEEP, cpl, csocket, StatWindow::dam, Stat_struct::dam, StatWindow::Dex, Stat_struct::Dex, display, StatWindow::exp, Stat_struct::exp, FLOAT_MULTF, StatWindow::food, Stat_struct::food, gc_stats, StatWindow::gr, Stat_struct::grace, StatWindow::hp, Stat_struct::hp, StatWindow::Int, Stat_struct::Int, last_stats, last_used_skills, StatWindow::level, Stat_struct::level, MAX_BUF, MAX_SKILL, Stat_struct::maxgrace, Stat_struct::maxhp, Stat_struct::maxsp, NameMapping::name, need_mapping_update, NUM_RESISTS, StatWindow::playername, StatWindow::Pow, Stat_struct::Pow, PROTECTION_BOXES_X, PROTECTION_BOXES_Y, StatWindow::range, Player_Struct::range, Stat_struct::resist_change, StatWindow::resists, Stat_struct::resists, ClientSocket::sc_version, StatWindow::score, StatWindow::skill, StatWindow::skill_exp, Stat_struct::skill_exp, Stat_struct::skill_level, skill_names, StatWindow::sp, Stat_struct::sp, StatWindow::speed, Stat_struct::speed, Player_Struct::stats, StatWindow::Str, Stat_struct::Str, Player_Struct::title, update_stat_mapping(), updatelock, use_config, NameMapping::value, StatWindow::wc, Stat_struct::wc, Stat_struct::weapon_sp, StatWindow::weapon_speed, win_stats, StatWindow::Wis, and Stat_struct::Wis.
void end_windows | ( | void | ) |
Definition at line 402 of file x11.c.
References display, gc_copy, gc_game, itemlist::gc_icon, InfoData::gc_info, gc_message, gc_root, gc_stats, itemlist::gc_status, itemlist::gc_text, gc_xpm_object, and win_game.
int error_handler | ( | Display * | dp, |
XErrorEvent * | xe | ||
) |
Definition at line 286 of file x11.c.
References MAX_BUF.
Referenced by get_root_display().
void event_loop | ( | void | ) |
event loop iteration stuff
Definition at line 234 of file main.c.
References animate_objects(), check_x_events(), csocket, csocket_fd, do_network(), do_timeout(), DoClient(), ClientSocket::fd, LOG(), LOG_INFO, MAX_TIME, maxfd, script_fdset(), script_process(), and timeout.
int find_face_in_private_cache | ( | char * | face, |
int | checksum | ||
) |
Definition at line 1135 of file xutil.c.
References last_face_num, name, and private_cache.
int get_info_width | ( | void | ) |
This is used by the common help system to determine when to wrap.
Should be able to get width of window, and divide by character width - however, still not perfect if we are using a variable width font. Actually, gtk can do word wrapping for us, so maybe the real fix is to have it to the word wrapping and just run a sufficiently large value. FIXME: should be better than hardcoded value.
Definition at line 4453 of file gx11.c.
References InfoData::info_chars.
void get_map_image_size | ( | int | face, |
uint8 * | w, | ||
uint8 * | h | ||
) |
face | |
w | |
h |
Definition at line 459 of file image.c.
References PixmapInfo::height, PixmapInfo::map_height, map_image_size, PixmapInfo::map_width, MAXPIXMAPNUM, pixmaps, and PixmapInfo::width.
char* get_metaserver | ( | void | ) |
Constructs the metaserver dialog and handles metaserver selection.
Definition at line 5432 of file gx11.c.
References cached_servers_ip, cached_servers_name, cached_servers_num, check_server_version(), check_x_events(), cpl, dialog_xml, draw_map(), draw_prompt(), enable_menu_items(), FALSE, has_init, Player_Struct::input_state, Player_Struct::input_text, LIST_COMMENT, LIST_HOSTNAME, LIST_IDLETIME, LIST_IPADDR, LIST_PLAYERS, LIST_VERSION, MAX_BUF, meta_numservers, meta_servers, meta_sort(), metaserver_button, metaserver_check_status(), metaserver_entry, Metaserver_Select, metaserver_selection, metaserver_selection_func(), metaserver_status, metaserver_window, ms2_info_mutex, on_button_metaserver_quit_pressed(), on_metaserver_select_clicked(), on_metaserver_text_entry_activate(), on_metaserver_text_entry_key_press_event(), on_treeview_metaserver_row_activated(), on_window_destroy_event(), server, store_metaserver, treeview_metaserver, TRUE, and window_root.
void image_update_download_status | ( | int | start, |
int | end, | ||
int | total | ||
) |
Draws a status bar showing where we our in terms of downloading all the image data.
A few hacks: If start is 1, this is the first batch, so it means we need to create the appropriate status window. If start = end = total, it means were finished, so destroy the gui element.
start | The start value just sent to the server. |
end | |
total | The total number of images. |
Definition at line 419 of file image.c.
References draw_info(), FALSE, get_window_coord(), gtkwin_root, MAX_BUF, NDI_BLUE, padj, pbar, pbar_window, TRUE, and window_root.
void init_cache_data | ( | void | ) |
Initializes the data for image caching Create question mark to display in each supported rendering mode when an image is not cached.
When image caching is enabled, if a needed image is not yet in the cache, a question mark image is displayed instead. The image displayed is unique to the display mode. This function creates the image to use when OpenGL mode is in effect.
Definition at line 542 of file image.c.
References CFG_DM_OPENGL, CFG_DM_PIXMAP, CFG_DM_SDL, CONFIG_DISPLAYMODE, create_opengl_question_mark(), display, gc_game, PixmapInfo::height, PixmapInfo::icon_image, PixmapInfo::icon_mask, image_size, init_common_cache_data(), LOG(), LOG_INFO, map_image_size, PixmapInfo::mask, MAXPIXMAPNUM, PixmapInfo::pixmap, pixmap, pixmaps, use_config, PixmapInfo::width, win_root, and window_root.
void init_keys | ( | void | ) |
Definition at line 302 of file keys.c.
References BIG_BUF, cancelkeysym, client_libdir, Keys::command, commandkey, commandkeysym, completekey, completekeysym, cpl, display, firekey, firekeysym, init_default_keybindings(), KEYHASH, LOG(), LOG_INFO, MAX_KEYCODE, Player_Struct::name, Keys::next, nextkey, nextkeysym, parse_keybind_line(), prevkey, prevkeysym, runkey, and runkeysym.
int init_pngx_loader | ( | Display * | display | ) |
Definition at line 482 of file png.c.
References bmask, bshift, color_values, colormap_size, gmask, gshift, MAX_IMAGE_SIZE, need_color_alloc, rev_bshift, rev_gshift, rev_rshift, rmask, rshift, and ximage.
Referenced by get_root_display().
int init_sounds | ( | void | ) |
Opens the audio device, and reads relevant configuration files.
Definition at line 60 of file sound.c.
References sound_settings::audiodev, sound_settings::bit8, bit8, sound_settings::buffers, buffers, sound_settings::buflen, CHILD_STDERR, CHILD_STDIN, CHILD_STDOUT, CONFIG_SOUND, Sound_Info::data, def_sounds, Sound_Info::filename, frequency, sound_settings::frequency, init_audio(), LOG(), LOG_ERROR, LOG_INFO, logChildPipe(), MAX_BUF, MAX_SOUNDS, parse_sound_line(), raiseChild(), sample_size, settings, sign, sound_settings::sign, signal_pipe(), Sound_Info::size, sound_pipe, sound_server, sounds_in_buffer, stereo, sound_settings::stereo, ChildProcess::tube, Sound_Info::volume, want_config, and zerolevel.
int init_windows | ( | int | argc, |
char ** | argv | ||
) |
Definition at line 4997 of file gx11.c.
References CFG_DM_PIXMAP, CFG_DM_SDL, CONFIG_CACHE, CONFIG_DARKNESS, CONFIG_DISPLAYMODE, CONFIG_DOWNLOAD, CONFIG_ECHO, CONFIG_FASTTCP, CONFIG_FOGWAR, CONFIG_ICONSCALE, CONFIG_MAPHEIGHT, CONFIG_MAPSCALE, CONFIG_MAPSCROLL, CONFIG_MAPWIDTH, CONFIG_NUMS, CONFIG_POPUPS, CONFIG_PORT, CONFIG_RESISTS, CONFIG_SHOWICON, CONFIG_SMOOTH, CONFIG_SOUND, CONFIG_SPLASH, CONFIG_SPLITINFO, CONFIG_SPLITWIN, CONFIG_TRIMINFO, DEFAULT_IMAGE_SIZE, destroy_splash(), face_info, FALSE, font_name, FULL_VERSION, gargc, gargv, get_game_display(), get_info_display(), get_inv_display(), get_look_display(), get_message_display(), get_root_display(), get_stats_display(), gtk_checkchilds(), history, image_size, info_ratio, init_cache_data(), init_keys(), inv_list, INV_WIDTH, itemlist_set_show_icon(), load_defaults(), LOG(), LOG_INFO, LOG_WARNING, map_image_half_size, map_image_size, MAP_MAX_SIZE, mapdata_init(), MAX_HISTORY, InfoData::maxlines, MINLOG, noautorepeat, server, set_window_pos(), itemlist::show_icon, sound_server, sync_display, time_map_redraw, TRUE, updatekeycodes, usage(), use_config, VERSION_INFO, want_config, Face_Information_struct::want_faceset, want_skill_exp, and InfoData::width.
void item_event_container_clearing | ( | item * | container | ) |
Definition at line 525 of file inventory.c.
References container_clearing_one(), and views.
void item_event_item_changed | ( | item * | it | ) |
Definition at line 489 of file inventory.c.
References can_write_spell_on(), item_changed_anim_hook(), item_changed_one(), spellinventory, and views.
void item_event_item_deleting | ( | item * | it | ) |
Definition at line 596 of file inventory.c.
References can_write_spell_on(), item_deleting_one(), item_to_widget_remove_item(), spellinventory, and views.
void load_defaults | ( | void | ) |
This function processes the user saved settings file and establishes the configuration of the client.
Definition at line 710 of file config.c.
References CFG_DM_PIXMAP, CFG_DM_SDL, CFG_LT_PIXEL, CFG_LT_TILE, COMMAND_WINDOW, CONFIG_CACHE, CONFIG_CWINDOW, CONFIG_DARKNESS, CONFIG_DISPLAYMODE, CONFIG_FOODBEEP, CONFIG_ICONSCALE, CONFIG_LIGHTING, CONFIG_MAPHEIGHT, CONFIG_MAPSCALE, CONFIG_MAPWIDTH, config_names, CONFIG_NUMS, CONFIG_POPUPS, CONFIG_PORT, CONFIG_RESISTS, CONFIG_SHOWICON, CONFIG_SOUND, CONFIG_SPLASH, CONFIG_SPLITWIN, DEFAULT_IMAGE_SIZE, face_info, FALSE, font_name, image_size, inv_list, itemlist_set_show_icon(), LOG(), LOG_WARNING, map_image_half_size, map_image_size, MAP_MAX_SIZE, MAX_BUF, InfoData::maxlines, noautorepeat, InfoData::scroll_info_window, server, itemlist::show_icon, sound_server, strdup_local(), TRUE, use_config, want_config, Face_Information_struct::want_faceset, and window_xml_file.
Referenced by init_windows(), and parse_args().
void magic_map_flash_pos | ( | void | ) |
Flash the player position on the magic map.
Definition at line 4766 of file gx11.c.
References background, cpl, display, foreground, gc_game, gtkwin_magicmap, magic_map, magic_map_gc, MAGIC_MAP_PAGE, magicgdkpixmap, map_color, map_notebook, mapvbox, Player_Struct::mapxres, Player_Struct::mapyres, Player_Struct::pmapx, Player_Struct::pmapy, root_color, Player_Struct::showmagic, TRUE, and win_game.
int main | ( | int | argc, |
char * | argv[] | ||
) |
The client entry point.
argc | |
argv |
Definition at line 5546 of file gx11.c.
References audio_play(), Player_Struct::below, SockList::buf, sound_settings::buffers, buffers, sound_settings::buflen, cached_server_file, clear_stat_mapping(), colorname, config_init(), CONFIG_MAPHEIGHT, CONFIG_MAPWIDTH, CONFIG_POPUPS, CONFIG_PORT, CONFIG_SOUND, cpl, ClientSocket::cs_version, csocket, current_buffer, dialog_xml, dialog_xml_file, dialog_xml_path, display_map_doneupdate(), draw_info_windows(), draw_look_list(), draw_splash(), enable_menu_items(), itemlist::env, err, error_dialog(), event_loop(), FALSE, ClientSocket::fd, first_free_buffer, get_metaserver(), gLogHandler(), gtkLogListener(), handle, ClientSocket::inbuf, info_init(), init_cache_data(), init_client_vars(), init_connection(), init_sounds(), init_text_callbacks(), init_windows(), inventory_init(), keyfunc(), keyrelfunc(), keys_init(), SockList::len, load_theme(), load_window_positions(), locate_item(), LOG(), LOG_CRITICAL, magic_map, map_init(), mapdata_reset(), MAX_BUF, maxfd, MAXSOCKBUF, meta_port, meta_server, metaserver_get_info(), metaserver_select(), metaserver_show(), negotiate_connection(), NUM_COLORS, Player_Struct::ob, on_drawingarea_magic_map_expose_event(), on_window_destroy_event(), parse_args(), pickup_init(), rcsid_cfsndserv_c, read_settings(), remove_item_inventory(), reset_client_vars(), reset_image_data(), root_color, server, set_look_list_env(), setLogListener(), settings, sigpipe_handler(), sndbuf_pos, SoundCmd(), soundfd, sounds_in_buffer, stats_init(), TRUE, use_config, want_config, window_root, window_xml, window_xml_file, window_xml_path, write_settings(), XML_PATH_DEFAULT, and zerolevel.
void menu_clear | ( | void | ) |
Clears all the message panels.
It is not clear why someone would use it, but is called from the common area, and so is supported here.
Definition at line 3241 of file gx11.c.
References draw_info(), gtkwin_info_text, gtkwin_info_text2, info_pane, NDI_BLACK, and NUM_TEXT_VIEWS.
void MusicCmd | ( | const char * | data, |
int | len | ||
) |
Definition at line 199 of file sound.c.
References LOG(), and LOG_WARNING.
void open_container | ( | item * | op | ) |
op |
Definition at line 1334 of file inventory.c.
References closebutton, item_struct::d_name, draw_list(), draw_lists(), itemlist::env, set_look_list_env(), itemlist::title, TRUE, and update_list_labels().
void parse_key | ( | char | key, |
KeyCode | keycode, | ||
KeySym | keysym, | ||
int | repeated | ||
) |
Definition at line 578 of file xutil.c.
References Keys::command, Command_Mode, commandkey, commandkeysym, CONFIG_ECHO, Player_Struct::count, counttext, cpl, Keys::direction, draw_info(), draw_message_window(), draw_prompt(), entrytext, extended_command(), FALSE, fire_dir(), fire_label, Player_Struct::fire_on, firekey, firekeysym, Keys::flags, Player_Struct::input_state, Player_Struct::input_text, KEYF_EDIT, KEYF_FIRE, KEYF_MODIFIERS, KEYF_NORMAL, KEYF_RUN, Keys::keysym, MAX_BUF, NDI_BLACK, Keys::next, Player_Struct::no_echo, run_dir(), run_label, Player_Struct::run_on, runkey, runkeysym, and use_config.
void parse_key_release | ( | KeyCode | kc, |
KeySym | ks | ||
) |
Definition at line 537 of file xutil.c.
References clear_fire(), clear_run(), CONFIG_ECHO, cpl, draw_info(), draw_message_window(), fire_label, Player_Struct::fire_on, firekey, firekeysym, NDI_BLACK, run_label, Player_Struct::run_on, runkey, runkeysym, stop_fire(), stop_run(), and use_config.
void parse_keybind_line | ( | char * | buf, |
int | line, | ||
int | standard | ||
) |
Definition at line 280 of file xutil.c.
References bind_buf, commandkey, commandkeysym, completekey, completekeysym, display, firekey, firekeysym, Keys::flags, insert_key(), KEYF_EDIT, KEYF_FIRE, KEYF_NORMAL, KEYF_RUN, KEYF_STANDARD, Keys::keysym, LOG(), LOG_WARNING, nextkey, nextkeysym, prevkey, prevkeysym, runkey, runkeysym, and updatekeycodes.
uint8* png_to_data | ( | uint8 * | data, |
int | len, | ||
uint32 * | width, | ||
uint32 * | height | ||
) |
*data | |
len | |
*width | |
*height |
Definition at line 63 of file png.c.
References data_cp, data_len, data_start, height, LOG(), LOG_CRITICAL, and user_read_data().
int png_to_xpixmap | ( | Display * | display, |
Drawable | draw, | ||
unsigned char * | data, | ||
int | len, | ||
Pixmap * | pix, | ||
Pixmap * | mask, | ||
Colormap * | cmap, | ||
unsigned long * | width, | ||
unsigned long * | height | ||
) |
Definition at line 573 of file png.c.
References bmask, bshift, data_cp, data_len, data_start, gmask, gshift, height, need_color_alloc, PNGX_DATA, pngx_find_color(), PNGX_OUTOFMEM, rev_bshift, rev_gshift, rev_rshift, rmask, rshift, user_read_data(), width, and ximage.
long pngx_find_color | ( | Display * | display, |
Colormap * | cmap, | ||
int | red, | ||
int | green, | ||
int | blue | ||
) |
Definition at line 416 of file png.c.
References Pngx_Color_Values::blue, BRIGHTNESS_FACTOR, COLOR_FACTOR, color_values, colormap_size, colors_alloced, Pngx_Color_Values::green, Pngx_Color_Values::pixel_value, private_cmap, and Pngx_Color_Values::red.
Referenced by png_to_xpixmap(), and rgba_to_xpixmap().
void redisplay_stats | ( | void | ) |
uint8* rescale_rgba_data | ( | uint8 * | data, |
int * | width, | ||
int * | height, | ||
int | scale | ||
) |
Takes png data and scales it accordingly.
This function is based on pnmscale, but has been modified to support alpha channel - instead of blending the alpha channel, it takes the most opaque value - blending it is not likely to give sane results IMO - for any image that has transparent information, if we blended the alpha, the result would be the edges of that region being partially transparent. This function has also been re-written to use more static data - in the case of the client, it will be called thousands of times, so it doesn't make sense to free the data and then re-allocate it.
For pixels that are fully transparent, the end result after scaling is they will be tranparent black. This is a needed effect for blending to work properly.
This function returns a new pointer to the scaled image data. This is malloc'd data, so should be freed at some point to prevent leaks. This function does not modify the data passed to it - the caller is responsible for freeing it if it is no longer needed.
function arguments:
*data | PNG data - this is any 4 byte per pixel data, in RGBA format. |
*width | Source width modified to contain the new image size. |
*height | Source height modified to contain the new image size. |
scale | Percentage size that new image should be. 100 is a same size image - values larger than 100 will result in zoom, values less than 100 will result in a shrinkage. |
Definition at line 244 of file png.c.
References BPP, LOG(), LOG_CRITICAL, MAX_IMAGE_HEIGHT, MAX_IMAGE_WIDTH, RATIO, and width.
void reset_image_data | ( | void | ) |
Connecting to different servers, try to clear out any old images.
Try to free the data to prevent memory leaks. This could be more clever, ie, if we're caching images and go to a new server and get a name, we should try to re-arrange our cache or the like.
Definition at line 387 of file image.c.
References Player_Struct::below, CONFIG_CACHE, cpl, display, itemlist::env, free_pixmap(), mask, MAXPIXMAPNUM, pixmap, pixmaps, reset_image_cache_data(), and want_config.
void reset_map | ( | void | ) |
void resize_map_window | ( | int | x, |
int | y | ||
) |
Resize_map_window is a NOOP for the time being - not sure if it will in fact need to do something, since there are scrollbars for the map window now.
Note - this is note a window resize request, but rather process the size (in spaces) of the map - is received from server.
Definition at line 5324 of file gx11.c.
References bigmap, CFG_DM_SDL, CONFIG_DISPLAYMODE, CONFIG_MAPHEIGHT, CONFIG_MAPWIDTH, CONFIG_SPLITWIN, display, draw_map(), drawingarea, FALSE, game_bar_vpane, gameframe, gtkwin_root, height, image_size, init_SDL(), map_drawing_area, map_image_size, message_frame, old_mapx, old_mapy, stat_frame, stat_game_vpane, TRUE, use_config, want_config, width, win_game, and win_root.
int rgba_to_xpixmap | ( | Display * | display, |
Drawable | draw, | ||
uint8 * | pixels, | ||
Pixmap * | pix, | ||
Pixmap * | mask, | ||
Colormap * | cmap, | ||
unsigned long | width, | ||
unsigned long | height | ||
) |
Definition at line 811 of file png.c.
References bmask, bshift, gmask, gshift, height, need_color_alloc, pngx_find_color(), rev_bshift, rev_gshift, rev_rshift, rmask, rshift, width, and ximage.
Referenced by create_and_rescale_image_from_data().
void save_defaults | ( | void | ) |
This function saves user settings chosen using the configuration popup dialog.
Definition at line 848 of file config.c.
References CONFIG_CACHE, CONFIG_CWINDOW, CONFIG_FOODBEEP, config_names, CONFIG_NUMS, CONFIG_PORT, CONFIG_SOUND, CONFIG_SPLITWIN, draw_info(), face_info, font_name, LOG(), LOG_ERROR, make_path_to_file(), MAX_BUF, InfoData::maxlines, NDI_BLUE, noautorepeat, InfoData::scroll_info_window, server, itemlist::show_icon, sound_server, use_config, want_config, Face_Information_struct::want_faceset, and window_xml_file.
void save_winpos | ( | void | ) |
Handles saving of the window positions when the Client | Save Window Position menu item is executed.
All hpaned and vpaned widget settings have the information required, and the code automatically works for Glade XML layouts that follow the glade-2's default widget naming convention.
Definition at line 4804 of file gx11.c.
References CONFIG_SPLITINFO, CONFIG_SPLITWIN, draw_info(), game_bar_vpane, get_window_coord(), gtkwin_info, gtkwin_inv, gtkwin_look, gtkwin_message, gtkwin_root, gtkwin_stats, info_vpane, inv_hpane, inv_look_vpane, MAX_BUF, NDI_BLUE, NDI_RED, stat_game_vpane, stat_info_hpane, use_config, want_config, itemlist::win, win_game, InfoData::win_info, win_message, win_stats, window_root, and window_xml_file.
void set_autorepeat | ( | const char * | s | ) |
A stub function that does nothing.
These are callbacks used by the common code, but they are not implemented in GTK, either because it makes no sense (set_scroll for example), or because it may not be technically possible to do so if we limit ourselves to proper GTK2 code (Eg, don't mess with the internals of X or platform specific issues)
s |
Definition at line 4448 of file gx11.c.
References draw_info(), FALSE, NDI_BLACK, noautorepeat, and TRUE.
void set_scroll | ( | const char * | s | ) |
A stub function that does nothing.
These are callbacks used by the common code, but they are not implemented in GTK, either because it makes no sense (set_scroll for example), or because it may not be technically possible to do so if we limit ourselves to proper GTK2 code (Eg, don't mess with the internals of X or platform specific issues)
s |
Definition at line 4443 of file gx11.c.
References draw_all_info(), draw_info(), InfoData::infoline, InfoData::maxdisp, NDI_BLACK, InfoData::numlines, and InfoData::scroll_info_window.
void set_show_icon | ( | const char * | s | ) |
s |
Definition at line 1303 of file inventory.c.
References itemlist::height, itemlist_set_show_icon(), resize_list_info(), itemlist::show_icon, and itemlist::width.
void set_show_weight | ( | const char * | s | ) |
s |
Definition at line 1258 of file inventory.c.
References draw_list(), inv_viewers, inventory_viewer_set_show_weight(), set_show_weight_inv_one(), itemlist::show_weight, and update_list_labels().
void set_weight_limit | ( | uint32 | wlim | ) |
No reason to divide by 1000 everytime we do the display, so do it once and store it here.
wlim |
Definition at line 1245 of file inventory.c.
References update_list_labels(), weight_limit, and itemlist::weight_limit.
void set_window_pos | ( | void | ) |
Definition at line 4865 of file gx11.c.
References CONFIG_SPLITINFO, CONFIG_SPLITWIN, display, game_bar_vpane, gtkwin_info, gtkwin_inv, gtkwin_look, gtkwin_message, gtkwin_root, gtkwin_stats, info_vpane, inv_hpane, inv_look_vpane, LOG(), LOG_ERROR, MAX_BUF, stat_game_vpane, stat_info_hpane, use_config, want_config, itemlist::win, win_game, InfoData::win_info, win_message, and win_stats.
void signal_pipe | ( | int | i | ) |
void Sound2Cmd | ( | unsigned char * | data, |
int | len | ||
) |
Definition at line 151 of file sound.c.
References LOG(), LOG_WARNING, and name.
void SoundCmd | ( | unsigned char * | data, |
int | len | ||
) |
?
data | |
len |
Definition at line 130 of file sound.c.
References GetShort_String(), LOG(), LOG_WARNING, and play_sound().
void write_ch | ( | char | key | ) |
Definition at line 585 of file x11.c.
References Command_Mode, complete_command(), cpl, InfoData::data, delete_ch(), discolor, display, draw_info(), FONTHEIGHT, FONTWIDTH, InfoData::gc_info, InfoLine::info, InfoData::info_chars, InfoData::infoline, InfoData::infopos, Player_Struct::input_state, Player_Struct::input_text, InfoData::lastcolor, MAX_BUF, NDI_BLACK, Player_Struct::no_echo, Playing, and InfoData::win_info.
Referenced by do_key_press().