Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

* And there was one whitespace fix to rule them all! (s/ *$//)

  • Loading branch information...
commit 8336ee79d7e6f145a519c86acffc6e8d4a27b304 1 parent 42aa97e
@bobbens bobbens authored
Showing with 853 additions and 853 deletions.
  1. +31 −31 src/ai.c
  2. +1 −1  src/ai.h
  3. +8 −8 src/array.h
  4. +4 −4 src/base64.c
  5. +6 −6 src/board.c
  6. +8 −8 src/collision.c
  7. +5 −5 src/comm.c
  8. +1 −1  src/cond.c
  9. +1 −1  src/conf.c
  10. +1 −1  src/conf.h
  11. +2 −2 src/console.c
  12. +2 −2 src/dev_ship.c
  13. +2 −2 src/dev_sysedit.c
  14. +3 −3 src/dev_uniedit.c
  15. +6 −6 src/dialogue.c
  16. +1 −1  src/economy.c
  17. +1 −1  src/economy.h
  18. +1 −1  src/equipment.c
  19. +2 −2 src/event.c
  20. +5 −5 src/faction.c
  21. +7 −7 src/fleet.c
  22. +1 −1  src/fleet.h
  23. +27 −27 src/gui.c
  24. +1 −1  src/gui.h
  25. +3 −3 src/hook.c
  26. +1 −1  src/hook.h
  27. +7 −7 src/info.c
  28. +14 −14 src/input.c
  29. +1 −1  src/intro.c
  30. +1 −1  src/land.c
  31. +2 −2 src/land_shipyard.c
  32. +16 −16 src/map.c
  33. +4 −4 src/menu.c
  34. +4 −4 src/mission.c
  35. +2 −2 src/music.c
  36. +2 −2 src/music_openal.c
  37. +4 −4 src/naev.c
  38. +9 −9 src/nebula.c
  39. +2 −2 src/news.c
  40. +3 −3 src/nfile.c
  41. +1 −1  src/nlua.c
  42. +1 −1  src/nlua_cli.c
  43. +1 −1  src/nlua_evt.c
  44. +3 −3 src/nlua_faction.c
  45. +1 −1  src/nlua_faction.h
  46. +2 −2 src/nlua_hook.c
  47. +7 −7 src/nlua_misn.c
  48. +1 −1  src/nlua_music.c
  49. +2 −2 src/nlua_naev.c
  50. +7 −7 src/nlua_pilot.c
  51. +1 −1  src/nlua_pilot.h
  52. +4 −4 src/nlua_planet.c
  53. +1 −1  src/nlua_planet.h
  54. +1 −1  src/nlua_player.c
  55. +4 −4 src/nlua_rnd.c
  56. +2 −2 src/nlua_ship.c
  57. +1 −1  src/nlua_ship.h
  58. +1 −1  src/nlua_space.h
  59. +4 −4 src/nlua_system.c
  60. +1 −1  src/nlua_system.h
  61. +2 −2 src/nlua_time.c
  62. +9 −9 src/nlua_tk.c
  63. +6 −6 src/nlua_var.c
  64. +372 −372 src/nondata.c
  65. +1 −1  src/npc.c
  66. +1 −1  src/npng.c
  67. +1 −1  src/nxml.h
  68. +1 −1  src/opengl.c
  69. +1 −1  src/opengl.h
  70. +1 −1  src/opengl_ext.h
  71. +1 −1  src/opengl_matrix.h
  72. +13 −13 src/opengl_render.c
  73. +1 −1  src/opengl_render.h
  74. +20 −20 src/opengl_tex.c
  75. +1 −1  src/opengl_tex.h
  76. +4 −4 src/opengl_vbo.c
  77. +1 −1  src/opengl_vbo.h
  78. +1 −1  src/options.c
  79. +7 −7 src/outfit.c
  80. +2 −2 src/outfit.h
  81. +4 −4 src/pack.c
  82. +5 −5 src/perlin.c
  83. +3 −3 src/physics.c
  84. +1 −1  src/physics.h
  85. +24 −24 src/pilot.c
  86. +1 −1  src/plasmaf.c
  87. +23 −23 src/player.c
  88. +3 −3 src/player.h
  89. +1 −1  src/rng.c
  90. +1 −1  src/save.c
  91. +1 −1  src/ship.c
  92. +2 −2 src/sound.c
  93. +7 −7 src/sound_openal.c
  94. +2 −2 src/sound_sdlmix.c
  95. +4 −4 src/space.c
  96. +5 −5 src/space.h
  97. +6 −6 src/spfx.c
  98. +9 −9 src/tech.c
  99. +4 −4 src/tk/widget/button.c
  100. +3 −3 src/tk/widget/checkbox.c
  101. +2 −2 src/tk/widget/cust.c
  102. +2 −2 src/tk/widget/fader.h
  103. +12 −12 src/tk/widget/image.c
  104. +1 −1  src/tk/widget/imagearray.c
  105. +1 −1  src/tk/widget/imagearray.h
  106. +5 −5 src/tk/widget/input.c
  107. +2 −2 src/tk/widget/list.c
  108. +1 −1  src/tk/widget/list.h
  109. +3 −3 src/tk/widget/tabwin.c
  110. +5 −5 src/tk/widget/text.c
  111. +11 −11 src/toolkit.c
  112. +5 −5 src/unidiff.c
View
62 src/ai.c
@@ -27,7 +27,7 @@
*
* Specification
*
- * - AI will follow basic tasks defined from Lua AI script.
+ * - AI will follow basic tasks defined from Lua AI script.
* - if Task is NULL, AI will run "control" task
* - Task is continued every frame
* - Tasks can have subtasks which will be closed when parent task is dead.
@@ -37,7 +37,7 @@
* - "control" task sets another task
* - "control" task is also run at a set rate (depending on Lua global "control_rate")
* to choose optimal behaviour (task)
- *
+ *
* Memory
*
* The AI currently has per-pilot memory which is accessible as "mem". This
@@ -895,7 +895,7 @@ static void ai_create( Pilot* pilot, char *param )
L = equip_L;
lua_getglobal(L, "equip");
lp.pilot = cur_pilot->id;
- lua_pushpilot(L,lp);
+ lua_pushpilot(L,lp);
lf.f = cur_pilot->faction;
lua_pushfaction(L,lf);
if (lua_pcall(L, 2, 0, 0)) { /* Error has occurred. */
@@ -939,7 +939,7 @@ static void ai_create( Pilot* pilot, char *param )
Task *ai_newtask( Pilot *p, const char *func, int subtask, int pos )
{
Task *t, *pointer;
-
+
/* Create the new task. */
t = malloc( sizeof(Task) );
t->next = NULL;
@@ -1328,9 +1328,9 @@ static int aiL_parmour( lua_State *L )
return 1;
}
-/*
+/*
* gets the pilot's shield in percent
- */
+ */
static int aiL_pshield( lua_State *L )
{
double d;
@@ -1348,7 +1348,7 @@ static int aiL_pshield( lua_State *L )
lua_pushnumber(L, d);
return 1;
-}
+}
/*
* gets the distance from the pointer
@@ -1368,18 +1368,18 @@ static int aiL_getdistance( lua_State *L )
else if (lua_islightuserdata(L,1))
v = lua_touserdata(L,1);
-
+
/* pilot id as parameter */
else if (lua_isnumber(L,1)) {
n = (unsigned int) lua_tonumber(L,1);
pilot = pilot_get( (unsigned int) lua_tonumber(L,1) );
- if (pilot==NULL) {
+ if (pilot==NULL) {
NLUA_ERROR(L, "Pilot ID does not belong to a pilot.");
return 0;
}
v = &pilot->solid->pos;
}
-
+
/* wrong parameter */
else
NLUA_INVALID_PARAMETER();
@@ -1397,7 +1397,7 @@ static int aiL_getpos( lua_State *L )
if (lua_isnumber(L,1)) {
p = pilot_get((unsigned int)lua_tonumber(L,1)); /* Pilot ID */
- if (p==NULL) {
+ if (p==NULL) {
NLUA_ERROR(L, "Pilot ID does not belong to a pilot.");
return 0;
}
@@ -1431,7 +1431,7 @@ static int aiL_minbrakedist( lua_State *L )
/* Get target. */
id = luaL_checklong(L,1);
p = pilot_get(id);
- if (p==NULL) {
+ if (p==NULL) {
NLUA_ERROR(L, "Pilot ID does not belong to a pilot.");
return 0;
}
@@ -1439,7 +1439,7 @@ static int aiL_minbrakedist( lua_State *L )
/* Set up the vectors. */
vect_cset( &vv, p->solid->vel.x - cur_pilot->solid->vel.x,
p->solid->vel.y - cur_pilot->solid->vel.y );
-
+
/* Run the same calculations. */
time = VMOD(vv) /
(cur_pilot->thrust / cur_pilot->solid->mass);
@@ -1493,7 +1493,7 @@ static int aiL_shipclass( lua_State *L )
if (lua_gettop(L) > 0) {
l = luaL_checklong(L,1);
p = pilot_get(l);
- if (p==NULL) {
+ if (p==NULL) {
NLUA_ERROR(L, "Pilot ID does not belong to a pilot.");
return 0;
}
@@ -1517,7 +1517,7 @@ static int aiL_shipmass( lua_State *L )
if (lua_gettop(L) > 0) {
l = luaL_checklong(L,1);
p = pilot_get(l);
- if (p==NULL) {
+ if (p==NULL) {
NLUA_ERROR(L, "Pilot ID does not belong to a pilot.");
return 0;
}
@@ -1556,7 +1556,7 @@ static int aiL_getstanding( lua_State *L )
/* Get parameters. */
id = luaL_checklong(L,1);
p = pilot_get(id);
- if (p==NULL) {
+ if (p==NULL) {
NLUA_ERROR(L, "Pilot ID does not belong to a pilot.");
return 0;
}
@@ -1631,7 +1631,7 @@ static int aiL_isenemy( lua_State *L )
/* Get the pilot. */
id = luaL_checklong(L,1);
p = pilot_get(id);
- if (p==NULL) {
+ if (p==NULL) {
NLUA_ERROR(L, "Pilot ID does not belong to a pilot.");
return 0;
}
@@ -1659,7 +1659,7 @@ static int aiL_isally( lua_State *L )
/* Get the pilot. */
id = luaL_checklong(L,1);
p = pilot_get(id);
- if (p==NULL) {
+ if (p==NULL) {
NLUA_ERROR(L, "Pilot ID does not belong to a pilot.");
return 0;
}
@@ -1687,7 +1687,7 @@ static int aiL_incombat( lua_State *L )
if (lua_gettop(L) > 0) {
id = luaL_checklong(L,1);
p = pilot_get(id);
- if (p==NULL) {
+ if (p==NULL) {
NLUA_ERROR(L, "Pilot ID does not belong to a pilot.");
return 0;
}
@@ -1714,7 +1714,7 @@ static int aiL_isdisabled( lua_State *L )
id = luaL_checklong(L, 1);
p = pilot_get(id);
- if (p==NULL) {
+ if (p==NULL) {
NLUA_ERROR(L, "Pilot ID does not belong to a pilot.");
return 0;
}
@@ -1773,7 +1773,7 @@ static int aiL_turn( lua_State *L )
* @usage ai.face( a_pilot ) -- Face a pilot
* @usage ai.face( a_pilot, true ) -- Face away from a pilot
* @usage ai.face( a_pilot, nil, true ) -- Compensate velocity facing a pilot
- *
+ *
* @param target Target to face.
* @param invert Invert away from target.
* @param compensate Compensate for velocity?
@@ -1797,7 +1797,7 @@ static int aiL_face( lua_State *L )
else {
id = (unsigned int)d;
p = pilot_get(id);
- if (p==NULL) {
+ if (p==NULL) {
NLUA_ERROR(L, "Pilot ID does not belong to a pilot.");
return 0;
}
@@ -1848,7 +1848,7 @@ static int aiL_face( lua_State *L )
dx += -k_vel * vx;
dy += -k_vel * vy;
}
-
+
/* Compensate error and rotate. */
diff = angle_diff( cur_pilot->solid->dir, atan2( dy, dx ) );
@@ -1870,7 +1870,7 @@ static int aiL_brake( lua_State *L )
d = cur_pilot->solid->dir+M_PI;
if (d >= 2*M_PI) d = fmod(d, 2*M_PI);
-
+
diff = angle_diff(d,VANGLE(cur_pilot->solid->vel));
pilot_turn = 10*diff;
@@ -1966,7 +1966,7 @@ static int aiL_getlandplanet( lua_State *L )
continue;
else if (!only_friend && areEnemies(cur_pilot->faction,cur_system->planets[i]->faction))
continue;
-
+
/* Add it. */
ind[ nplanets++ ] = i;
}
@@ -2001,7 +2001,7 @@ static int aiL_land( lua_State *L )
{
int ret;
Planet *planet;
-
+
ret = 0;
if (cur_pilot->nav_planet < 0) {
@@ -2056,7 +2056,7 @@ static int aiL_takingoff( lua_State *L )
static int aiL_hyperspace( lua_State *L )
{
int dist;
-
+
dist = space_hyperspace(cur_pilot);
if (dist == 0.) {
pilot_shootStop( cur_pilot, 0 );
@@ -2175,7 +2175,7 @@ static int aiL_relvel( lua_State *L )
p->solid->pos.y - cur_pilot->solid->pos.y );
dot = vect_dot( &pv, &vv );
mod = MAX(VMOD(pv), 1.); /* Avoid /0. */
-
+
lua_pushnumber(L, dot / mod );
return 1;
}
@@ -2204,7 +2204,7 @@ static int aiL_e_attack( lua_State *L )
return 1;
}
-/*
+/*
* Tells the pilot's escorts to hold position.
*/
static int aiL_e_hold( lua_State *L )
@@ -2684,7 +2684,7 @@ static int aiL_comm( lua_State *L )
{
unsigned int p;
const char *s;
-
+
/* Get parameters. */
p = luaL_checklong(L,1);
s = luaL_checkstring(L,2);
@@ -2739,7 +2739,7 @@ static int aiL_credits( lua_State *L )
}
cur_pilot->credits = luaL_checklong(L,1);
-
+
return 0;
}
View
2  src/ai.h
@@ -44,7 +44,7 @@ typedef struct Task_ {
char *name; /**< Task name. */
struct Task_* subtask; /**< Subtasks of the current task. */
-
+
TaskData dtype; /**< Data type. */
union {
unsigned int num; /**< Pilot ID, etc... */
View
16 src/array.h
@@ -2,11 +2,11 @@
* See Licensing and Copyright notice in naev.h
*/
-/**
+/**
* @file array.h
*
* @brief Provides macros to work with dynamic arrays.
- *
+ *
* @note Except were noted, macros do not have side effects from
* expations.
*
@@ -83,7 +83,7 @@ __inline__ static void *_array_end_helper(void *a, size_t e_size)
return c->_array + c->_size * e_size;
}
-/**
+/**
* @brief Creates a new dynamic array of `basic_type'
*
* @param basic_type Type of the array to create.
@@ -119,7 +119,7 @@ __inline__ static void *_array_end_helper(void *a, size_t e_size)
do array_grow(ptr_array) = element; while (0)
/**
* @brief Erases elements in interval [first, last).
- *
+ *
* @note Invalidates all iterators.
*
* @param ptr_array Array being manipulated.
@@ -137,9 +137,9 @@ __inline__ static void *_array_end_helper(void *a, size_t e_size)
*/
#define array_shrink(ptr_array) \
(_array_shrink_helper((void **)(ptr_array), sizeof((ptr_array)[0][0])))
-/**
+/**
* @brief Frees memory allocated and sets array to NULL.
- *
+ *
* @note Invalidates all iterators.
*
* @param ptr_array Array being manipulated.
@@ -147,7 +147,7 @@ __inline__ static void *_array_end_helper(void *a, size_t e_size)
#define array_free(ptr_array) \
_array_free_helper((void *)(ptr_array))
-/**
+/**
* @brief Returns number of elements in the array.
*
* @param ptr_array Array being manipulated.
@@ -182,7 +182,7 @@ __inline__ static void *_array_end_helper(void *a, size_t e_size)
* @return The first element in the array.
*/
#define array_front(ptr_array) (*array_begin(ptr_array))
-/**
+/**
* @brief Returns the last element in the array.
*
* @param ptr_array Array being manipulated.
View
8 src/base64.c
@@ -168,7 +168,7 @@ char* base64_encode( size_t *len, char *src, size_t sz )
/* setup padding */
pad = ((sz % 3) == 0) ? 0 : 3 - sz % 3;
-
+
/* time to do the bulk work */
i = 0;
for (c=0; c<sz; c+=3) {
@@ -181,7 +181,7 @@ char* base64_encode( size_t *len, char *src, size_t sz )
n = (src[c] << 16);
n += (c+1<sz) ? (src[c+1] << 8) : 0; /* may be out of range */
n += (c+2<sz) ? (src[c+2] << 0) : 0; /* may be out of range */
-
+
/* ch[0-3] are 6 bits each */
ch[0] = (n >> 18) & 63;
ch[1] = (n >> 12) & 63;
@@ -240,7 +240,7 @@ char* base64_decode( size_t *len, char *src, size_t sz )
n += (c+2<j) ? (dec_ch( dat[c+2] ) << 6) : 0;
n += (c+3<j) ? (dec_ch( dat[c+3] ) << 0) : 0;
- /* convert the 24 bits of encoded data into 3 8 bit chunks */
+ /* convert the 24 bits of encoded data into 3 8 bit chunks */
r[i++] = (n >> 16) & 255;
r[i++] = (n >> 8) & 255;
r[i++] = (n >> 0) & 255;
@@ -248,7 +248,7 @@ char* base64_decode( size_t *len, char *src, size_t sz )
/* cleanup */
free(dat);
-
+
(*len) = i - pad; /* must decount the padding */
return r;
}
View
12 src/board.c
@@ -53,11 +53,11 @@ static void board_update( unsigned int wdw );
* Creates the window on success.
*/
void player_board (void)
-{
+{
Pilot *p;
unsigned int wdw;
char c;
-
+
if (player.p->target==PLAYER_ID) {
player_message("\erYou need a target to board first!");
@@ -102,7 +102,7 @@ void player_board (void)
/* pilot will be boarded */
- pilot_setFlag(p,PILOT_BOARDED);
+ pilot_setFlag(p,PILOT_BOARDED);
player_message("\epBoarding ship \e%c%s\e0.", c, p->name);
@@ -290,7 +290,7 @@ static int board_trySteal( Pilot *p )
return 1;
/* See if was successful. */
- if (RNGF() > (0.5 *
+ if (RNGF() > (0.5 *
(10. + (double)target->ship->crew)/(10. + (double)p->ship->crew)))
return 0;
@@ -367,13 +367,13 @@ static void board_update( unsigned int wdw )
else
j += snprintf( &str[j], PATH_MAX-j, "%.0f Units\n", p->fuel );
- window_modifyText( wdw, "txtData", str );
+ window_modifyText( wdw, "txtData", str );
}
/**
* @brief Has a pilot attempt to board another pilot.
- *
+ *
* @param p Pilot doing the boarding.
* @return 1 if target was boarded.
*/
View
16 src/collision.c
@@ -54,23 +54,23 @@ int CollideSprite( const glTexture* at, const int asx, const int asy, const Vect
return 0;
}
- /* a - cube coordinates */
+ /* a - cube coordinates */
ax1 = (int)VX(*ap) - (int)(at->sw)/2;
ay1 = (int)VY(*ap) - (int)(at->sh)/2;
ax2 = ax1 + (int)(at->sw) - 1;
ay2 = ay1 + (int)(at->sh) - 1;
- /* b - cube coordinates */
+ /* b - cube coordinates */
bx1 = (int)VX(*bp) - (int)(bt->sw)/2;
by1 = (int)VY(*bp) - (int)(bt->sh)/2;
bx2 = bx1 + bt->sw - 1;
by2 = by1 + bt->sh - 1;
- /* check if bounding boxes intersect */
+ /* check if bounding boxes intersect */
if((bx2 < ax1) || (ax2 < bx1)) return 0;
if((by2 < ay1) || (ay2 < by1)) return 0;
- /* define the remaining binding box */
+ /* define the remaining binding box */
inter_x0 = MAX( ax1, bx1 );
inter_x1 = MIN( ax2, bx2 );
inter_y0 = MAX( ay1, by1 );
@@ -88,7 +88,7 @@ int CollideSprite( const glTexture* at, const int asx, const int asy, const Vect
for (y=inter_y0; y<=inter_y1; y++)
for (x=inter_x0; x<=inter_x1; x++)
- /* compute offsets for surface before pass to TransparentPixel test */
+ /* compute offsets for surface before pass to TransparentPixel test */
if ((!gl_isTrans(at, abx + x, aby + y)) &&
(!gl_isTrans(bt, bbx + x, bby + y))) {
@@ -122,7 +122,7 @@ int CollideLineLine( double s1x, double s1y, double e1x, double e1y,
{
double ua_t, ub_t, u_b;
double ua, ub;
-
+
ua_t = (e2x - s2x) * (s1y - s2y) - (e2y - s2y) * (s1x - s2x);
ub_t = (e1x - s1x) * (s1y - s2y) - (e1y - s1y) * (s1x - s2x);
u_b = (e2y - s2y) * (e1x - s1x) - (e2x - s2x) * (e1y - s1y);
@@ -197,7 +197,7 @@ int CollideLineSprite( const Vector2d* ap, double ad, double al,
bl[0] = bp->x - bt->sw/2.;
bl[1] = bp->y - bt->sh/2.;
- /*
+ /*
* Start check for rectangular collisions.
*/
hits = 0;
@@ -241,7 +241,7 @@ int CollideLineSprite( const Vector2d* ap, double ad, double al,
border[1].y = ep[1];
}
- /*
+ /*
* Now we do a pixel perfect approach.
*/
real_hits = 0;
View
10 src/comm.c
@@ -106,7 +106,7 @@ int comm_openPilot( unsigned int pilot )
player_message("\e%c%s\er is jumping and can't respond.", c, comm_pilot->name);
return 0;
}
-
+
/* Must not be disabled. */
if (pilot_isFlag(comm_pilot, PILOT_DISABLED)) {
player_message("\e%c%s\er does not respond.", c, comm_pilot->name);
@@ -114,7 +114,7 @@ int comm_openPilot( unsigned int pilot )
}
/* Check to see if pilot wants to communicate. */
- msg = comm_getString( "comm_no" );
+ msg = comm_getString( "comm_no" );
if (msg != NULL) {
player_message( msg );
return 0;
@@ -302,7 +302,7 @@ static unsigned int comm_open( glTexture *gfx, int faction,
x += logo->w + 10;
y -= (logo->h - (gl_defFont.h*2 + 15)) / 2;
}
-
+
/* Name. */
window_addText( wid, x, -30 - GRAPHIC_HEIGHT - y + gl_defFont.h*2 + 10,
GRAPHIC_WIDTH - x, 20, 0, "txtName",
@@ -441,7 +441,7 @@ static void comm_bribePlanet( unsigned int wid, char *unused )
double q, r;
double standing;
Fleet *f;
-
+
/* Price. */
standing = faction_getPlayer( comm_planet->faction );
/* Get number of hostiles and mass of hostiles. */
@@ -597,7 +597,7 @@ static void comm_requestFuel( unsigned int wid, char *unused )
* @brief Gets the amount the communicating pilot wants as a bribe.
*
* Valid targets for now are:
- * - "bribe": amount pilot wants to be paid.
+ * - "bribe": amount pilot wants to be paid.
* - "refuel": amount pilot wants to be paid for refueling the player.
*
* @param[out] val Value of the number gotten.
View
2  src/cond.c
@@ -63,7 +63,7 @@ int cond_check( const char* cond )
int b;
int ret;
- /* Load the string. */
+ /* Load the string. */
lua_pushstring(cond_L, "return ");
lua_pushstring(cond_L, cond);
lua_concat(cond_L, 2);
View
2  src/conf.c
@@ -505,7 +505,7 @@ void conf_parseCLI( int argc, char** argv )
{ "devmode", no_argument, 0, 'D' },
{ "devcsv", no_argument, 0, 'C' },
#endif /* DEBUGGING */
- { "help", no_argument, 0, 'h' },
+ { "help", no_argument, 0, 'h' },
{ "version", no_argument, 0, 'v' },
{ NULL, 0, 0, 0 } };
int option_index = 1;
View
2  src/conf.h
@@ -14,7 +14,7 @@
* @note Input is not handled here.
*/
typedef struct PlayerConf_s {
-
+
/* ndata. */
char *ndata; /**< Ndata path to use. */
View
4 src/console.c
@@ -98,7 +98,7 @@ static int cli_print( lua_State *L ) {
lua_pushvalue(L, i); /* value to print */
lua_call(L, 1, 1);
s = lua_tostring(L, -1); /* get result */
- if (s == NULL)
+ if (s == NULL)
return luaL_error(L, LUA_QL("tostring") " must return a string to "
LUA_QL("print"));
@@ -195,7 +195,7 @@ static void cli_render( double bx, double by, double w, double h, void *data )
else
c = &cBlack;
gl_printMaxRaw( cli_font, w,
- bx + SCREEN_W/2., by + y + SCREEN_H/2.,
+ bx + SCREEN_W/2., by + y + SCREEN_H/2.,
c, cli_buffer[i] );
i = (i + 1) % BUF_LINES;
}
View
4 src/dev_ship.c
@@ -26,10 +26,10 @@ void dship_csv( const char *path )
int i, n, l;
SDL_RWops *rw;
char buf[ 1024 ];
-
+
/* File to output to. */
rw = SDL_RWFromFile( path, "w" );
-
+
/* Write "header" */
l = snprintf( buf, sizeof(buf),
"name,base_type,price,license,fabricator,"
View
4 src/dev_sysedit.c
@@ -567,7 +567,7 @@ static void sysedit_mouse( unsigned int wid, SDL_Event* event, double mx, double
mod = SDL_GetModState();
switch (event->type) {
-
+
case SDL_MOUSEBUTTONDOWN:
/* Must be in bounds. */
if ((mx < 0.) || (mx > w) || (my < 0.) || (my > h))
@@ -999,7 +999,7 @@ static void sysedit_btnEditApply( unsigned int wid, char *wgt )
{
Planet *p;
char *str, buf[PATH_MAX];
-
+
/* Comfort. */
p = sysedit_sys->planets[ sysedit_select[0].u.planet ];
View
6 src/dev_uniedit.c
@@ -392,7 +392,7 @@ static void uniedit_mouse( unsigned int wid, SDL_Event* event, double mx, double
mod = SDL_GetModState();
switch (event->type) {
-
+
case SDL_MOUSEBUTTONDOWN:
/* Must be in bounds. */
if ((mx < 0.) || (mx > w) || (my < 0.) || (my > h))
@@ -581,7 +581,7 @@ static void uniedit_renameSys (void)
/* Keep current name. */
if (name == NULL)
continue;
-
+
/* Try again. */
if (uniedit_checkName( name )) {
free(name);
@@ -747,7 +747,7 @@ static void uniedit_selectAdd( StarSystem *sys )
}
/* Add system. */
- uniedit_sys[ uniedit_nsys ] = sys;
+ uniedit_sys[ uniedit_nsys ] = sys;
uniedit_nsys++;
/* Set text again. */
View
12 src/dialogue.c
@@ -113,7 +113,7 @@ static void dialogue_alertClose( unsigned int wid, char* str )
/**
* @brief Gets the size needed for the dialogue.
- *
+ *
* @param msg Message of the dialogue.
* @param[out] width Gets the width needed.
* @param[out] height Gets the height needed.
@@ -185,7 +185,7 @@ void dialogue_msg( const char* caption, const char *fmt, ... )
*
* @param caption Window title.
* @param text Message to display.
- */
+ */
void dialogue_msgRaw( const char* caption, const char *msg )
{
int w,h;
@@ -440,7 +440,7 @@ void dialogue_makeChoice( const char *caption, const char *msg, int opts )
choice_result = NULL;
choice_nopts = opts;
font = dialogue_getSize( caption, msg, &w, &h );
-
+
/* create window */
choice_wid = window_create( caption, -1, -1, w, h+100+40*choice_nopts );
/* text */
@@ -463,7 +463,7 @@ void dialogue_addChoice( const char *caption, const char *msg, const char *opt)
return;
font = dialogue_getSize( caption, msg, &w, &h );
-
+
/* buttons. Add one for each option in the menu. */
window_addButton( choice_wid, w/2-125, choice_nopts*40, 250, 30, (char *) opt,
(char *) opt, dialogue_choiceClose );
@@ -482,7 +482,7 @@ char *dialogue_runChoice (void)
/* tricky secondary loop */
dialogue_open++;
toolkit_loop();
-
+
return choice_result;
}
/**
@@ -493,7 +493,7 @@ char *dialogue_runChoice (void)
static void dialogue_choiceClose( unsigned int wid, char* str )
{
choice_result = str;
-
+
/* destroy the window */
window_destroy( wid );
choice_wid = 0;
View
2  src/economy.c
@@ -102,7 +102,7 @@ void credits2str( char *str, uint64_t credits, int decimals )
snprintf( str, ECON_CRED_STRLEN, "%.*fM", decimals, (double)credits / 1000000. );
else if (credits >= 1000U)
snprintf( str, ECON_CRED_STRLEN, "%.*fK", decimals, (double)credits / 1000. );
- else
+ else
snprintf (str, ECON_CRED_STRLEN, "%"PRIu64, credits );
}
View
2  src/economy.h
@@ -47,7 +47,7 @@ int economy_refresh (void);
void economy_destroy (void);
-/*
+/*
* Misc stuff.
*/
void credits2str( char *str, uint64_t credits, int decimals );
View
2  src/equipment.c
@@ -311,7 +311,7 @@ static void equipment_renderColumn( double x, double y, double w, double h,
glColour *c, *dc, bc;
/* Render text. */
- if ((o != NULL) && (lst[0].slot.type == o->slot.type))
+ if ((o != NULL) && (lst[0].slot.type == o->slot.type))
c = &cDConsole;
else
c = &cBlack;
View
4 src/event.c
@@ -476,7 +476,7 @@ int events_load (void)
char *buf;
xmlNodePtr node;
xmlDocPtr doc;
-
+
/* Load the data. */
buf = ndata_read( EVENT_DATA, &bufsize );
if (buf == NULL) {
@@ -524,7 +524,7 @@ int events_load (void)
/* Shrink to minimum. */
event_data = realloc(event_data, sizeof(EventData_t)*event_ndata);
- /* Clean up. */
+ /* Clean up. */
xmlFreeDoc(doc);
free(buf);
View
10 src/faction.c
@@ -108,7 +108,7 @@ int pfaction_load( xmlNodePtr parent );
int faction_get( const char* name )
{
int i;
- for (i=0; i<faction_nstack; i++)
+ for (i=0; i<faction_nstack; i++)
if (strcmp(faction_stack[i].name, name)==0)
break;
@@ -400,7 +400,7 @@ double faction_getPlayer( int f )
{
if (faction_isFaction(f)) {
return faction_stack[f].player;
- }
+ }
else {
WARN("%d is an invalid faction", f);
return -1000;
@@ -418,7 +418,7 @@ double faction_getPlayerDef( int f )
{
if (faction_isFaction(f)) {
return faction_stack[f].player_def;
- }
+ }
else {
WARN("%d is an invalid faction", f);
return -1000;
@@ -594,7 +594,7 @@ int areAllies( int a, int b )
if (faction_isFaction(a)) {
if (faction_stack[a].player > PLAYER_ALLY) return 1;
else return 0;
- }
+ }
else {
WARN("%d is an invalid faction", a);
return 0;
@@ -999,7 +999,7 @@ int pfaction_load( xmlNodePtr parent )
cur = node->xmlChildrenNode;
do {
if (xml_isNode(cur,"faction")) {
- xmlr_attr(cur,"name",str);
+ xmlr_attr(cur,"name",str);
faction = faction_get(str);
if (faction != -1) { /* Faction is valid. */
View
14 src/fleet.c
@@ -50,13 +50,13 @@ static int fleet_parse( Fleet *temp, const xmlNodePtr parent );
* @return The fleet matching name or NULL if not found.
*/
Fleet* fleet_get( const char* name )
-{
+{
int i;
-
+
for (i=0; i<nfleets; i++)
if (strcmp(fleet_stack[i].name, name)==0)
return &fleet_stack[i];
-
+
return NULL;
}
@@ -169,7 +169,7 @@ static int fleet_parse( Fleet *temp, const xmlNodePtr parent )
/* Set flags. */
if (xml_isNode(node,"flags")){
- cur = node->children;
+ cur = node->children;
do {
if (xml_isNode(cur,"guard"))
fleet_setFlag(temp, FLEET_FLAG_GUARD);
@@ -179,7 +179,7 @@ static int fleet_parse( Fleet *temp, const xmlNodePtr parent )
/* Load pilots. */
else if (xml_isNode(node,"pilots")) {
- cur = node->children;
+ cur = node->children;
mem = 0;
do {
if (xml_isNode(cur,"pilot")) {
@@ -246,7 +246,7 @@ static int fleet_loadFleets (void)
char *buf;
xmlNodePtr node;
xmlDocPtr doc;
-
+
/* Load the data. */
buf = ndata_read( FLEET_DATA, &bufsize);
doc = xmlParseMemory( buf, bufsize );
@@ -264,7 +264,7 @@ static int fleet_loadFleets (void)
}
mem = 0;
- do {
+ do {
if (xml_isNode(node,"fleet")) {
/* See if memory must grow. */
nfleets++;
View
2  src/fleet.h
@@ -23,7 +23,7 @@
*
* @sa Fleet
* @sa Pilot
- */
+ */
typedef struct FleetPilot_ {
Ship *ship; /**< Ship the pilot is flying. */
char *name; /**< Used if they have a special name like uniques. */
View
54 src/gui.c
@@ -197,7 +197,7 @@ static double mesg_timeout = 15.; /**< Timeout length. */
static double mesg_fade = 5.; /**< Fade length. */
/**
* @struct Mesg
- *
+ *
* @brief On screen player message.
*/
typedef struct Mesg_ {
@@ -207,15 +207,15 @@ typedef struct Mesg_ {
static Mesg* mesg_stack = NULL; /**< Stack of mesages, will be of mesg_max size. */
-/*
+/*
* prototypes
*/
-/*
+/*
* external
*/
extern void weapon_minimap( const double res, const double w, const double h,
const RadarShape shape, double alpha ); /**< from weapon.c */
-/*
+/*
* internal
*/
/* gui */
@@ -517,7 +517,7 @@ static void gui_renderPilotTarget( double dt )
}
/* Draw the pilot target. */
- if (pilot_isDisabled(p))
+ if (pilot_isDisabled(p))
c = &cInert;
else if (pilot_isFlag(p,PILOT_BRIBED))
c = &cNeutral;
@@ -615,7 +615,7 @@ static void gui_renderBorder( double dt )
gl_cameraZoomGet( &z );
/* Get player position. */
- hw = SCREEN_W/2;
+ hw = SCREEN_W/2;
hh = SCREEN_H/2;
/* Interference. */
@@ -684,7 +684,7 @@ static void gui_renderBorder( double dt )
/* Draw jump routes. */
for (i=0; i<cur_system->njumps; i++) {
- jp = &cur_system->jumps[i];
+ jp = &cur_system->jumps[i];
tex = jumppoint_gfx;
/* See if in sensor range. */
@@ -875,7 +875,7 @@ void gui_render( double dt )
/*
- * NAV
+ * NAV
*/
if (player.p->nav_planet >= 0) { /* planet landing target */
gl_printMid( NULL, (int)gui.nav.w,
@@ -950,18 +950,18 @@ void gui_render( double dt )
gui_renderHealth( &gui.fuel, player.p->fuel / player.p->fuel_max );
- /*
+ /*
* weapon
- */
+ */
if ((player.p->secondary==NULL) || (player.p->secondary->outfit == NULL)) {
gl_printMid( NULL, (int)gui.weapon.w,
gui.weapon.x, gui.weapon.y - 5,
- &cConsole, "Secondary" );
+ &cConsole, "Secondary" );
gl_printMid( &gl_smallFont, (int)gui.weapon.w,
gui.weapon.x, gui.weapon.y - 10 - gl_defFont.h,
- &cGrey, "None");
- }
+ &cGrey, "None");
+ }
else {
f = &gl_defFont;
@@ -981,7 +981,7 @@ void gui_render( double dt )
for (i=0; i<player.p->outfit_nweapon; i++) {
if (player.p->outfit_weapon[i].outfit != player.p->secondary->outfit)
continue;
-
+
if (player.p->outfit_weapon[i].u.ammo.outfit == player.p->secondary->u.ammo.outfit)
q += player.p->outfit_weapon[i].u.ammo.quantity;
}
@@ -1011,7 +1011,7 @@ void gui_render( double dt )
gui.weapon.x, gui.weapon.y - (gui.weapon.h - f->h)/2.,
c, player.p->secondary->outfit->name );
}
- }
+ }
/*
@@ -1028,7 +1028,7 @@ void gui_render( double dt )
if (r > 0) {
/* Colourize ship name */
- if (pilot_isDisabled(p))
+ if (pilot_isDisabled(p))
c = &cInert;
else if (pilot_isFlag(p,PILOT_BRIBED))
c = &cNeutral;
@@ -1084,7 +1084,7 @@ void gui_render( double dt )
else { /* on armour */
gl_printMax( &gl_smallFont, gui.target_health.w,
gui.target_health.x,
- gui.target_health.y, NULL,
+ gui.target_health.y, NULL,
"%s: %.0f%%", "Armour", p->armour/p->armour_max*100. );
}
}
@@ -1137,7 +1137,7 @@ void gui_render( double dt )
gl_print( &gl_smallFont,
gui.misc.x + 8, j,
&cConsole, "Cargo:" );
- for (i=0; i < MIN(player.p->ncommodities,3); i++) {
+ for (i=0; i < MIN(player.p->ncommodities,3); i++) {
j -= gl_smallFont.h + 3;
if (player.p->commodities[i].quantity > 0.) /* quantity is over */
gl_printMax( &gl_smallFont, gui.misc.w - 15,
@@ -1145,7 +1145,7 @@ void gui_render( double dt )
NULL, "%d %s%s", player.p->commodities[i].quantity,
player.p->commodities[i].commodity->name,
(player.p->commodities[i].id) ? "*" : "" );
- else /* basically for weightless mission stuff */
+ else /* basically for weightless mission stuff */
gl_printMax( &gl_smallFont, gui.misc.w - 15,
gui.misc.x + 13, j,
NULL, "%s%s", player.p->commodities[i].commodity->name,
@@ -1620,7 +1620,7 @@ static glColour *gui_getPlanetColour( int i )
col = &cRadar_tPlanet;
else if ((col != &cHostile) && !planet_hasService(planet,PLANET_SERVICE_INHABITED))
col = &cInert; /* Override non-hostile planets without service. */
-
+
return col;
}
@@ -1976,7 +1976,7 @@ static void gui_renderHealth( const HealthBar *bar, const double w )
ty = bar->gfx->sh / bar->gfx->rh;
/* Set the colour. */
- COLOUR(bar->col);
+ COLOUR(bar->col);
/* Draw the image. */
glEnable(GL_TEXTURE_2D);
@@ -2119,7 +2119,7 @@ int gui_load( const char* name )
if (node == NULL) {
ERR("Malformed '"GUI_DATA"' file: does not contain elements");
return -1;
- }
+ }
do {
if (xml_isNode(node, XML_GUI_TAG)) {
@@ -2425,7 +2425,7 @@ static int gui_parse( const xmlNodePtr parent, const char *name )
}
free(tmp);
-
+
/* load the appropriate measurements */
if (gui.radar.shape == RADAR_RECT)
rect_parse( node, &gui.radar.x, &gui.radar.y, &gui.radar.w, &gui.radar.h );
@@ -2572,10 +2572,10 @@ void gui_cleanup (void)
}
}
- /* Clean up interference. */
- interference_alpha = 0.;
- interference_layer = 0;
- interference_t = 0.;
+ /* Clean up interference. */
+ interference_alpha = 0.;
+ interference_layer = 0;
+ interference_t = 0.;
/* Destroy offset. */
gui_xoff = 0.;
View
2  src/gui.h
@@ -14,7 +14,7 @@
/*
* enums
*/
-typedef enum RadarShape_ {
+typedef enum RadarShape_ {
RADAR_RECT, /**< Rectangular radar. */
RADAR_CIRCLE /**< Circular radar. */
} RadarShape; /**< Player's radar shape. */
View
6 src/hook.c
@@ -72,7 +72,7 @@ typedef struct Hook_ {
} Hook;
-/*
+/*
* the stack
*/
static unsigned int hook_id = 0; /**< Unique hook id generator. */
@@ -595,7 +595,7 @@ int hooks_runParam( const char* stack, unsigned int pilot )
hook_rm( hook_stack[i].id );
i--;
}
-
+
return 0;
}
@@ -721,7 +721,7 @@ static int hook_needSave( Hook *h )
"p_death", "p_board", "p_disable", "p_jump", "p_attacked", "p_idle", /* pilot hooks */
"timer", /* timers */
"end" };
-
+
/* Impossible to save functions. */
if (h->type == HOOK_TYPE_FUNC)
return 0;
View
2  src/hook.h
@@ -18,7 +18,7 @@ int hook_rm( unsigned int id );
void hook_rmMisnParent( unsigned int parent );
void hook_rmEventParent( unsigned int parent );
-/*
+/*
* run hooks
*
* Currently used:
View
14 src/info.c
@@ -152,7 +152,7 @@ static void info_openMain( unsigned int wid )
"Fuel:"
);
credits2str( creds, player.p->credits, 2 );
- snprintf( str, 128,
+ snprintf( str, 128,
"%s\n"
"%s\n"
"%s\n"
@@ -390,7 +390,7 @@ static void cargo_jettison( unsigned int wid, char* str )
/* Special case mission cargo. */
if (player.p->commodities[pos].id != 0) {
- if (!dialogue_YesNo( "Abort Mission",
+ if (!dialogue_YesNo( "Abort Mission",
"Are you sure you want to abort this mission?" ))
return;
@@ -419,7 +419,7 @@ static void cargo_jettison( unsigned int wid, char* str )
/* Now clean up mission. */
if (ret != 2) {
mission_cleanup( misn );
- memmove( misn, &player_missions[i+1],
+ memmove( misn, &player_missions[i+1],
sizeof(Mission) * (MISSION_MAX-i-1) );
memset( &player_missions[MISSION_MAX-1], 0, sizeof(Mission) );
}
@@ -580,7 +580,7 @@ static void info_openMissions( unsigned int wid )
window_addButton( wid, -20, 40 + BUTTON_HEIGHT,
BUTTON_WIDTH, BUTTON_HEIGHT, "btnAbortMission", "Abort",
mission_menu_abort );
-
+
/* text */
window_addText( wid, 300+40, -60,
200, 40, 0, "txtSReward",
@@ -620,7 +620,7 @@ static void mission_menu_genList( unsigned int wid, int first )
if (player_missions[i].id != 0)
misn_names[j++] = (player_missions[i].title!=NULL) ? strdup(player_missions[i].title) : NULL;
if (j==0) { /* no missions */
- misn_names[0] = strdup("No Missions");
+ misn_names[0] = strdup("No Missions");
j = 1;
}
window_addList( wid, 20, -40,
@@ -672,7 +672,7 @@ static void mission_menu_abort( unsigned int wid, char* str )
selected_misn = toolkit_getList( wid, "lstMission" );
- if (dialogue_YesNo( "Abort Mission",
+ if (dialogue_YesNo( "Abort Mission",
"Are you sure you want to abort this mission?" )) {
/* Get the mission. */
@@ -685,7 +685,7 @@ static void mission_menu_abort( unsigned int wid, char* str )
/* Now clean up mission. */
if (ret != 2) {
mission_cleanup( misn );
- memmove( misn, &player_missions[pos+1],
+ memmove( misn, &player_missions[pos+1],
sizeof(Mission) * (MISSION_MAX-pos-1) );
memset( &player_missions[MISSION_MAX-1], 0, sizeof(Mission) );
}
View
28 src/input.c
@@ -265,7 +265,7 @@ void input_setDefault (void)
* @brief Initializes the input subsystem (does not set keys).
*/
void input_init (void)
-{
+{
Keybind *temp;
int i;
@@ -296,7 +296,7 @@ void input_init (void)
SDL_EventState( SDL_MOUSEMOTION, SDL_ENABLE );
SDL_EventState( SDL_MOUSEBUTTONDOWN, SDL_ENABLE );
SDL_EventState( SDL_MOUSEBUTTONUP, SDL_ENABLE );
-
+
/* Joystick, enabled in joystick.c if needed. */
SDL_EventState( SDL_JOYAXISMOTION, SDL_DISABLE );
SDL_EventState( SDL_JOYHATMOTION, SDL_DISABLE );
@@ -434,7 +434,7 @@ SDLKey input_keyConv( const char *name )
* @param mod Modifiers to check for.
*/
void input_setKeybind( const char *keybind, KeybindType type, int key, SDLMod mod )
-{
+{
int i;
for (i=0; strcmp(keybindNames[i],"end"); i++)
if (strcmp(keybind, input_keybinds[i]->name)==0) {
@@ -651,7 +651,7 @@ static void input_key( int keynum, double value, double kabs, int repeat )
if (!paused) player_abortAutonav(NULL);
player_accel(1.);
}
-
+
else if (value==KEY_RELEASE)
player_accelOver();
@@ -682,14 +682,14 @@ static void input_key( int keynum, double value, double kabs, int repeat )
} else if (KEY("left") && !repeat) {
if (kabs >= 0.) {
if (!paused) player_abortAutonav(NULL);
- player_setFlag(PLAYER_TURN_LEFT);
+ player_setFlag(PLAYER_TURN_LEFT);
player_left = kabs;
}
else {
/* set flags for facing correction */
- if (value==KEY_PRESS) {
+ if (value==KEY_PRESS) {
if (!paused) player_abortAutonav(NULL);
- player_setFlag(PLAYER_TURN_LEFT);
+ player_setFlag(PLAYER_TURN_LEFT);
player_left = 1.;
}
else if (value==KEY_RELEASE) {
@@ -717,7 +717,7 @@ static void input_key( int keynum, double value, double kabs, int repeat )
player_right = 0.;
}
}
-
+
/* turn around to face vel */
} else if (KEY("reverse") && !repeat) {
if (value==KEY_PRESS) {
@@ -733,10 +733,10 @@ static void input_key( int keynum, double value, double kabs, int repeat )
*/
/* shooting primary weapon */
} else if (KEY("primary") && NODEAD() && !repeat) {
- if (value==KEY_PRESS) {
+ if (value==KEY_PRESS) {
player_setFlag(PLAYER_PRIMARY);
}
- else if (value==KEY_RELEASE)
+ else if (value==KEY_RELEASE)
player_rmFlag(PLAYER_PRIMARY);
/* targetting */
} else if (INGAME() && NODEAD() && KEY("target_next")) {
@@ -755,7 +755,7 @@ static void input_key( int keynum, double value, double kabs, int repeat )
if (value==KEY_PRESS) player_targetClear();
/* face the target */
} else if (KEY("face") && !repeat) {
- if (value==KEY_PRESS) {
+ if (value==KEY_PRESS) {
if (!paused) player_abortAutonav(NULL);
player_setFlag(PLAYER_FACE);
}
@@ -770,7 +770,7 @@ static void input_key( int keynum, double value, double kabs, int repeat )
}
- /*
+ /*
* Weapon selection.
*/
} else if (KEY("weap_all") && INGAME() && NODEAD() && !repeat) {
@@ -816,7 +816,7 @@ static void input_key( int keynum, double value, double kabs, int repeat )
if (value==KEY_PRESS) player_secondaryPrev();
- /*
+ /*
* space
*/
} else if (KEY("autonav") && INGAME() && NOHYP() && NODEAD()) {
@@ -896,7 +896,7 @@ static void input_key( int keynum, double value, double kabs, int repeat )
/* opens a small menu */
} else if (KEY("menu") && NODEAD() && !repeat) {
if (value==KEY_PRESS) menu_small();
-
+
/* shows pilot information */
} else if (KEY("info") && NOHYP() && NODEAD() && !repeat) {
if (value==KEY_PRESS) menu_info();
View
2  src/intro.c
@@ -210,7 +210,7 @@ int intro_display( const char *text, const char *mus )
break;
}
}
-
+
/* Increment position. */
offset += vel * dt;
View
2  src/land.c
@@ -169,7 +169,7 @@ static void commodity_exchange_open( unsigned int wid )
window_addButton( wid, -20, 20*2 + LAND_BUTTON_HEIGHT,
(LAND_BUTTON_WIDTH-20)/2, LAND_BUTTON_HEIGHT, "btnCommoditySell",
"Sell", commodity_sell );
-
+
/* cust draws the modifier */
window_addCust( wid, -40-((LAND_BUTTON_WIDTH-20)/2), 60+ 2*LAND_BUTTON_HEIGHT,
(LAND_BUTTON_WIDTH-20)/2, LAND_BUTTON_HEIGHT, "cstMod", 0, commodity_renderMod, NULL, NULL );
View
4 src/land_shipyard.c
@@ -35,7 +35,7 @@ static Ship* shipyard_selected = NULL; /**< Currently selected shipyard ship. */
/*
* Helper functions.
*/
-static void shipyard_buy( unsigned int wid, char* str );
+static void shipyard_buy( unsigned int wid, char* str );
static void shipyard_trade( unsigned int wid, char* str );
static void shipyard_rmouse( unsigned int wid, char* widget_name );
static void shipyard_renderSlots( double bx, double by, double bw, double bh, void *data );
@@ -92,7 +92,7 @@ void shipyard_open( unsigned int wid )
/* slot types */
window_addCust( wid, -20, -160, 148, 70, "cstSlots", 0.,
- shipyard_renderSlots, NULL, NULL );
+ shipyard_renderSlots, NULL, NULL );
/* stat text */
window_addText( wid, -40, -240, 128, 200, 0, "txtStats",
View
32 src/map.c
@@ -137,7 +137,7 @@ void map_open (void)
wid = window_create( MAP_WDWNAME, -1, -1, w, h );
window_setCancel( wid, window_close );
- /*
+ /*
* SIDE TEXT
*
* $System
@@ -153,7 +153,7 @@ void map_open (void)
*
* Services:
* $Services
- *
+ *
* ...
* [Autonav]
* [ Close ]
@@ -213,9 +213,9 @@ void map_open (void)
map_show( wid, 20, -40, w-150, h-100, 1. ); /* Reset zoom. */
map_update( wid );
-
+
/*
- * Disable Autonav button if player lacks fuel.
+ * Disable Autonav button if player lacks fuel.
*/
if (player.p->fuel < HYPERSPACE_FUEL)
window_disableButton( wid, "btnAutonav" );
@@ -287,7 +287,7 @@ static void map_update( unsigned int wid )
window_moveWidget( wid, "txtSServices", -20, -220 );
window_moveWidget( wid, "txtServices", -20, -220-gl_smallFont.h-5 );
window_modifyText( wid, "txtServices", "Unknown" );
-
+
/*
* Bottom Text
*/
@@ -626,7 +626,7 @@ static void map_render( double bx, double by, double w, double h, void *data )
/* Render the jump paths. */
map_renderPath( x, y );
-
+
/* Render system names. */
map_renderNames( x, y, 0 );
@@ -729,7 +729,7 @@ void map_renderSystems( double bx, double by, double x, double y,
/* draw the hyperspace paths */
glShadeModel(GL_SMOOTH);
col = &cDarkBlue;
- /* first we draw all of the paths. */
+ /* first we draw all of the paths. */
for (j=0; j<sys->njumps; j++) {
jsys = sys->jumps[j].target;
@@ -763,7 +763,7 @@ void map_renderSystems( double bx, double by, double x, double y,
glShadeModel( GL_FLAT );
}
}
-
+
/* Now we'll draw over the lines with the new pathways. */
/**
* @brief Render the map path.
@@ -781,7 +781,7 @@ static void map_renderPath( double x, double y )
glShadeModel(GL_SMOOTH);
col = &cGreen;
fuel = player.p->fuel;
-
+
for (j=0; j<map_npath; j++) {
jsys = map_path[j];
if (fuel == player.p->fuel && fuel > 100.)
@@ -791,7 +791,7 @@ static void map_renderPath( double x, double y )
else
col = &cYellow;
fuel -= 100;
-
+
/* Draw the lines. */
vertex[0] = x + lsys->pos.x * map_zoom;
vertex[1] = y + lsys->pos.y * map_zoom;
@@ -817,10 +817,10 @@ static void map_renderPath( double x, double y )
sizeof(GLfloat) * 2*3, 4, GL_FLOAT, 0 );
glDrawArrays( GL_LINE_STRIP, 0, 3 );
gl_vboDeactivate();
-
+
lsys = jsys;
}
-
+
glShadeModel( GL_FLAT );
}
}
@@ -932,7 +932,7 @@ static void map_mouse( unsigned int wid, SDL_Event* event, double mx, double my,
t = 15.*15.; /* threshold */
switch (event->type) {
-
+
case SDL_MOUSEBUTTONDOWN:
/* Must be in bounds. */
if ((mx < 0.) || (mx > w) || (my < 0.) || (my > h))
@@ -1408,7 +1408,7 @@ StarSystem** map_getJumpPath( int* njumps, const char* sysstart,
/* Make sure it's reachable */
if (!ignore_known &&
- ((!sys_isKnown(sys) &&
+ ((!sys_isKnown(sys) &&
(!sys_isKnown(cur->sys) || !space_sysReachable(esys)))))
continue;
@@ -1423,7 +1423,7 @@ StarSystem** map_getJumpPath( int* njumps, const char* sysstart,
if (ccost != NULL) {
closed = A_rm( closed, sys ); /* shouldn't happen */
}
-
+
if ((ocost == NULL) && (ccost == NULL)) {
neighbour->g = cost;
neighbour->r = A_g(neighbour) + A_h(cur->sys,sys);
@@ -1560,7 +1560,7 @@ int map_isMapped( const char* targ_sys, int r )
/* check it's jumps */
for (i=0; i<sys->njumps; i++) {
jsys = sys->jumps[i].target;
-
+
/* SYstem has already been parsed. */
if (A_in(closed,jsys) != NULL)
continue;
View
8 src/menu.c
@@ -279,7 +279,7 @@ static void menu_main_cleanBG( unsigned int wid, char* str )
{
(void) str;
- /*
+ /*
* Ugly hack to prevent player.c from segfaulting due to the fact
* that game will attempt to render while waiting for the quit event
* pushed by exit_game() to be handled without actually having a player
@@ -325,7 +325,7 @@ void menu_small (void)
window_addButton( wid, 20, 20 + BUTTON_HEIGHT + 20,
BUTTON_WIDTH, BUTTON_HEIGHT,
"btnOptions", "Options", menu_options_button );
- window_addButton( wid, 20, 20, BUTTON_WIDTH, BUTTON_HEIGHT,
+ window_addButton( wid, 20, 20, BUTTON_WIDTH, BUTTON_HEIGHT,
"btnExit", "Exit", menu_small_exit );
menu_Open(MENU_SMALL);
@@ -348,7 +348,7 @@ static void menu_small_exit( unsigned int wid, char* str )
{
(void) str;
unsigned int info_wid;
-
+
/* if landed we must save anyways */
if (landed) {
save_all();
@@ -421,7 +421,7 @@ static void menu_death_restart( unsigned int wid, char* str )
void menu_death (void)
{
unsigned int wid;
-
+
wid = window_create( "Death", -1, -1, DEATH_WIDTH, DEATH_HEIGHT );
window_onClose( wid, menu_death_close );
View
8 src/mission.c
@@ -625,7 +625,7 @@ static int mission_compare( const void* arg1, const void* arg2 )
* @param faction Faction of the planet.
* @param planet Name of the planet.
* @param sysname Name of the current system.
- * @param loc Location
+ * @param loc Location
* @return The stack of Missions created with n members.
*/
Mission* missions_genList( int *n, int faction,
@@ -779,7 +779,7 @@ static int mission_parse( MissionData* temp, const xmlNodePtr parent )
xmlr_strd(cur,"planet",temp->avail.planet);
xmlr_strd(cur,"system",temp->avail.system);
if (xml_isNode(cur,"faction")) {
- temp->avail.factions = realloc( temp->avail.factions,
+ temp->avail.factions = realloc( temp->avail.factions,
sizeof(int) * ++temp->avail.nfactions );
temp->avail.factions[temp->avail.nfactions-1] =
faction_get( xml_get(cur) );
@@ -1173,7 +1173,7 @@ static int mission_unpersistDataNode( lua_State *L, xmlNodePtr parent )
/* Set field. */
lua_settable(L, -3);
-
+
/* cleanup */
free(type);
free(name);
@@ -1252,7 +1252,7 @@ int missions_saveActive( xmlTextWriterPtr writer )
/* OSD. */
if (player_missions[i].osd > 0) {
xmlw_startElem(writer,"osd");
-
+
/* Save attributes. */
items = osd_getItems(player_missions[i].osd, &nitems);
xmlw_attr(writer,"title","%s",osd_getTitle(player_missions[i].osd));
View
4 src/music.c
@@ -334,7 +334,7 @@ static int music_find (void)
len = flen - suflen;
strncpy( tmp, files[i], len );
tmp[MIN(len,64-1)] = '\0';
-
+
/* give it the new name */
music_selection[nmusic_selection-1] = strdup(tmp);
}
@@ -401,7 +401,7 @@ int music_load( const char* name )
/* Load new music. */
music_name = strdup(name);
music_start = SDL_GetTicks();
- snprintf( filename, PATH_MAX, MUSIC_PREFIX"%s"MUSIC_SUFFIX, name);
+ snprintf( filename, PATH_MAX, MUSIC_PREFIX"%s"MUSIC_SUFFIX, name);
rw = ndata_rwops( filename );
if (rw == NULL) {
WARN("Music '%s' not found.", filename);
View
4 src/music_openal.c
@@ -723,7 +723,7 @@ int music_al_load( const char* name, SDL_RWops *rw )
/* set the new name */
strncpy( music_vorbis.name, name, 64 );
-
+
/* Load new ogg. */
music_vorbis.rw = rw;
if (ov_open_callbacks( music_vorbis.rw, &music_vorbis.stream,
@@ -812,7 +812,7 @@ int music_al_volume( double vol )
/* Check for errors. */
al_checkErr();
}
-
+
soundUnlock();
return 0;
View
8 src/naev.c
@@ -152,7 +152,7 @@ int main( int argc, char** argv )
/* Save the binary path. */
binary_path = strdup(argv[0]);
-
+
/* Print the version */
LOG( " "APPNAME" v%s", naev_version(0) );
#ifdef GIT_COMMIT
@@ -190,7 +190,7 @@ int main( int argc, char** argv )
xmlInitParser();
/* Input must be initialized for config to work. */
- input_init();
+ input_init();
/* Set the configuration. */
snprintf(buf, PATH_MAX, "%s"CONF_FILE, nfile_basePath());
@@ -297,7 +297,7 @@ int main( int argc, char** argv )
if ((SDL_GetTicks() - time_ms) < NAEV_INIT_DELAY)
SDL_Delay( NAEV_INIT_DELAY - (SDL_GetTicks() - time_ms) );
time_ms = SDL_GetTicks(); /* initializes the time_ms */
- /*
+ /*
* main loop
*/
SDL_Event event;
@@ -596,7 +596,7 @@ static void fps_control (void)
game_dt = real_dt * dt_mod; /* Apply the modifier. */
time_ms = t;
- /* if fps is limited */
+ /* if fps is limited */
if (!conf.vsync && conf.fps_max != 0) {
fps_max = 1./(double)conf.fps_max;
if (real_dt < fps_max) {
View
18 src/nebula.c
@@ -353,7 +353,7 @@ static void nebu_renderMultitexture( const double dt )
}
/* Now render! */
- gl_vboActivateOffset( nebu_vboBG, GL_VERTEX_ARRAY,
+ gl_vboActivateOffset( nebu_vboBG, GL_VERTEX_ARRAY,
sizeof(GL_FLOAT) * 0*2*4, 2, GL_FLOAT, 0 );
gl_vboActivateOffset( nebu_vboBG, GL_TEXTURE0,
sizeof(GL_FLOAT) * 1*2*4, 2, GL_FLOAT, 0 );
@@ -481,7 +481,7 @@ static void nebu_genOverlay (void)
data[(2+4)*18+39] = -nebu_view;
data[(2+4)*18+40] = -SCREEN_W/2.*z-gx;
data[(2+4)*18+41] = -SCREEN_H/2.*z-gy;
-
+
/* Bottom left */
data[(2+4)*18+42] = -SCREEN_W/2.*z-gx;
data[(2+4)*18+43] = -SCREEN_H/2.*z-gy;
@@ -647,7 +647,7 @@ void nebu_prep( double density, double volatility )
SCREEN_W + NEBULA_PUFF_BUFFER);
nebu_puffs[i].y = (double)RNG(-NEBULA_PUFF_BUFFER,
SCREEN_H + NEBULA_PUFF_BUFFER);
-
+
/* Maybe make size related? */
nebu_puffs[i].tex = RNG(0,NEBULA_PUFFS-1);
nebu_puffs[i].height = RNGF() + 0.2;
@@ -730,7 +730,7 @@ static void nebu_generatePuffs (void)
nebu = noise_genNebulaPuffMap( w, h, 1. );
sur = nebu_surfaceFromNebulaMap( nebu, w, h );
free(nebu);
-
+
/* Load the texture */
nebu_pufftexs[i] = gl_loadImage( sur, 0 );
}
@@ -806,7 +806,7 @@ static SDL_Surface* loadNebula( const char* file )
ERR("Unable to load Nebula image: %s", file);
return NULL;
}
-
+
return sur;
}
@@ -826,11 +826,11 @@ static SDL_Surface* nebu_surfaceFromNebulaMap( float* map, const int w, const in
SDL_Surface *sur;
uint32_t *pix;
double c;
-
+
/* the good surface */
sur = SDL_CreateRGBSurface( SDL_SWSURFACE, w, h, 32, RGBAMASK );
pix = sur->pixels;
-
+
/* convert from mapping to actual colours */
SDL_LockSurface( sur );
for (i=0; i<h*w; i++) {
@@ -838,6 +838,6 @@ static SDL_Surface* nebu_surfaceFromNebulaMap( float* map, const int w, const in
pix[i] = RMASK + BMASK + GMASK + (AMASK & (uint32_t)((double)AMASK*c));
}
SDL_UnlockSurface( sur );
-
+
return sur;
-}
+}
View
4 src/news.c
@@ -356,7 +356,7 @@ const news_t *news_generate( int *ngen, int n )
/* str, t */
/* Check to see if it's valid. */
- if (!lua_isstring(L, -2) || !lua_istable(L, -1)) {
+ if (!lua_isstring(L, -2) || !lua_istable(L, -1)) {
WARN("News generated invalid output!");
lua_pop(L,2);
return NULL;
@@ -396,7 +396,7 @@ const news_t *news_generate( int *ngen, int n )
news_nbuf = i;
if (ngen != NULL)
(*ngen) = news_nbuf;
-
+
return news_buf;
}
View
6 src/nfile.c
@@ -15,11 +15,11 @@
#include "naev.h"
-#include <stdio.h>
+#include <stdio.h>
#include <string.h>
#include <stdarg.h>
#include <stdlib.h>
-#include <dirent.h>
+#include <dirent.h>
#if HAS_POSIX
#include <sys/types.h>
#include <sys/stat.h>
@@ -68,7 +68,7 @@ char* nfile_basePath (void)
#error "Feature needs implementation on this Operating System for NAEV to work."
#endif
}
-
+
return naev_base;
}
View
2  src/nlua.c
@@ -157,7 +157,7 @@ static int nlua_packfileLoader( lua_State* L )
lua_pushfstring(L, "%s not found in ndata.", filename);
return 1;
}
-
+
/* run the buffer */
if (luaL_dobuffer(L, buf, bufsize, filename) != 0) {
/* will push the current error from the dobuffer */
View
2  src/nlua_cli.c
@@ -37,7 +37,7 @@ static const luaL_reg cli_methods[] = {
* @return 0 on success.
*/
int nlua_loadCLI( lua_State *L )
-{
+{
luaL_register(L, "cli", cli_methods);
return 0;
}
View
2  src/nlua_evt.c
@@ -212,7 +212,7 @@ static int evt_npcAdd( lua_State *L )
priority = luaL_checkint( L, 5 );
else
priority = 5;
-
+
/* Set path. */
snprintf( portrait, PATH_MAX, "gfx/portraits/%s.png", gfx );
View
6 src/nlua_faction.c