Feature #1413 ยป 0060-client-.c-Remove-trailing-spaces.patch
client/audio.c | ||
---|---|---|
}
|
||
#ifdef AUDIO_SDL
|
||
if (audio_select_plugin("sdl")) return;
|
||
#endif
|
||
if (audio_select_plugin("sdl")) {
|
||
return;
|
||
}
|
||
#endif /* AUDIO_SDL */
|
||
log_normal(_("No real audio subsystem managed to initialize!"));
|
||
log_normal(_("Perhaps there is some misconfiguration or bad permissions."));
|
||
log_normal(_("Proceeding with sound support disabled."));
|
client/client_main.c | ||
---|---|---|
#include "climisc.h"
|
||
#include "clinet.h"
|
||
#include "connectdlg_common.h" /* client_kill_server() */
|
||
#include "control.h"
|
||
#include "control.h"
|
||
#include "editor.h"
|
||
#include "global_worklist.h"
|
||
#include "gui_properties.h"
|
||
... | ... | |
sz_strlcpy(music_set_name, gui_options.default_music_set_name);
|
||
}
|
||
if (sound_plugin_name[0] == '\0') {
|
||
sz_strlcpy(sound_plugin_name, gui_options.default_sound_plugin_name);
|
||
sz_strlcpy(sound_plugin_name, gui_options.default_sound_plugin_name);
|
||
}
|
||
if (server_host[0] == '\0') {
|
||
sz_strlcpy(server_host, gui_options.default_server_host);
|
||
... | ... | |
sz_strlcpy(gui_options.default_server_host, server_host);
|
||
}
|
||
if (user_name[0] == '\0') {
|
||
sz_strlcpy(user_name, gui_options.default_user_name);
|
||
sz_strlcpy(user_name, gui_options.default_user_name);
|
||
}
|
||
if (metaserver[0] == '\0') {
|
||
if (0 == strcmp(gui_options.default_metaserver, DEFAULT_METASERVER_OPTION)) {
|
client/climisc.c | ||
---|---|---|
GNU General Public License for more details.
|
||
***********************************************************************/
|
||
/***********************************************************************
|
||
/***********************************************************************
|
||
This module contains various general - mostly highlevel - functions
|
||
used throughout the client.
|
||
***********************************************************************/
|
||
... | ... | |
This is only guesswork based on unit properties. One should not
|
||
take UNIT_BG_FLYING seriously meaning that unit can fly - custom
|
||
ruleset might have units with similar properties but explains these
|
||
properties by some other means than by flying.
|
||
properties by some other means than by flying.
|
||
**************************************************************************/
|
||
enum unit_bg_color_type unit_color_type(const struct unit_type *punittype)
|
||
{
|
client/control.c | ||
---|---|---|
This function may be called from packhand.c, via unit_focus_update(),
|
||
as a result of packets indicating change in activity for a unit. Also
|
||
called when user press the "Wait" command.
|
||
|
||
FIXME: Add feature to focus only units of a certain category.
|
||
@param accept_current The current focus can be kept if no other candidates
|
||
... | ... | |
clear_hover_state();
|
||
unit_list_iterate(get_units_in_focus(), punit) {
|
||
/*
|
||
/*
|
||
* Is the unit which just lost focus a non-AI unit? If yes this
|
||
* enables the auto end turn.
|
||
*/
|
||
... | ... | |
unit_focus_set(candidate);
|
||
/*
|
||
/*
|
||
* Handle auto-turn-done mode: If a unit was in focus (did move),
|
||
* but now none are (no more to move) and there was at least one
|
||
* non-AI unit this turn which was focused, then fake a Turn Done
|
||
... | ... | |
if ((punit->activity == ACTIVITY_IDLE
|
||
|| punit->activity == ACTIVITY_GOTO
|
||
|| unit_has_orders(punit))
|
||
&& punit->moves_left > 0
|
||
&& punit->moves_left > 0
|
||
&& !punit->done_moving
|
||
&& punit->ssa_controller == SSA_NONE) {
|
||
return;
|
||
... | ... | |
Update unit icons (and arrow) in the information display, for specified
|
||
punit as the active unit and other units on the same square. In practice
|
||
punit is almost always (or maybe strictly always?) the focus unit.
|
||
|
||
Static vars store some info on current (ie previous) state, to avoid
|
||
unnecessary redraws; initialise to "flag" values to always redraw first
|
||
time. In principle we _might_ need more info (eg ai.control, connecting),
|
||
... | ... | |
}
|
||
}
|
||
unit_list_iterate_end;
|
||
|
||
if (i > num_units_below) {
|
||
set_unit_icons_more_arrow(TRUE);
|
||
} else {
|
||
... | ... | |
**************************************************************************/
|
||
bool can_unit_do_connect(struct unit *punit,
|
||
enum unit_activity activity,
|
||
struct extra_type *tgt)
|
||
struct extra_type *tgt)
|
||
{
|
||
struct tile *ptile = unit_tile(punit);
|
||
struct road_type *proad = NULL;
|
||
... | ... | |
/**********************************************************************//**
|
||
Toggle display of city outlines on the map
|
||
**************************************************************************/
|
||
void request_toggle_city_outlines(void)
|
||
void request_toggle_city_outlines(void)
|
||
{
|
||
if (!can_client_change_view()) {
|
||
return;
|
||
... | ... | |
if (!can_client_change_view()) {
|
||
return;
|
||
}
|
||
|
||
gui_options.draw_city_output = !gui_options.draw_city_output;
|
||
update_map_canvas_visible();
|
||
}
|
||
... | ... | |
/**********************************************************************//**
|
||
Toggle display of grid lines on the map
|
||
**************************************************************************/
|
||
void request_toggle_map_grid(void)
|
||
void request_toggle_map_grid(void)
|
||
{
|
||
if (!can_client_change_view()) {
|
||
return;
|
||
... | ... | |
/**********************************************************************//**
|
||
Toggle display of national borders on the map
|
||
**************************************************************************/
|
||
void request_toggle_map_borders(void)
|
||
void request_toggle_map_borders(void)
|
||
{
|
||
if (!can_client_change_view()) {
|
||
return;
|
||
... | ... | |
/**********************************************************************//**
|
||
Toggle display of native tiles on the map
|
||
**************************************************************************/
|
||
void request_toggle_map_native(void)
|
||
void request_toggle_map_native(void)
|
||
{
|
||
if (!can_client_change_view()) {
|
||
return;
|
||
... | ... | |
gui_options.draw_city_names ^= 1;
|
||
update_map_canvas_visible();
|
||
}
|
||
|
||
/**********************************************************************//**
|
||
Toggle display of city growth (turns-to-grow)
|
||
**************************************************************************/
|
client/editor.c | ||
---|---|---|
} else if (tile_owner(ptile) != NULL) {
|
||
apno = player_number(tile_owner(ptile));
|
||
}
|
||
|
||
if (player_by_number(apno) != NULL) {
|
||
editor_tool_set_applied_player(editor_get_tool(), apno);
|
||
editgui_refresh();
|
||
... | ... | |
popup_properties(ptile);
|
||
break;
|
||
}
|
||
|
||
if (modifiers == EKM_SHIFT) {
|
||
editor->selection_mode = SELECTION_MODE_ADD;
|
||
} else if (modifiers == EKM_ALT) {
|
||
... | ... | |
if (editor == NULL) {
|
||
return;
|
||
}
|
||
|
||
editor->current_tile = ptile;
|
||
}
|
||
... | ... | |
if (editor == NULL) {
|
||
return NULL;
|
||
}
|
||
|
||
return editor->current_tile;
|
||
}
|
||
client/global_worklist.c | ||
---|---|---|
fc_vsnprintf(path_str, sizeof(path_str), path, ap);
|
||
va_end(ap);
|
||
secfile_insert_str(file, pgwl->name, "%s.wl_name", path_str);
|
||
secfile_insert_str(file, pgwl->name, "%s.wl_name", path_str);
|
||
switch (pgwl->status) {
|
||
case STATUS_UNBUILT:
|
client/helpdata.c | ||
---|---|---|
static struct help_item *new_help_item(int type)
|
||
{
|
||
struct help_item *pitem;
|
||
|
||
pitem = fc_malloc(sizeof(struct help_item));
|
||
pitem->topic = NULL;
|
||
pitem->text = NULL;
|
||
... | ... | |
continue;
|
||
}
|
||
}
|
||
|
||
/* It wasn't a "generate" node: */
|
||
|
||
pitem = new_help_item(HELP_TEXT);
|
||
pitem->topic = fc_strdup(Q_(secfile_lookup_str(sf, "%s.name",
|
||
sec_name)));
|
||
... | ... | |
const struct help_item *get_help_item(int pos)
|
||
{
|
||
int size;
|
||
|
||
check_help_nodes_init();
|
||
size = help_list_size(help_nodes);
|
||
if (pos < 0 || pos > size) {
|
||
... | ... | |
idx++;
|
||
}
|
||
help_list_iterate_end;
|
||
|
||
if (!pitem) {
|
||
idx = -1;
|
||
vitem.topic = vtopic;
|
||
... | ... | |
const struct help_item *help_iter_next(void)
|
||
{
|
||
const struct help_item *pitem;
|
||
|
||
check_help_nodes_init();
|
||
pitem = help_list_link_data(help_nodes_iterator);
|
||
if (pitem) {
|
||
... | ... | |
}
|
||
if (utype_has_flag(utype, UTYF_IGTER)) {
|
||
cat_snprintf(buf, bufsz,
|
||
/* TRANS: "MP" = movement points. %s may have a
|
||
/* TRANS: "MP" = movement points. %s may have a
|
||
* fractional part. */
|
||
_("%s Ignores terrain effects (moving costs at most %s MP "
|
||
"per tile).\n"), BULLET,
|
||
... | ... | |
{
|
||
int j;
|
||
|
||
for (j = 0; j < MAX_NUM_TECH_LIST; j++) {
|
||
if (game.rgame.global_init_techs[j] == A_LAST) {
|
||
break;
|
||
... | ... | |
struct output_type *potype =
|
||
output_type != O_LAST ? get_output_type(output_type) : NULL;
|
||
world_value =
|
||
world_value =
|
||
get_target_bonus_effects(NULL,
|
||
&(const struct req_context) {
|
||
.unittype = unittype,
|
||
... | ... | |
astr_init(&utype_names[i]);
|
||
if (count[i] > 1) {
|
||
/* TRANS: a unit type followed by a count. For instance,
|
||
* "Fighter (2)" means two Fighters. Count is never 1.
|
||
* "Fighter (2)" means two Fighters. Count is never 1.
|
||
* Used in a list. */
|
||
astr_set(&utype_names[i], _("%s (%d)"),
|
||
utype_name_translation(utypes[i]), count[i]);
|
client/packhand.c | ||
---|---|---|
/* Update caravan dialog */
|
||
if ((production_changed || shield_stock_changed)
|
||
&& action_selection_target_city() == pcity->id) {
|
||
&& action_selection_target_city() == pcity->id) {
|
||
dsend_packet_unit_get_actions(&client.conn,
|
||
action_selection_actor_unit(),
|
||
action_selection_target_unit(),
|
||
... | ... | |
}
|
||
players_iterate(pp) {
|
||
unit_list_iterate(pp->units, punit) {
|
||
unit_list_iterate(pp->units, punit) {
|
||
if (punit->homecity == pcity->id) {
|
||
unit_list_prepend(pcity->units_supported, punit);
|
||
}
|
||
... | ... | |
}
|
||
city_name_set(pcity, packet->name);
|
||
|
||
memset(pcity->feel, 0, sizeof(pcity->feel));
|
||
memset(pcity->specialists, 0, sizeof(pcity->specialists));
|
||
}
|
||
... | ... | |
repaint_unit = TRUE;
|
||
/* Wakeup Focus */
|
||
if (gui_options.wakeup_focus
|
||
if (gui_options.wakeup_focus
|
||
&& plr != nullptr
|
||
&& is_human(plr)
|
||
&& owner == plr
|
||
... | ... | |
if (update_aifill_button || update_ai_skill_level) {
|
||
update_start_page();
|
||
}
|
||
|
||
if (can_client_change_view()) {
|
||
update_info_label();
|
||
}
|
||
... | ... | |
pinfo->observer, (int) pinfo->access_level);
|
||
log_debug("conn_info \"%s\" \"%s\" \"%s\"",
|
||
pinfo->username, pinfo->addr, pinfo->capability);
|
||
|
||
if (!pinfo->used) {
|
||
/* Forget the connection */
|
||
if (!pconn) {
|
||
... | ... | |
}
|
||
if (known_changed || tile_changed) {
|
||
/*
|
||
/*
|
||
* A tile can only change if it was known before and is still
|
||
* known. In the other cases the tile is new or removed.
|
||
*/
|
||
... | ... | |
}
|
||
/* set later by PACKET_NATION_AVAILABILITY */
|
||
pnation->client.is_pickable = FALSE;
|
||
pnation->client.is_pickable = FALSE;
|
||
pnation->is_playable = packet->is_playable;
|
||
pnation->barb_type = packet->barbarian_type;
|
||
client/plrdlg_common.c | ||
---|---|---|
} else {
|
||
love2 = player2->ai_common.love[player_index(client.conn.playing)];
|
||
}
|
||
|
||
return love1 - love2;
|
||
}
|
||
client/repodlgs_common.c | ||
---|---|---|
}
|
||
/************************************************************************//**
|
||
Returns an array of units with gold_upkeep. Number of units in
|
||
Returns an array of units with gold_upkeep. Number of units in
|
||
the array is added to num_entries_used.
|
||
****************************************************************************/
|
||
void get_economy_report_units_data(struct unit_entry *entries,
|
client/servers.c | ||
---|---|---|
for (j = 0; j < pserver->nplayers ; j++) {
|
||
const char *name, *nation, *type, *plrhost;
|
||
name = secfile_lookup_str_default(file, "",
|
||
name = secfile_lookup_str_default(file, "",
|
||
"server%d.player%d.name", i, j);
|
||
pserver->players[j].name = fc_strdup(name);
|
||
... | ... | |
"server%d.player%d.type", i, j);
|
||
pserver->players[j].type = fc_strdup(type);
|
||
plrhost = secfile_lookup_str_default(file, "",
|
||
plrhost = secfile_lookup_str_default(file, "",
|
||
"server%d.player%d.host", i, j);
|
||
pserver->players[j].host = fc_strdup(plrhost);
|
||
... | ... | |
#ifndef FREECIV_HAVE_WINSOCK
|
||
/* Set the Time-to-Live field for the packet */
|
||
ttl = SERVER_LAN_TTL;
|
||
if (setsockopt(send_sock, IPPROTO_IP, IP_MULTICAST_TTL, (const char*)&ttl,
|
||
if (setsockopt(send_sock, IPPROTO_IP, IP_MULTICAST_TTL, (const char*)&ttl,
|
||
sizeof(ttl))) {
|
||
char errstr[2048];
|
||
... | ... | |
}
|
||
#endif /* FREECIV_HAVE_WINSOCK */
|
||
if (setsockopt(send_sock, SOL_SOCKET, SO_BROADCAST, (const char*)&opt,
|
||
if (setsockopt(send_sock, SOL_SOCKET, SO_BROADCAST, (const char*)&opt,
|
||
sizeof(opt))) {
|
||
char errstr[2048];
|
||
... | ... | |
dio_output_init(&dout, buffer, sizeof(buffer));
|
||
dio_put_uint8_raw(&dout, SERVER_LAN_VERSION);
|
||
size = dio_output_used(&dout);
|
||
|
||
if (sendto(send_sock, buffer, size, 0, &addr.saddr,
|
||
sockaddr_size(&addr)) < 0) {
|
client/themes_common.c | ||
---|---|---|
- Theme implementation is gui specific and most themes can not be shared
|
||
between different guis.
|
||
Theme is recognized by its name.
|
||
|
||
Theme is stored in a directory called like the theme. The directory contains
|
||
some data files. Each gui defines its own format in the
|
||
get_usable_themes_in_directory() function.
|
||
... | ... | |
/* A directory containing a list of usable themes */
|
||
struct theme_directory {
|
||
/* Path on the filesystem */
|
||
char *path;
|
||
char *path;
|
||
/* Array of theme names */
|
||
char **themes;
|
||
/* Themes array length */
|