[atanks] 03/13: Import Upstream version 6.0~dfsg

Markus Koschany apo at moszumanska.debian.org
Sat Nov 26 23:05:25 UTC 2016


This is an automated email from the git hooks/post-receive script.

apo pushed a commit to branch master
in repository atanks.

commit 919a956a358a0a0c44614ae25332b51fddbee870
Author: Markus Koschany <apo at debian.org>
Date:   Sat Nov 26 23:42:38 2016 +0100

    Import Upstream version 6.0~dfsg
---
 COPYING             |  11 ++++---
 Changelog           |  52 ++++++++++++++++++++++++++++++++
 Makefile            |   8 ++++-
 README              |   8 +++--
 README_ru.txt       |   6 ++--
 TODO                |  36 ++++++++++++++--------
 atanks.desktop      |   2 +-
 src/Makefile        |   3 +-
 src/Makefile.bsd    |   6 ++--
 src/atanks.cpp      |  61 ++++++++------------------------------
 src/beam.cpp        |   2 +-
 src/button.cpp      |   4 +--
 src/client.cpp      |  11 +++----
 src/environment.cpp |  46 +++++++++++++++++++++++-----
 src/environment.h   |  10 +++++++
 src/files.cpp       |   9 ++++--
 src/floattext.cpp   |  35 ++++++++++------------
 src/gameloop.cpp    |  11 ++++---
 src/globaldata.cpp  |   5 ++++
 src/globaldata.h    |   5 +++-
 src/main.h          |   3 +-
 src/menucontent.h   |  84 ++++++++++++++++++++++++++--------------------------
 src/missile.cpp     |   5 ++--
 src/network.cpp     |   1 +
 src/player.cpp      |  15 +++++-----
 src/player.h        |   2 +-
 src/sky.cpp         |   4 +++
 src/tank.cpp        |  34 +++++++++++----------
 src/tank.h          |   4 +--
 src/teleport.cpp    |   2 +-
 src/update.cpp      |   2 +-
 tank/16.bmp         | Bin 0 -> 890 bytes
 tankgun/9.bmp       | Bin 0 -> 3126 bytes
 33 files changed, 288 insertions(+), 199 deletions(-)

diff --git a/COPYING b/COPYING
index 4e12446..57b656e 100644
--- a/COPYING
+++ b/COPYING
@@ -2,7 +2,11 @@
 		       Version 2, June 1991
 
  Copyright (C) 1989, 1991 Free Software Foundation, Inc.
-                       59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ Free Software Foundation
+ 51 Franklin Street, Fifth Floor
+ Boston, MA 02110-1301
+ USA
+
  Everyone is permitted to copy and distribute verbatim copies
  of this license document, but changing it is not allowed.
 
@@ -294,9 +298,8 @@ the "copyright" line and a pointer to where the full notice is found.
     Copyright (C) <year>  <name of author>
 
     This program is free software; you can redistribute it and/or modify
-    it under the terms of the GNU General Public License as published by
-    the Free Software Foundation; either version 2 of the License, or
-    (at your option) any later version.
+    it under the terms of the GNU General Public License (version 2) 
+    as published by the Free Software Foundation.
 
     This program is distributed in the hope that it will be useful,
     but WITHOUT ANY WARRANTY; without even the implied warranty of
diff --git a/Changelog b/Changelog
index 9f6ab17..ecc9b51 100644
--- a/Changelog
+++ b/Changelog
@@ -1,10 +1,62 @@
 NOTE: From now on, new changes appear at the top of this file.
 
+=========== Atanks-6.0 released ==============
+	- Removed extra alleg42.dll file from src directory.
+        - Clarified license.
+        - Pressing "v" or "V" during a match will cause
+          the audio volume to decrease or increase, respectively.
+          Volume patch provided by Daniel.
+        - Plugged memory leak from update check.
+        - Fixed possible memory problem in floating text.
+
+=========== Atanks-5.9 released ==============
+
+	- Applied patch which removes GCC warnings,
+          Patch supplied by Daniel Gutson.
+
+
+============ Atanks-5.8 released ==============
+
+	- Removed compiler optimizations from src/Makefile to prevent
+          crashes on Fedora and Debian Unstable branches.
+        - If Allegro cannot be initialized, the game now
+          exits with a return code of 1.
+
+
+============ Atanks-5.7 released ==============
+
+    - Added new tank type, the Mini, provided by Daniel.
+    - Added patch from Fabian Greffrath to fix crashes
+      when Atanks is compiled using GCC 4.7. This patch
+      makes menu entries on the Options menu static variables.
+      Closes Debian bug #691107.
+
+
+============ Atanks-5.6 released ==============
+
+    - Updated icon file and COPYING file. Thanks to
+      Cristian for pointing out the problems with these files.
+
+    - Code clean-up to make game safer without threads/sockets.
+      Try to avoid memory errors in networked games.
+      Atanks now builds cleanly with clang++ compiler.
+
+    - Code clean-up to allow Atanks to compile on Windows.
+      We check to make sure pthread code is not included
+      where THREADS is not defined.
+
+    - Removed unneeded parameter from Tank class's
+      applyPhysics function. Was causing compiler warnings.
+
+============ Atanks-5.5 released ==============
+
 May 17, 2012
     - Fixed typos in makefiles in src directory.
       Thanks to Ville for submitting this patch.
 
 
+============ Atanks-5.4 released ==============
+
 April 8, 2012
 
     - Updated Portuguese language files in text folder.
diff --git a/Makefile b/Makefile
index 34bc2ad..4092015 100644
--- a/Makefile
+++ b/Makefile
@@ -1,4 +1,4 @@
-VERSION=5.5
+VERSION=6.0
 PREFIX ?= /usr/
 DESTDIR ?= 
 BINPREFIX = $(PREFIX)
@@ -64,6 +64,12 @@ clean:
 
 dist: source-dist i686-dist win32-dist
 
+tarball: clean
+	cd .. && tar czf atanks-$(VERSION).tar.gz atanks-$(VERSION)
+
+zipfile: clean
+	cd .. && zip -r atanks-$(VERSION)-source.zip atanks-$(VERSION)
+
 source-dist:
 	cd ../; \
 	rm -f ${FILENAME}.tar.gz; \
diff --git a/README b/README
index 245912c..1239007 100644
--- a/README
+++ b/README
@@ -43,11 +43,11 @@ To compile Atomic Tanks, please make sure you have
 the Allegro libraries installed (see above). Next,
 open a command console (shell) and move into the
 directory containing the Atomic Tanks package.
-This file will probably be named "atanks-5.5.tar.gz".
+This file will probably be named "atanks-5.6.tar.gz".
 Then run the following commands:
 
-tar zxf atanks-5.5.tar.gz
-cd atanks-5.5
+tar zxf atanks-6.0.tar.gz
+cd atanks-6.0
 
 Now it depends on your preferences:
 
@@ -172,6 +172,8 @@ ESC -- Cancel out of a menu.
 F10 -- Tells the computer to take over your tank for the remainder of the round.
        Also saves games when on the buying screen.
 
+V, v -- The "v" key controls the volume during matches. Pressing lower-case "v"
+        decreases the volume and upper-case "V" increases the volume.
 
 
 
diff --git a/README_ru.txt b/README_ru.txt
index afdb03a..2642b52 100644
--- a/README_ru.txt
+++ b/README_ru.txt
@@ -46,12 +46,12 @@ Atomic Tanks, загляните в следующий раздел, описы
 После этого откройте командную консоль (shell, bash, etc)
 и перейдите в директорию, в которой находится архив
 с исходниками Atomic Tanks.
-Архив версии 5.5 называется "atanks-5.5.tar.gz".
+Архив версии 6.0 называется "atanks-6.0.tar.gz".
 
 После этого выполните следующие команды:
 
-tar zxf atanks-5.5.tar.gz
-cd atanks-5.5
+tar zxf atanks-6.0.tar.gz
+cd atanks-6.0
 
 
 
diff --git a/TODO b/TODO
index 62e7f68..05f7dc5 100644
--- a/TODO
+++ b/TODO
@@ -2,18 +2,34 @@ There is now some small attempt at prioritisation in this file,
 higher priority stuff should be at the top of the file, 
 lower priority at the bottom. It is currently only vaguely correct.
 
-   	- Field repair kit: Spend a turn to repair your tank rather than fire.           Limited uses, heals more than Auto Repair Kit 
-	- Radar resistant missile: A missile designed to avoid the missile 
-          defence system by masking its heat signature 
-          Yield: Large missile
-	- Better AI against tanks with SDI.
+	Bugs:
+	- Player options can become scrambled
+          if accessed too often.
+	- Wrap around ceiling should not destroy projectile.
 	- Make sure network client doesn't get
           unlimited shots.
+	- Atanks crashes when Windows players click the Network option
+          in the main Options menu.
+	- When cycling through tanks on Players screen,
+	  the old tank does not get erased.
+
+
+	Features:
+	- Add scroll bar to buying screen.
+	- Add randomize button to buying screen to have
+	  items automatically purchased.
+
+   	- Field repair kit: Spend a turn to repair your tank 
+          rather than fire.           
+          Limited uses, heals more than Auto Repair Kit 
+	- Radar resistant missile: A missile designed to 
+          avoid the missile defence system by masking 
+          its heat signature 
+          Yield: Large missile
+	- Better AI against tanks with SDI.
 	- Update client ground surface more often.
 	- When switching languages, player menu should display correct text.
 	- Client needs a buying screen.
-	- Atanks crashes when Windows players click the Network option
-          in the main Options menu.
 	- Make tank size variable.
 	- Add rocks as semi-destructable items.
 
@@ -26,12 +42,6 @@ lower priority at the bottom. It is currently only vaguely correct.
 
 ===============================================
 
-	-- It's different in ATanks because I'm assuming it would require more hard coding to use a mouse like they do in Worms to place a girder. 
-
-So in our case, you would treat the missile for the floating dirt as any weapon projectile initially. You can set the angle+power for firing the weapon, except the explosion would be based on time if there is no collision with a wall/floor. 
-
-Say for example the player sets the power at 2000 that would mean throwing the projectile with max strength 5s projectile flight before solidifying into empty space. Setting a power of 0 would mean the player sets 0 time and doesn't fire anywhere before the block becomes dirt thus locking themself into a circular patch of dirt.
-
 
         -- under ground mines
 
diff --git a/atanks.desktop b/atanks.desktop
index 69454ae..730e578 100644
--- a/atanks.desktop
+++ b/atanks.desktop
@@ -4,7 +4,7 @@ Comment=Destroy your opponents' tanks.
 Comment[es]=Destruye los tanques de tus oponentes.
 Type=Application
 Exec=atanks
-Icon=atanks.png
+Icon=atanks
 Categories=Game;ArcadeGame;
 Terminal=false
 
diff --git a/src/Makefile b/src/Makefile
index 608dc68..e2aa5a1 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -4,10 +4,11 @@ MODULES = atanks.o beam.o button.o environment.o explosion.o fade.o files.o glob
           missile.o perlin.o physobj.o player.o satellite.o sky.o tank.o team.o teleport.o virtobj.o \
           update.o network.o floattext.o land.o text.o client.o gameloop.o
 
+CXX?=clang++
 LIB=ar
 WINDRES=
 # FLAGS += -DDATA_DIR=\".\" -Wno-write-strings -DNETWORK -DTHREADS
-FLAGS += -DDATA_DIR=\"${INSTALLDIR}\" -DNEW_GAMELOOP -Wno-write-strings -DNETWORK -DTHREADS -pthread
+FLAGS += -DDATA_DIR=\"${INSTALLDIR}\" -DNEW_GAMELOOP -Wno-write-strings -DNETWORK -DTHREADS -pthread -Wextra -pedantic -ggdb3
 OUTPUT = ../atanks
 WFLAGS = 
 OFLAGS = 
diff --git a/src/Makefile.bsd b/src/Makefile.bsd
index 37dfa4f..e07dc3c 100644
--- a/src/Makefile.bsd
+++ b/src/Makefile.bsd
@@ -4,9 +4,9 @@ MODULES = atanks.o beam.o button.o environment.o explosion.o fade.o files.o glob
           missile.o perlin.o physobj.o player.o satellite.o sky.o tank.o team.o teleport.o virtobj.o \
           update.o network.o floattext.o land.o text.o client.o gameloop.o
 
-CPP=g++
-CC=gcc
-LD=g++
+CPP=clang++
+CC=clang
+LD=clang++
 LIB=ar
 WINDRES=
 # FLAGS += -DDATA_DIR=\".\" -Wno-write-strings -DNETWORK -DTHREADS
diff --git a/src/atanks.cpp b/src/atanks.cpp
index 81403ce..c434666 100644
--- a/src/atanks.cpp
+++ b/src/atanks.cpp
@@ -79,7 +79,9 @@ void fpsadd()
   frames = 0;
 }
 
+#ifdef THREADS
 pthread_mutex_t* cclock_lock;
+#endif
 void destroy_cclock_lock() {
   #ifdef THREADS
   if (cclock_lock)
@@ -537,7 +539,7 @@ void newgame (GLOBALDATA *global, ENVIRONMENT *env)
 
 
 // This function draws the background for most screens
-int draw_circlesBG (GLOBALDATA *global, BITMAP *dest, int x, int y, int width, int height, bool image)
+int draw_circlesBG (GLOBALDATA *global, BITMAP *dest, int /*x*/, int /*y*/, int /*width*/, int /*height*/, bool image)
 {
   // int largestCircle, circleCount;
   // BITMAP *drawTo = dest;
@@ -604,7 +606,7 @@ ENVIRONMENT *init_game_settings (GLOBALDATA *global)
   if (status)
   {
     printf("Unable to start Allegro.\n");
-    return NULL;
+    exit(1);
   }
 
   set_window_title( "Atomic Tanks");
@@ -1006,6 +1008,7 @@ int displayPlayerName (ENVIRONMENT *env, int x, int y, void *data)
 int options (GLOBALDATA *global, ENVIRONMENT *env, MENUDESC *menu)
 {
   MENUENTRY *opts;
+  char my_pointer[2];
   BUTTON *reset_button = NULL;
   int selected_index = 0, my_key = 0;
   int numEntries;
@@ -1038,8 +1041,8 @@ int options (GLOBALDATA *global, ENVIRONMENT *env, MENUDESC *menu)
   numEntries = menu->numEntries;
   title = menu->title;
 
-  char name_buff[64];
-  char format_buff[64];
+  char name_buff[64] = {0x0};
+  char format_buff[64] = {0x0};
   int done, lb;
   int stop = 0;
 
@@ -1313,7 +1316,6 @@ int options (GLOBALDATA *global, ENVIRONMENT *env, MENUDESC *menu)
             {
               int midX = opts[z].x;
               int midY = opts[z].y;
-              char my_pointer[2];
 
               if (z == selected_index)
                   strcpy(my_pointer, "*");
@@ -1791,7 +1793,7 @@ void title (GLOBALDATA *global)
 
 int menu (GLOBALDATA *global, ENVIRONMENT *env)
 {
-  int bf, bfdd, ban, anclock, lb, updateplayers, done, updaterounds, z, zz;
+  int ban, anclock, lb, updateplayers, done, updaterounds, z;
   int move_text;
   int seconds_idle = 0;
   int current_index = 0, max_index = 7;
@@ -1850,7 +1852,6 @@ int menu (GLOBALDATA *global, ENVIRONMENT *env)
           lock_cclock();
           cclock--;
           unlock_cclock();
-          zz = 0;
           for (z = 0; z < MENUBUTTONS; z++)
             {
               if (button[z]->isMouseOver ())
@@ -1861,15 +1862,9 @@ int menu (GLOBALDATA *global, ENVIRONMENT *env)
                       //env->make_update (button[ban]->location.x, button[ban]->location.y, button[ban]->location.w, button[ban]->location.h);
                     }
                   ban = z;
-                  zz = 1;
                   break;
                 }
             }
-          if (!zz)
-            {
-              bf = 0;
-              bfdd = 1;
-            }
           if (!lb && mouse_b & 1)
             env->mouseclock = 0;
           lb = (mouse_b & 1) ? 1 : 0;
@@ -2189,7 +2184,6 @@ void draw_weapon_list(GLOBALDATA *global, ENVIRONMENT *env, PLAYER *pl, int *tro
 bool buystuff (GLOBALDATA *global, ENVIRONMENT *env)
 {
   int pl, done; 
-  int updatew[THINGS];
   int updatename, pressed, scroll, lb, lastMouse_b;
   int hoverOver = 0, z, zz, zzz;
   char buf[50];
@@ -2432,8 +2426,6 @@ bool buystuff (GLOBALDATA *global, ENVIRONMENT *env)
 
       draw_buystuff (global, env, global->players[pl]);
 
-      for (z = 0; z < THINGS; z++)
-        updatew[z] = 1;
       while (!done)
         {
 
@@ -2469,8 +2461,6 @@ bool buystuff (GLOBALDATA *global, ENVIRONMENT *env)
                      item_index--;
                   if (scroll > 1)
                      scroll--;
-                  for (z = 0; z < THINGS; z++)
-                    updatew[z] = 1;
                 }
               if (my_key == KEY_PGUP || my_key == KEY_R) // && (scroll > 1)
                   // && (!env->mouseclock))
@@ -2481,8 +2471,6 @@ bool buystuff (GLOBALDATA *global, ENVIRONMENT *env)
                   scroll -= btps / 2;
                   if (scroll < 1)
                     scroll = 1;
-                  for (z = 0; z < THINGS; z++)
-                    updatew[z] = 1;
                 }
 
               if (my_key == KEY_DOWN || my_key == KEY_S)
@@ -2493,8 +2481,6 @@ bool buystuff (GLOBALDATA *global, ENVIRONMENT *env)
                      item_index++;
                  if (scroll <= env->numAvailable - btps)
                      scroll++;
-                  for (z = 0; z < THINGS; z++)
-                    updatew[z] = 1;
                 }
               if ((my_key == KEY_PGDN || my_key == KEY_F)
                   && (scroll <= env->numAvailable - btps + 1) )
@@ -2506,8 +2492,6 @@ bool buystuff (GLOBALDATA *global, ENVIRONMENT *env)
                   scroll += btps / 2;
                   if (scroll > env->numAvailable - btps + 1)
                     scroll = env->numAvailable - btps + 1;
-                  for (z = 0; z < THINGS; z++)
-                    updatew[z] = 1;
                 }
 
               // make sure the selected item is on the visible screen
@@ -2644,8 +2628,6 @@ bool buystuff (GLOBALDATA *global, ENVIRONMENT *env)
                     scroll = env->numAvailable - btps + 1;
                   if (scroll > item_index)
                      item_index = scroll;
-                  for (z = 0; z < THINGS; z++)
-                    updatew[z] = 1;
                 }
               else if (mouse_wheel_current > mouse_wheel_previous)
                 {
@@ -2654,8 +2636,6 @@ bool buystuff (GLOBALDATA *global, ENVIRONMENT *env)
                     scroll = 1;
                   if (item_index > scroll + btps)
                      item_index = scroll + btps - 3;
-                  for (z = 0; z < THINGS; z++)
-                    updatew[z] = 1;
                 }
               mouse_wheel_previous = mouse_wheel_current;
 
@@ -2724,28 +2704,20 @@ bool buystuff (GLOBALDATA *global, ENVIRONMENT *env)
                           scroll -= btps / 2;
                           if (scroll < 1)
                             scroll = 1;
-                          for (z = 0; z < THINGS; z++)
-                            updatew[z] = 1;
                         }
                       if ((mouse_y >= global->halfHeight - 24 && mouse_y < global->halfHeight) && (scroll > 1))
                         {
                           scroll--;
-                          for (z = 0; z < THINGS; z++)
-                            updatew[z] = 1;
                         }
                       if ((mouse_y >= global->halfHeight + 1 && mouse_y < global->halfHeight + 25) && (scroll <= env->numAvailable - btps))
                         {
                           scroll++;
-                          for (z = 0; z < THINGS; z++)
-                            updatew[z] = 1;
                         }
                       if ((mouse_y >= global->halfHeight + 25 && mouse_y < global->halfHeight + 50) && (scroll <= env->numAvailable - btps + 1))
                         {
                           scroll += btps / 2;
                           if (scroll > env->numAvailable - btps + 1)
                             scroll = env->numAvailable - btps + 1;
-                          for (z = 0; z < THINGS; z++)
-                            updatew[z] = 1;
                         }
                     }
                     if (item_index < scroll)
@@ -2762,16 +2734,11 @@ bool buystuff (GLOBALDATA *global, ENVIRONMENT *env)
                         {
                           itemButtonClicked = 1;
                           // Remember which button was pressed
-                          if (pressed > -1)
-                            updatew[pressed] = 1;
                           pressed = env->availableItems[currItem];
-                          updatew[env->availableItems[currItem]] = 1;
                         }
                     }
                   if (!itemButtonClicked)
                     {
-                      if (pressed > -1)
-                        updatew[pressed] = 1;
                       pressed = -1;
                     }
                 }
@@ -2781,7 +2748,6 @@ bool buystuff (GLOBALDATA *global, ENVIRONMENT *env)
                   // of pressed item
                   // int cost,amt,inInv;
                   bool control_key = false;
-                  updatew[pressed] = 1;
 
                   if ( ( key[KEY_LCONTROL] ) || ( key[KEY_RCONTROL] ) )
                     control_key = true;
@@ -2858,11 +2824,6 @@ bool buystuff (GLOBALDATA *global, ENVIRONMENT *env)
               lastMouse_b = mouse_b;
             }
           if (! global->os_mouse) show_mouse (NULL);
-          if (fi)
-            {
-              for (int thing = 0; thing < THINGS; thing++)
-                updatew[thing] = 1;
-            }
           if (updatename)
             {
               updatename = 0;
@@ -3581,7 +3542,7 @@ int setSlideColumnDimensions (GLOBALDATA *global, ENVIRONMENT *env, int x, bool
   else
     {
       if (velocity[x])
-        play_sample ((SAMPLE *) global->sounds[10], (int)((velocity[x] / 10) * 255), (int)((double)(x - global->halfWidth) / global->halfWidth * 128 + 128), 1000 - (int)((double)fp[x] / global->screenHeight) * 1000, 0);
+        play_sample ((SAMPLE *) global->sounds[10], env->scaleVolume((velocity[x] / 10) * 255), (int)((double)(x - global->halfWidth) / global->halfWidth * 128 + 128), 1000 - (int)((double)fp[x] / global->screenHeight) * 1000, 0);
       h[x] = 0;
       fp[x] = 0;
       done[x] = 1;
@@ -5184,7 +5145,9 @@ int main (int argc, char **argv)
   int menu_action;
   int playerCount, player_index;
   #ifdef NETWORK
+  #ifdef THREADS
   SEND_RECEIVE_TYPE *send_receive = NULL;
+  #endif
   int client_socket = -1;
   #endif
   bool allow_network = true, allow_thread = false;
@@ -6154,7 +6117,7 @@ int Game_Client(GLOBALDATA *global, ENVIRONMENT *env, int socket_number)
         {
              if ( (global->players[count]) && (global->players[count]->tank) )
              {
-                global->players[count]->tank->draw(env->db, 0);
+                global->players[count]->tank->drawTank(env->db, 0);
                 global->players[count]->tank->update();
              }
         }
diff --git a/src/beam.cpp b/src/beam.cpp
index 8cba4ef..c7e768e 100644
--- a/src/beam.cpp
+++ b/src/beam.cpp
@@ -102,7 +102,7 @@ BEAM::BEAM (GLOBALDATA *global, ENVIRONMENT *env, double xpos, double ypos, int
       maxAge = 10 * (type - SML_LIGHTNING + 1);
       numPoints = 4 + rand () % 10;
       color = WHITE;
-      play_sample ((SAMPLE *) _global->sounds[LIGHTNING_SOUND], 128 + (radius * 10), 128, 500 + (radius * 50), 0);
+      play_sample ((SAMPLE *) _global->sounds[LIGHTNING_SOUND], env->scaleVolume(128 + (radius * 10)), 128, 500 + (radius * 50), 0);
     }
   else
     {
diff --git a/src/button.cpp b/src/button.cpp
index fcd2da9..ff845ad 100644
--- a/src/button.cpp
+++ b/src/button.cpp
@@ -29,7 +29,7 @@ BUTTON::BUTTON(GLOBALDATA *global, ENVIRONMENT *env, int x1, int y1,
 
 void BUTTON::draw (BITMAP *dest)
 {
-  draw_sprite (dest, (BITMAP *)(isMouseOver())?((isPressed())?depressed:hover):bmp, location.x, location.y);
+  draw_sprite (dest, (BITMAP *)(isMouseOver()?(isPressed()?depressed:hover):bmp), location.x, location.y);
   if (text)
     textout_centre_ex (dest, font, text, location.x+75, location.y + 6, WHITE, -1);
   _env->make_update (location.x, location.y, xl, yl);
@@ -56,7 +56,7 @@ int BUTTON::isPressed()
 {
   if ((mouse_b == 1) && isMouseOver ())
     {
-      play_sample (click, 128, 128, 1000, 0);
+      play_sample (click, _env->scaleVolume(128), 128, 1000, 0);
       return 1;
     }
   else
diff --git a/src/client.cpp b/src/client.cpp
index c060e69..bd2eb68 100644
--- a/src/client.cpp
+++ b/src/client.cpp
@@ -80,12 +80,11 @@ int Parse_Client_Data(GLOBALDATA *global, ENVIRONMENT *env, char *buffer)
    {
       double my_x, my_y;
       int my_angle, my_type;
-      BEAM *new_beam;
       sscanf(args[1], "%lf", &my_x);
       sscanf(args[2], "%lf", &my_y);
       sscanf(args[3], "%d", &my_angle);
       sscanf(args[4], "%d", &my_type);
-      new_beam = new BEAM(global, env, my_x, my_y, my_angle, my_type);
+      new BEAM(global, env, my_x, my_y, my_angle, my_type);
    }
    else if (! strcmp(args[0], "BOXED"))
    {
@@ -101,11 +100,10 @@ int Parse_Client_Data(GLOBALDATA *global, ENVIRONMENT *env, char *buffer)
    {
         double my_x, my_y;
         int my_type;
-        EXPLOSION *explosion;
         sscanf(args[1], "%lf", &my_x);
         sscanf(args[2], "%lf", &my_y);
         sscanf(args[3], "%d", &my_type);
-        explosion = new EXPLOSION(global, env, my_x, my_y, my_type);
+        new EXPLOSION(global, env, my_x, my_y, my_type);
         return FALSE;
    }
    else if (! strcmp(args[0], "ITEM"))
@@ -306,7 +304,6 @@ int Parse_Client_Data(GLOBALDATA *global, ENVIRONMENT *env, char *buffer)
    {
        int player_num;
        int new_x, new_y;
-       TELEPORT *my_teleport;
 
        sscanf(args[1], "%d", &player_num);
        sscanf(args[2], "%d", &new_x);
@@ -314,8 +311,8 @@ int Parse_Client_Data(GLOBALDATA *global, ENVIRONMENT *env, char *buffer)
        if ( (player_num >= 0) && (player_num < global->numPlayers) &&
             (global->players[player_num]->tank) )
        {
-          my_teleport = new TELEPORT(global, env, global->players[player_num]->tank,
-                            new_x, new_y, TANKHEIGHT * 4 + GUNLENGTH, 120);
+          new TELEPORT(global, env, global->players[player_num]->tank,
+                       new_x, new_y, TANKHEIGHT * 4 + GUNLENGTH, 120);
        }
            
    }
diff --git a/src/environment.cpp b/src/environment.cpp
index 132069a..2a96f50 100644
--- a/src/environment.cpp
+++ b/src/environment.cpp
@@ -73,10 +73,13 @@ ENVIRONMENT::ENVIRONMENT (GLOBALDATA *global):_global(global),done(NULL),fp(NULL
   waiting_terrain = NULL;
   _global = global;
   global_tank_index = 0;
+  volume_factor = MAX_VOLUME_FACTOR;
 
   initialise ();
+  #ifdef THREADS
   waiting_sky_lock = init_lock(waiting_sky_lock);
   waiting_terrain_lock = init_lock(waiting_terrain_lock);
+  #endif
 }
 
 
@@ -89,8 +92,10 @@ ENVIRONMENT::~ENVIRONMENT()
 {
   int count;
 
+  #ifdef THREADS
   destroy_lock(waiting_sky_lock);
   destroy_lock(waiting_terrain_lock);
+  #endif
 
   if (db)      destroy_bitmap(db);      db      = NULL;
   if (sky)     destroy_bitmap(sky);     sky     = NULL;
@@ -117,8 +122,8 @@ ENVIRONMENT::~ENVIRONMENT()
      free(bitmap_filenames);
   }
 }
+#ifdef THREADS
 void ENVIRONMENT::destroy_lock(pthread_mutex_t* lock) {
-  #ifdef THREADS
   if (lock)
   {
     int result = pthread_mutex_destroy(lock);
@@ -141,10 +146,10 @@ void ENVIRONMENT::destroy_lock(pthread_mutex_t* lock) {
     }
     free(lock);
   }
-  #endif
 }
+#endif
+#ifdef THREADS
 pthread_mutex_t* ENVIRONMENT::init_lock(pthread_mutex_t* lock) {
-  #ifdef THREADS
   lock = (pthread_mutex_t*) malloc(sizeof(pthread_mutex_t));
   if (!lock)
   {
@@ -176,12 +181,12 @@ pthread_mutex_t* ENVIRONMENT::init_lock(pthread_mutex_t* lock) {
       printf("%s:%i: Unknown error code (%i) returned by pthread_mutex_init.\n", __FILE__, __LINE__, result);
       break;
   }
-  #endif
   return lock;
 }
+#endif
+#ifdef THREADS
 void ENVIRONMENT::lock(pthread_mutex_t* lock)
 {
-  #ifdef THREADS
   int result = pthread_mutex_lock(lock);
   switch (result)
   {
@@ -204,11 +209,11 @@ void ENVIRONMENT::lock(pthread_mutex_t* lock)
       printf("%s:%i: Unknown error code (%i) returned by pthread_mutex_lock.\n", __FILE__, __LINE__, result);
       break;
   }
-  #endif
 }
+#endif
+#ifdef THREADS
 void ENVIRONMENT::unlock(pthread_mutex_t* lock)
 {
-  #ifdef THREADS
   int result = pthread_mutex_unlock(lock);
   switch (result)
   {
@@ -228,20 +233,28 @@ void ENVIRONMENT::unlock(pthread_mutex_t* lock)
       printf("%s:%i: Unknown error code (%i) returned by pthread_mutex_unlock.\n", __FILE__, __LINE__, result);
       break;
   }
-  #endif
 }
+#endif
 BITMAP* ENVIRONMENT::get_waiting_sky()
 {
+  #ifdef THREADS
   lock(waiting_sky_lock);
+  #endif
   BITMAP* w = waiting_sky;
+  #ifdef THREADS
   unlock(waiting_sky_lock);
+  #endif
   return w;
 }
 BITMAP* ENVIRONMENT::get_waiting_terrain()
 {
+  #ifdef THREADS
   lock(waiting_terrain_lock);
+  #endif
   BITMAP* w = waiting_terrain;
+  #ifdef THREADS
   unlock(waiting_terrain_lock);
+  #endif
   return w;
 }
 /*
@@ -1166,3 +1179,20 @@ TANK *ENVIRONMENT::Get_Next_Tank(int *wrapped_around)
    return order[index];
 }
 
+void ENVIRONMENT::increaseVolume()
+{
+  if (volume_factor < MAX_VOLUME_FACTOR)
+    ++volume_factor;
+}
+
+void ENVIRONMENT::decreaseVolume()
+{
+  if (volume_factor > 0)
+    --volume_factor;
+}
+
+int ENVIRONMENT::scaleVolume(int vol) const
+{
+    return (vol * volume_factor) / MAX_VOLUME_FACTOR;
+}
+
diff --git a/src/environment.h b/src/environment.h
index f14f0aa..f4fe553 100644
--- a/src/environment.h
+++ b/src/environment.h
@@ -77,6 +77,9 @@ enum wallTypes
 #define _GET_G(x) ((x & 0x00ff00) >> 8)
 #define _GET_B(x) (x & 0x0000ff)
 
+// max volume factor: means that the interval 0% -> 100% is splitted in 5
+#define MAX_VOLUME_FACTOR 5
+
 #include "tank.h"
 //class TANK;
 //class MISSILE;
@@ -115,12 +118,14 @@ class ENVIRONMENT
     double	*height;
     BITMAP	*db, *terrain, *sky;
     BITMAP *waiting_sky, *waiting_terrain;     // sky saved in background
+    #ifdef THREADS
     pthread_mutex_t* waiting_terrain_lock;
     pthread_mutex_t* waiting_sky_lock;
     void destroy_lock(pthread_mutex_t* lock);
     pthread_mutex_t* init_lock(pthread_mutex_t* lock);
     void lock(pthread_mutex_t* lock);
     void unlock(pthread_mutex_t* lock);
+    #endif
     BITMAP* get_waiting_sky();
     BITMAP* get_waiting_terrain();
     const gradient **my_sky_gradients, **my_land_gradients;
@@ -140,6 +145,8 @@ class ENVIRONMENT
     int number_of_bitmaps;
     int current_drawing_mode;
     int global_tank_index;
+    int volume_factor;  // from 0 (no volume) to MAX_VOLUME_FACTOR
+
 
     ENVIRONMENT (GLOBALDATA *global);
     ~ENVIRONMENT ();
@@ -174,6 +181,9 @@ class ENVIRONMENT
     void Set_Wall_Colour();
     bool Get_Boxed_Mode(GLOBALDATA *global);
     TANK *Get_Next_Tank(int *wrapped_around);
+    void increaseVolume();
+    void decreaseVolume();
+    int scaleVolume(int vol) const;
   };
 
 #endif
diff --git a/src/files.cpp b/src/files.cpp
index a7074ce..cca9dc4 100644
--- a/src/files.cpp
+++ b/src/files.cpp
@@ -97,7 +97,7 @@ The function returns TRUE on success and
 FALSE is an error occures.
 -- Jesse
 */
-int Load_Game(GLOBALDATA *global, ENVIRONMENT *env)
+int Load_Game(GLOBALDATA *global, ENVIRONMENT * /*env*/)
 {
   char line[512];
   char *field, *value;
@@ -386,14 +386,13 @@ void renderTextLines (GLOBALDATA *global, ENVIRONMENT *env,
   const int textheight_s = textheight * spacing ;
   int yOffset = scrollOffset;
   char *text;
-  int tLen, count;
+  int count;
 
   for (count = 0;
        (count < lines->total_lines) && (yOffset < global->screenHeight);
        count++)
     {
       text = lines->complete_text[count];
-      tLen = text_length (fnt, text);
 
           textout_centre_ex (env->db, fnt, text,
                              global->halfWidth + 2, global->halfHeight + yOffset + 2, BLACK, -1);
@@ -1089,6 +1088,10 @@ int Display_Tank_Bitmap(ENVIRONMENT *env, int xpos, int ypos, void *image_number
           use_tank_bitmap = 15;
           use_turret_bitmap = 8;
           break;
+        case MINI_TANK:
+          use_tank_bitmap = 16;
+          use_turret_bitmap = 8;
+          break;
         default:
           use_tank_bitmap = 0;
           use_turret_bitmap = 0;
diff --git a/src/floattext.cpp b/src/floattext.cpp
index 94ad909..2c15452 100644
--- a/src/floattext.cpp
+++ b/src/floattext.cpp
@@ -15,7 +15,7 @@ FLOATTEXT::FLOATTEXT (GLOBALDATA *global, ENVIRONMENT *env, char *text, int xpos
       if (text)
         set_text (text);
       else
-        set_text( "");
+        set_text(NULL);
       set_color (color);
       _align = alignment;
       _global = global;
@@ -108,7 +108,11 @@ void FLOATTEXT::setEnvironment(ENVIRONMENT *env)
 
 
 void FLOATTEXT::draw(BITMAP *dest)
-  {
+{
+      // If there is no text then we have nothing to draw
+      if (! _text)
+         return;
+
       if (_current.w)
         {
           double dFrontFade		=	1.0;
@@ -187,32 +191,23 @@ void FLOATTEXT::draw(BITMAP *dest)
 }
 
 
-/*
-This is too limiting, creating a more flexible text setting function below.
--- Jesse
-void FLOATTEXT::set_text(char *text)
- {
-      strncpy (_text, text, 80);
-      if (strlen (text) > 0)
-        {
-          _current.w = text_length (font, _text) + 3;
-          _text[79] = '\0';
-        }
-      else
-        _current.w = 0;
-      _current.h = text_height (font) + 15;
-}
-*/
 
 // Returns TRUE on success or FALSE on failure.
 int FLOATTEXT::set_text(char *text)
 {
-   int my_length = strlen(text);
+   // int my_length = strlen(text);
+   int my_length;
 
    // clean up old text
    if (_text)
+   {
       free(_text);
-    
+      _text = NULL;
+   }
+   if (! text)
+      return TRUE;
+
+   my_length = strlen(text);
    _text = (char *) calloc( my_length + 1, sizeof(char));
    if (! _text)
       return FALSE;
diff --git a/src/gameloop.cpp b/src/gameloop.cpp
index 3b0ec55..943debc 100644
--- a/src/gameloop.cpp
+++ b/src/gameloop.cpp
@@ -39,7 +39,7 @@ int game (GLOBALDATA *global, ENVIRONMENT *env)
     int count;
     int winner = -1, done = FALSE;
     int stuff_happening = FALSE;
-    int AI_clock;
+    int AI_clock = 0;
     int fire = FALSE;
     int roundEndCount = 0;
     int game_speed = (int) global->frames_per_second * GAME_SPEED / 60;
@@ -192,7 +192,6 @@ int game (GLOBALDATA *global, ENVIRONMENT *env)
             else if (my_class == MISSILE_CLASS)
             {
               TANK *shooting_tank = NULL;
-              BEAM *defense_beam;
               int angle_to_fire;
 
               missile = (MISSILE *) my_object;
@@ -206,7 +205,7 @@ int game (GLOBALDATA *global, ENVIRONMENT *env)
               {
                   // (shooting_tank->x < missile->x) ? angle_to_fire = 135 : angle_to_fire = 225;
                   angle_to_fire = atan2(labs(shooting_tank->y - 10 - missile->y), (missile->x - shooting_tank->x)) * 180 / 3.14159265 + 90;
-                  defense_beam = new BEAM(global, env, shooting_tank->x, shooting_tank->y - 10, angle_to_fire, SML_LAZER);
+                  new BEAM(global, env, shooting_tank->x, shooting_tank->y - 10, angle_to_fire, SML_LAZER);
                   missile->trigger();
               }
               if (missile->destroy)
@@ -278,7 +277,7 @@ int game (GLOBALDATA *global, ENVIRONMENT *env)
 
            // update position
            a_tank->pen = 0;
-           a_tank->applyPhysics(global);
+           a_tank->applyPhysics();
 
            if ( (a_tank->l <= 0) && (! explosion_in_progress) )    // dead tank
            {
@@ -393,14 +392,14 @@ int game (GLOBALDATA *global, ENVIRONMENT *env)
               if ( my_tank == global->players[count]->tank )
               {
                  text_bounce += text_delta;
-                 global->players[count]->tank->draw(env->db, text_bounce / 4);
+                 global->players[count]->tank->drawTank(env->db, text_bounce / 4);
                  if ( (text_bounce > MAX_TEXT_BOUNCE) ||
                       (text_bounce < 1) )
                     text_delta = -text_delta;
               }
                  
               else
-                 global->players[count]->tank->draw(env->db, 0);
+                 global->players[count]->tank->drawTank(env->db, 0);
               global->players[count]->tank->update();
            }
         }
diff --git a/src/globaldata.cpp b/src/globaldata.cpp
index 9014a03..1f665fc 100644
--- a/src/globaldata.cpp
+++ b/src/globaldata.cpp
@@ -29,6 +29,7 @@ GLOBALDATA::GLOBALDATA ():dataDir(NULL),configDir(NULL),updates(NULL),lastUpdate
 {
   init_curland_lock();
 
+  #ifdef THREADS
   command_lock = (pthread_rwlock_t*) malloc(sizeof(pthread_rwlock_t));
   if (command_lock == NULL)
   {
@@ -58,6 +59,7 @@ GLOBALDATA::GLOBALDATA ():dataDir(NULL),configDir(NULL),updates(NULL),lastUpdate
        printf("%s:%i: Unknown error code (%i) returned by pthread_rwlock_init.\n", __FILE__, __LINE__, result);
        break;
   }
+  #endif
   tank_status = (char *)calloc(128, sizeof(char));
   if (!tank_status)
     {
@@ -222,6 +224,8 @@ GLOBALDATA::~GLOBALDATA()
   if (kamikaze) delete kamikaze;
   if (suicide) delete suicide;
   if (allPlayers) free(allPlayers);
+  if (update_string) free(update_string);
+  #ifdef THREADS
   if (command_lock)
   {
     int result = pthread_rwlock_destroy(command_lock);
@@ -246,6 +250,7 @@ GLOBALDATA::~GLOBALDATA()
     free(command_lock);
   }
   destroy_curland_lock();
+  #endif
 }
 //Destroys curland_lock and frees it. If the lock is NULL or an error occurs, a diagnostic message will be printed.
 void GLOBALDATA::destroy_curland_lock() {
diff --git a/src/globaldata.h b/src/globaldata.h
index 0227d08..020b00b 100644
--- a/src/globaldata.h
+++ b/src/globaldata.h
@@ -94,7 +94,9 @@ class GLOBALDATA
 
     PLAYER	**allPlayers;
     int	numPermanentPlayers;
+    #ifdef THREADS
     pthread_rwlock_t* command_lock;
+    #endif
     void wr_lock_command ();
     void unlock_command ();
     int get_command ();
@@ -117,8 +119,9 @@ class GLOBALDATA
     void lock_curland();
     void destroy_curland_lock();
     void init_curland_lock();
+    #ifdef THREADS
     pthread_mutex_t* curland_lock;
-
+    #endif
     int	colourDepth;
     int	screenWidth, screenHeight;
     int menuBeginY, menuEndY;
diff --git a/src/main.h b/src/main.h
index 9f92836..591cdda 100644
--- a/src/main.h
+++ b/src/main.h
@@ -21,7 +21,7 @@
  * */
 
 #ifndef VERSION
-#define VERSION "5.5"
+#define VERSION "6.0"
 #endif
 
 #ifdef GENTOO
@@ -176,6 +176,7 @@ using namespace std;
 #define UFO_TANK 6
 #define SPIDER_TANK 7
 #define BIGFOOT_TANK 8
+#define MINI_TANK 9
 
 
 // background images
diff --git a/src/menucontent.h b/src/menucontent.h
index f3e93cf..04c6a17 100644
--- a/src/menucontent.h
+++ b/src/menucontent.h
@@ -122,7 +122,7 @@ MENUDESC mainMenu;
 
 if ( (global->language == LANGUAGE_ENGLISH) || (global->language == LANGUAGE_SPANISH) || (global->language == LANGUAGE_ITALIAN) )
   {
-    MENUENTRY physicsOpts[8] =
+    static MENUENTRY physicsOpts[8] =
     {
       { "Gravity", NULL, WHITE, &env->gravity, NULL, "%2.3f", .025, .325, 0.025, .075, NULL, OPTION_DOUBLETYPE, FALSE, global->halfWidth - 3, global->halfHeight - 80},
       { "Viscosity", NULL, WHITE, &env->viscosity, NULL, "%2.2f", .25, 2.0, 0.25, 1.0, NULL, OPTION_DOUBLETYPE, FALSE, global->halfWidth - 3, global->halfHeight - 60},
@@ -135,7 +135,7 @@ if ( (global->language == LANGUAGE_ENGLISH) || (global->language == LANGUAGE_SPA
     };
     MENUDESC physicsMenu = { "Physics", 8, physicsOpts, TRUE, FALSE};
 
-    MENUENTRY weatherOpts[7] =
+    static MENUENTRY weatherOpts[7] =
     {
       { "Meteor Showers", NULL, WHITE, &env->meteors, NULL, "%s", 0, 3, 1, 0, meteorText, OPTION_SPECIALTYPE, FALSE, global->halfWidth - 3, global->halfHeight - 68},
       { "Lightning", NULL, WHITE, &env->lightning, NULL, "%s", 0, 3, 1, 0, lightningText, OPTION_SPECIALTYPE, FALSE, global->halfWidth - 3, global->halfHeight - 48},
@@ -148,7 +148,7 @@ if ( (global->language == LANGUAGE_ENGLISH) || (global->language == LANGUAGE_SPA
     MENUDESC weatherMenu = { "Weather", 7, weatherOpts, TRUE, FALSE};
 
 
-    MENUENTRY soundOpts[3] =
+    static MENUENTRY soundOpts[3] =
     {
       { "All Sound", NULL, WHITE, &global->sound, NULL, "%s", 0, 1, 1, 1, onOffText, OPTION_SPECIALTYPE, FALSE, global->halfWidth - 3, global->halfHeight - 68},
       { "Sound Driver", NULL, WHITE, &global->sound_driver, NULL, "%s", 0, 5, 1, 0, soundDriver, OPTION_SPECIALTYPE, FALSE, global->halfWidth - 3, global->halfHeight - 48},
@@ -157,7 +157,7 @@ if ( (global->language == LANGUAGE_ENGLISH) || (global->language == LANGUAGE_SPA
    MENUDESC soundMenu = { "Sound", 3, soundOpts, TRUE, FALSE};
 
 
-    MENUENTRY graphicsOpts[12] =
+    static MENUENTRY graphicsOpts[12] =
     {
       { "Full Screen", NULL, WHITE, &global->full_screen, NULL, "%s", 0, 1, 1, 0, onOffText, OPTION_SPECIALTYPE, FALSE, global->halfWidth - 3, global->halfHeight - 108},
       { "Dithering", NULL, WHITE, &global->ditherGradients, NULL, "%s", 0, 1, 1, 1, onOffText, OPTION_SPECIALTYPE, FALSE, global->halfWidth - 3, global->halfHeight - 88},
@@ -174,7 +174,7 @@ if ( (global->language == LANGUAGE_ENGLISH) || (global->language == LANGUAGE_SPA
     };
     MENUDESC graphicsMenu = { "Graphics", 12, graphicsOpts, TRUE, FALSE};
 
-    MENUENTRY financeOpts[9] =
+    static MENUENTRY financeOpts[9] =
     {
       { "Starting Money", NULL, WHITE, (double*)&global->startmoney, NULL, "%2.0f", 0, 200000, 5000, 20000, NULL, OPTION_DOUBLETYPE, FALSE, global->halfWidth - 3, global->halfHeight - 68},
       { "Interest Rate", NULL, WHITE, (double*)&global->interest, NULL, "%2.2f", 1.0, 1.5, 0.05, 1.25, NULL, OPTION_DOUBLETYPE, FALSE, global->halfWidth - 3, global->halfHeight - 48},
@@ -188,7 +188,7 @@ if ( (global->language == LANGUAGE_ENGLISH) || (global->language == LANGUAGE_SPA
     };
     MENUDESC financeMenu = { "Money", 9, financeOpts, TRUE, FALSE};
 
-    MENUENTRY networkOpts[5] =
+    static MENUENTRY networkOpts[5] =
     {
        {  "Check Updates", NULL, WHITE, (double*) &global->check_for_updates, NULL, "%s", 0, 1, 1, 1, onOffText, OPTION_SPECIALTYPE, FALSE, global->halfWidth - 3, global->halfHeight - 48},
        {  "Networking", NULL, WHITE, (double*) &global->enable_network, NULL, "%s", 0, 1, 1, 1, onOffText, OPTION_SPECIALTYPE, FALSE, global->halfWidth - 3, global->halfHeight - 28},
@@ -205,7 +205,7 @@ if ( (global->language == LANGUAGE_ENGLISH) || (global->language == LANGUAGE_SPA
     void *pnetworkMenu =        &networkMenu;
     void *pSoundMenu   =        &soundMenu;
 
-    MENUENTRY mainOpts[12] =
+    static MENUENTRY mainOpts[12] =
     {
       { "Physics", NULL, WHITE, (double*)pPhysicsMenu, NULL, NULL, 0, 0, 0, 0, NULL, OPTION_MENUTYPE, FALSE, global->halfWidth - 3, global->halfHeight - 88},
       { "Weather", NULL, WHITE, (double*)pWeatherMenu, NULL, NULL, 0, 0, 0, 0, NULL, OPTION_MENUTYPE, FALSE, global->halfWidth - 3, global->halfHeight - 68},
@@ -231,7 +231,7 @@ if ( (global->language == LANGUAGE_ENGLISH) || (global->language == LANGUAGE_SPA
 
 if (global->language == LANGUAGE_PORTUGUESE)  // Portuguese
   {
-    MENUENTRY physicsOpts[8] =
+    static MENUENTRY physicsOpts[8] =
     {
       { "Gravidade", NULL, WHITE, &env->gravity, NULL, "%2.3f", .025, .325, 0.025, .075, NULL, OPTION_DOUBLETYPE, FALSE, global->halfWidth - 3, global->halfHeight - 80},
       { "Viscosidade", NULL, WHITE, &env->viscosity, NULL, "%2.2f", .25, 2.0, 0.25, 1.0, NULL, OPTION_DOUBLETYPE, FALSE, global->halfWidth - 3, global->halfHeight - 60},
@@ -245,7 +245,7 @@ if (global->language == LANGUAGE_PORTUGUESE)  // Portuguese
     };
     MENUDESC physicsMenu = { "Física", 7, physicsOpts, TRUE, FALSE};
 
-    MENUENTRY weatherOpts[7] =
+    static MENUENTRY weatherOpts[7] =
     {
       { "Chuvas de Meteoro", NULL, WHITE, &env->meteors, NULL, "%s", 0, 3, 1,
         0, meteorText_ptbr, OPTION_SPECIALTYPE, FALSE, global->halfWidth - 3,
@@ -271,7 +271,7 @@ if (global->language == LANGUAGE_PORTUGUESE)  // Portuguese
                              TRUE, FALSE
                            };
 
-    MENUENTRY soundOpts[3] =
+    static MENUENTRY soundOpts[3] =
     {
       { "Efeitos de Som", NULL, WHITE, &global->sound, NULL, "%s", 0, 1, 1, 1, onOffText, OPTION_SPECIALTYPE, FALSE, global->halfWidth - 3, global->halfHeight - 68},
       { "Sistema de Som", NULL, WHITE, &global->sound_driver, NULL, "%s", 0, 5, 1, 0, soundDriver, OPTION_SPECIALTYPE, FALSE, global->halfWidth - 3, global->halfHeight - 48},
@@ -280,7 +280,7 @@ if (global->language == LANGUAGE_PORTUGUESE)  // Portuguese
    MENUDESC soundMenu = { "Som", 3, soundOpts, TRUE, FALSE};
 
 
-    MENUENTRY graphicsOpts[12] =
+    static MENUENTRY graphicsOpts[12] =
     {
       { "Tela Cheia", NULL, WHITE, &global->full_screen, NULL, "%s", 0, 1, 1, 0, onOffText_ptbr, OPTION_SPECIALTYPE, FALSE, global->halfWidth - 3, global->halfHeight - 108},
       { "Pontilhamento", NULL, WHITE, &global->ditherGradients, NULL, "%s",
@@ -311,7 +311,7 @@ if (global->language == LANGUAGE_PORTUGUESE)  // Portuguese
     };
     MENUDESC graphicsMenu = { "Gráficos", 12, graphicsOpts, TRUE, FALSE};
 
-    MENUENTRY financeOpts[9] =
+    static MENUENTRY financeOpts[9] =
     {
       { "Dinheiro inicial", NULL, WHITE, (double*)&global->startmoney, NULL,
         "%2.0f", 0, 200000, 5000, 20000, NULL, OPTION_DOUBLETYPE, FALSE,
@@ -342,7 +342,7 @@ if (global->language == LANGUAGE_PORTUGUESE)  // Portuguese
     };
     MENUDESC financeMenu = { "Dinheiro", 9, financeOpts, TRUE, FALSE};
 
-    MENUENTRY networkOpts[3] =
+    static MENUENTRY networkOpts[3] =
     {
        {  "Procurar actualizações", NULL, WHITE, (double*) &global->check_for_updates, NULL, "%s", 0, 1, 1, 1, onOffText, OPTION_SPECIALTYPE, FALSE, global->halfWidth - 3, global->halfHeight - 48},
        {  "Activar Rede", NULL, WHITE, (double*) &global->enable_network, NULL, "%s", 0, 1, 1, 1, onOffText, OPTION_SPECIALTYPE, FALSE, global->halfWidth - 3, global->halfHeight - 28},
@@ -358,7 +358,7 @@ if (global->language == LANGUAGE_PORTUGUESE)  // Portuguese
     void *pnetworkMenu  =       &networkMenu;
     void *pSoundMenu    =       &soundMenu;
 
-    MENUENTRY mainOpts[12] =
+    static MENUENTRY mainOpts[12] =
     {
       { "Física", NULL, WHITE, (double*)pPhysicsMenu, NULL, NULL, 0, 0, 0,
         0, NULL, OPTION_MENUTYPE, FALSE, global->halfWidth - 3,
@@ -404,7 +404,7 @@ if (global->language == LANGUAGE_PORTUGUESE)  // Portuguese
 // french
 if (global->language == LANGUAGE_FRENCH)
   {
-    MENUENTRY physicsOpts[8] =
+    static MENUENTRY physicsOpts[8] =
     {
       { "Gravité", NULL, WHITE, &env->gravity, NULL, "%2.3f", .025, .325, 0.025, .075, NULL, OPTION_DOUBLETYPE, FALSE, global->halfWidth - 3, global->halfHeight - 80},
       { "Viscosité", NULL, WHITE, &env->viscosity, NULL, "%2.2f", .25, 2.0, 0.25, 1.0, NULL, OPTION_DOUBLETYPE, FALSE, global->halfWidth - 3, global->halfHeight - 40},
@@ -418,7 +418,7 @@ if (global->language == LANGUAGE_FRENCH)
     };
     MENUDESC physicsMenu = { "Physique", 7, physicsOpts, TRUE, FALSE};
 
-    MENUENTRY weatherOpts[7] =
+    static MENUENTRY weatherOpts[7] =
     {
       { "Orages de météorites", NULL, WHITE, &env->meteors, NULL, "%s", 0, 3, 1, 0, meteorText_fr, OPTION_SPECIALTYPE, FALSE, global->halfWidth - 3, global->halfHeight - 68},
       { "Éclairs", NULL, WHITE, &env->lightning, NULL, "%s", 0, 3, 1, 0, lightningText_fr, OPTION_SPECIALTYPE, FALSE, global->halfWidth - 3, global->halfHeight - 48},
@@ -430,7 +430,7 @@ if (global->language == LANGUAGE_FRENCH)
     };
     MENUDESC weatherMenu = { "Météo", 7, weatherOpts, TRUE, FALSE};
 
-    MENUENTRY soundOpts[3] =
+    static MENUENTRY soundOpts[3] =
     {
       { "Effets Sonores", NULL, WHITE, &global->sound, NULL, "%s", 0, 1, 1, 1, onOffText, OPTION_SPECIALTYPE, FALSE, global->halfWidth - 3, global->halfHeight - 68},
       { "Système de Son", NULL, WHITE, &global->sound_driver, NULL, "%s", 0, 5, 1, 0, soundDriver, OPTION_SPECIALTYPE, FALSE, global->halfWidth - 3, global->halfHeight - 48},
@@ -439,7 +439,7 @@ if (global->language == LANGUAGE_FRENCH)
    MENUDESC soundMenu = { "Sound", 3, soundOpts, TRUE, FALSE};
 
 
-    MENUENTRY graphicsOpts[12] =
+    static MENUENTRY graphicsOpts[12] =
     {
       { "Full Screen", NULL, WHITE, &global->full_screen, NULL, "%s", 0, 1, 1, 0, onOffText_fr, OPTION_SPECIALTYPE, FALSE, global->halfWidth - 3, global->halfHeight - 108},
       { "Tramage", NULL, WHITE, &global->ditherGradients, NULL, "%s", 0, 1, 1, 1, onOffText_fr, OPTION_SPECIALTYPE, FALSE, global->halfWidth - 3, global->halfHeight - 88},
@@ -456,7 +456,7 @@ if (global->language == LANGUAGE_FRENCH)
     };
     MENUDESC graphicsMenu = { "Graphismes", 12, graphicsOpts, TRUE, FALSE};
 
-    MENUENTRY financeOpts[9] =
+    static MENUENTRY financeOpts[9] =
     {
       { "Somme de départ", NULL, WHITE, (double*)&global->startmoney, NULL, "%2.0f", 0, 200000, 5000, 20000, NULL, OPTION_DOUBLETYPE, FALSE, global->halfWidth - 3, global->halfHeight - 68},
       { "Taux d'intérêt", NULL, WHITE, (double*)&global->interest, NULL, "%2.2f", 1.0, 1.5, 0.05, 1.25, NULL, OPTION_DOUBLETYPE, FALSE, global->halfWidth - 3, global->halfHeight - 48},
@@ -471,7 +471,7 @@ if (global->language == LANGUAGE_FRENCH)
     };
     MENUDESC financeMenu = { "Finances", 9, financeOpts, TRUE, FALSE};
 
-    MENUENTRY networkOpts[3] =
+    static MENUENTRY networkOpts[3] =
     {
        {  "Check Updates", NULL, WHITE, (double*) &global->check_for_updates, NULL, "%s", 0, 1, 1, 1, onOffText, OPTION_SPECIALTYPE, FALSE, global->halfWidth - 3, global->halfHeight - 48},
        {  "Networking", NULL, WHITE, (double*) &global->enable_network, NULL, "%s", 0, 1, 1, 1, onOffText, OPTION_SPECIALTYPE, FALSE, global->halfWidth - 3, global->halfHeight - 28},
@@ -488,7 +488,7 @@ if (global->language == LANGUAGE_FRENCH)
     void *pnetworkMenu  =       &networkMenu;
     void *pSoundMenu    =       &soundMenu;
 
-    MENUENTRY mainOpts[12] =
+    static MENUENTRY mainOpts[12] =
     {
       { "Physique", NULL, WHITE, (double*)pPhysicsMenu, NULL, NULL, 0, 0, 0, 0, NULL, OPTION_MENUTYPE, FALSE, global->halfWidth - 3, global->halfHeight - 88},
       { "Météo", NULL, WHITE, (double*)pWeatherMenu, NULL, NULL, 0, 0, 0, 0, NULL, OPTION_MENUTYPE, FALSE, global->halfWidth - 3, global->halfHeight - 68},
@@ -515,7 +515,7 @@ if (global->language == LANGUAGE_FRENCH)
 
 if (global->language == LANGUAGE_GERMAN)
   {
-    MENUENTRY physicsOpts[8] =
+    static MENUENTRY physicsOpts[8] =
     {
       { "Gravitation", NULL, WHITE, &env->gravity, NULL, "%2.3f", .025, .325, 0.025, .075, NULL, OPTION_DOUBLETYPE, FALSE, global->halfWidth - 3, global->halfHeight - 80},
       { "Reibung", NULL, WHITE, &env->viscosity, NULL, "%2.2f", .25, 2.0, 0.25, 1.0, NULL, OPTION_DOUBLETYPE, FALSE, global->halfWidth - 3, global->halfHeight - 60},
@@ -528,7 +528,7 @@ if (global->language == LANGUAGE_GERMAN)
     };
     MENUDESC physicsMenu = { "Physik", 8, physicsOpts, TRUE, FALSE};
 
-    MENUENTRY weatherOpts[7] =
+    static MENUENTRY weatherOpts[7] =
     {
       { "Meteoritenregen", NULL, WHITE, &env->meteors, NULL, "%s", 0, 3, 1, 0, meteorText_de, OPTION_SPECIALTYPE, FALSE, global->halfWidth - 3, global->halfHeight - 68},
       { "Gewitter", NULL, WHITE, &env->lightning, NULL, "%s", 0, 3, 1, 0, lightningText_de,OPTION_SPECIALTYPE, FALSE, global->halfWidth - 3, global->halfHeight - 48},
@@ -540,7 +540,7 @@ if (global->language == LANGUAGE_GERMAN)
     };
     MENUDESC weatherMenu = { "Wetter", 7, weatherOpts, TRUE, FALSE};
 
-    MENUENTRY soundOpts[3] =
+    static MENUENTRY soundOpts[3] =
     {
       { "Alle Sounds", NULL, WHITE, &global->sound, NULL, "%s", 0, 1, 1, 1, onOffText_de, OPTION_SPECIALTYPE, FALSE, global->halfWidth - 3, global->halfHeight - 68},
       { "Sound Treiber", NULL, WHITE, &global->sound_driver, NULL, "%s", 0, 5, 1, 0, soundDriver, OPTION_SPECIALTYPE, FALSE, global->halfWidth - 3, global->halfHeight - 48},
@@ -550,7 +550,7 @@ if (global->language == LANGUAGE_GERMAN)
 
 
 
-    MENUENTRY graphicsOpts[12] =
+    static MENUENTRY graphicsOpts[12] =
     {
       { "Full Screen", NULL, WHITE, &global->full_screen, NULL, "%s", 0, 1, 1, 0, onOffText_de, OPTION_SPECIALTYPE, FALSE, global->halfWidth - 3, global->halfHeight - 108},
       { "Dithering", NULL, WHITE, &global->ditherGradients, NULL, "%s", 0, 1, 1, 1, onOffText_de, OPTION_SPECIALTYPE, FALSE, global->halfWidth - 3, global->halfHeight - 88},
@@ -568,7 +568,7 @@ if (global->language == LANGUAGE_GERMAN)
     MENUDESC graphicsMenu = { "Grafik", 12, graphicsOpts, TRUE, FALSE};
 
 
-    MENUENTRY financeOpts[9] =
+    static MENUENTRY financeOpts[9] =
     {
       { "Startgeld", NULL, WHITE, (double*)&global->startmoney, NULL, "%2.0f", 0, 200000, 5000, 20000, NULL, OPTION_DOUBLETYPE, FALSE, global->halfWidth - 3, global->halfHeight - 68},
       { "Zinssatz", NULL, WHITE, (double*)&global->interest, NULL, "%2.2f", 1.0, 1.5, 0.05,1.25, NULL, OPTION_DOUBLETYPE, FALSE, global->halfWidth - 3, global->halfHeight - 48},
@@ -583,7 +583,7 @@ if (global->language == LANGUAGE_GERMAN)
     };
     MENUDESC financeMenu = { "Geld", 9, financeOpts, TRUE, FALSE};
 
-    MENUENTRY networkOpts[3] =
+    static MENUENTRY networkOpts[3] =
     {
        {  "Auf Aktualisierungen prüfen", NULL, WHITE, (double*) &global->check_for_updates, NULL, "%s", 0, 1, 1, 1, onOffText_de, OPTION_SPECIALTYPE, FALSE, global->halfWidth - 3, global->halfHeight - 48},
        {  "Netzwerk", NULL, WHITE, (double*) &global->enable_network, NULL, "%s", 0, 1, 1, 1, onOffText_de, OPTION_SPECIALTYPE, FALSE, global->halfWidth - 3, global->halfHeight - 28},
@@ -599,7 +599,7 @@ if (global->language == LANGUAGE_GERMAN)
     void *pnetworkMenu  =       &networkMenu;
     void *pSoundMenu    =       &soundMenu;
 
-    MENUENTRY mainOpts[12] =
+    static MENUENTRY mainOpts[12] =
     {
       { "Physik", NULL, WHITE, (double*)pPhysicsMenu, NULL, NULL, 0, 0, 0, 0, NULL, OPTION_MENUTYPE, FALSE, global->halfWidth - 3, global->halfHeight - 88},
       { "Wetter", NULL, WHITE, (double*)pWeatherMenu, NULL, NULL, 0, 0, 0, 0, NULL, OPTION_MENUTYPE, FALSE, global->halfWidth - 3, global->halfHeight - 68},
@@ -626,7 +626,7 @@ if (global->language == LANGUAGE_GERMAN)
 
 if (global->language == LANGUAGE_SLOVAK)
   {
-    MENUENTRY physicsOpts[8] =
+    static MENUENTRY physicsOpts[8] =
     {
       { "Gravitácia", NULL, WHITE, &env->gravity, NULL, "%2.3f", .025, .325, 0.025, .075, NULL, OPTION_DOUBLETYPE, FALSE, global->halfWidth - 3, global->halfHeight - 80},
       { "Viskozita", NULL, WHITE, &env->viscosity, NULL, "%2.2f", .25, 2.0, 0.25, 1.0, NULL, OPTION_DOUBLETYPE, FALSE, global->halfWidth - 3, global->halfHeight - 60},
@@ -639,7 +639,7 @@ if (global->language == LANGUAGE_SLOVAK)
     };
     MENUDESC physicsMenu = { "Fyzika", 7, physicsOpts, TRUE, FALSE};
 
-    MENUENTRY weatherOpts[7] =
+    static MENUENTRY weatherOpts[7] =
     {
       { "Dážď meteorov", NULL, WHITE, &env->meteors, NULL, "%s", 0, 3, 1, 0, meteorText_sk, OPTION_SPECIALTYPE, FALSE, global->halfWidth - 3, global->halfHeight - 68},
       { "Blesky", NULL, WHITE, &env->lightning, NULL, "%s", 0, 3, 1, 0, lightningText_sk, OPTION_SPECIALTYPE, FALSE, global->halfWidth - 3, global->halfHeight - 48},
@@ -651,7 +651,7 @@ if (global->language == LANGUAGE_SLOVAK)
     };
     MENUDESC weatherMenu = { "Počasie", 7, weatherOpts, TRUE, FALSE};
 
-    MENUENTRY soundOpts[3] =
+    static MENUENTRY soundOpts[3] =
     {
       { "Všetky zvuky", NULL, WHITE, &global->sound, NULL, "%s", 0, 1, 1, 1, onOffText, OPTION_SPECIALTYPE, FALSE, global->halfWidth - 3, global->halfHeight - 68},
       { "Ovládač zvuku", NULL, WHITE, &global->sound_driver, NULL, "%s", 0, 5, 1, 0, soundDriver, OPTION_SPECIALTYPE, FALSE, global->halfWidth - 3, global->halfHeight - 48},
@@ -661,7 +661,7 @@ if (global->language == LANGUAGE_SLOVAK)
 
 
 
-    MENUENTRY graphicsOpts[12] =
+    static MENUENTRY graphicsOpts[12] =
     {
       { "Na celú obrazovku", NULL, WHITE, &global->full_screen, NULL, "%s", 0, 1, 1, 0, onOffText_sk, OPTION_SPECIALTYPE, FALSE, global->halfWidth - 3, global->halfHeight - 108},
       { "Rozptyl", NULL, WHITE, &global->ditherGradients, NULL, "%s", 0, 1, 1, 1, onOffText_sk, OPTION_SPECIALTYPE, FALSE, global->halfWidth - 3, global->halfHeight - 88},
@@ -678,7 +678,7 @@ if (global->language == LANGUAGE_SLOVAK)
     };
     MENUDESC graphicsMenu = { "Grafika", 12, graphicsOpts, TRUE, FALSE};
 
-    MENUENTRY financeOpts[9] =
+    static MENUENTRY financeOpts[9] =
     {
       { "Peniaze na začiatku", NULL, WHITE, (double*)&global->startmoney, NULL, "%2.0f", 0, 200000, 5000, 20000, NULL, OPTION_DOUBLETYPE, FALSE, global->halfWidth - 3, global->halfHeight - 68},
       { "Úroková miera", NULL, WHITE, (double*)&global->interest, NULL, "%2.2f", 1.0, 1.5, 0.05, 1.25, NULL, OPTION_DOUBLETYPE, FALSE, global->halfWidth - 3, global->halfHeight - 48},
@@ -694,7 +694,7 @@ if (global->language == LANGUAGE_SLOVAK)
     MENUDESC financeMenu = { "Peniaze", 9, financeOpts, TRUE, FALSE};
 
 
-    MENUENTRY networkOpts[3] =
+    static MENUENTRY networkOpts[3] =
     {
        {  "Kontrola aktualizácii", NULL, WHITE, (double*) &global->check_for_updates, NULL, "%s", 0, 1, 1, 1, onOffText, OPTION_SPECIALTYPE, FALSE, global->halfWidth - 3, global->halfHeight - 48},
        {  "Sieťová hra", NULL, WHITE, (double*) &global->enable_network, NULL, "%s", 0, 1, 1, 1, onOffText, OPTION_SPECIALTYPE, FALSE, global->halfWidth - 3, global->halfHeight - 28},
@@ -711,7 +711,7 @@ if (global->language == LANGUAGE_SLOVAK)
     void *pSoundMenu    =       &soundMenu;
 
 
-    MENUENTRY mainOpts[12] =
+    static MENUENTRY mainOpts[12] =
     {
       { "Fyzika", NULL, WHITE, (double*)pPhysicsMenu, NULL, NULL, 0, 0, 0, 0, NULL, OPTION_MENUTYPE, FALSE, global->halfWidth - 3, global->halfHeight - 88},
       { "Počasie", NULL, WHITE, (double*)pWeatherMenu, NULL, NULL, 0, 0, 0, 0, NULL, OPTION_MENUTYPE, FALSE, global->halfWidth - 3, global->halfHeight - 68},
@@ -737,7 +737,7 @@ if (global->language == LANGUAGE_SLOVAK)
 
 if (global->language == LANGUAGE_RUSSIAN)
 {
-    MENUENTRY physicsOpts[8] =
+    static MENUENTRY physicsOpts[8] =
     {
       { "Гравитация", NULL, WHITE, &env->gravity, NULL, "%2.3f", .025, .325, 0.025, .075, NULL, OPTION_DOUBLETYPE, FALSE, global->halfWidth - 3, global->halfHeight - 80},
       { "Сила трения", NULL, WHITE, &env->viscosity, NULL, "%2.2f", .25, 2.0, 0.25, 1.0, NULL, OPTION_DOUBLETYPE, FALSE, global->halfWidth - 3, global->halfHeight - 60},
@@ -751,7 +751,7 @@ if (global->language == LANGUAGE_RUSSIAN)
     MENUDESC physicsMenu = { "Физика", 7, physicsOpts, TRUE, FALSE};
 
 
-    MENUENTRY weatherOpts[7] =
+    static MENUENTRY weatherOpts[7] =
     {
       { "Метеоритный дождь", NULL, WHITE, &env->meteors, NULL, "%s", 0, 3, 1, 0, meteorText_ru, OPTION_SPECIALTYPE, FALSE, global->halfWidth - 3, global->halfHeight - 68},
       { "Молнии", NULL, WHITE, &env->lightning, NULL, "%s", 0, 3, 1, 0, lightningText_ru, OPTION_SPECIALTYPE, FALSE, global->halfWidth - 3, global->halfHeight - 48},
@@ -764,7 +764,7 @@ if (global->language == LANGUAGE_RUSSIAN)
     MENUDESC weatherMenu = { "Погода", 7, weatherOpts, TRUE, FALSE};
 
 
-    MENUENTRY soundOpts[3] =
+    static MENUENTRY soundOpts[3] =
     {
       { "All Sound", NULL, WHITE, &global->sound, NULL, "%s", 0, 1, 1, 1, onOffText_ru, OPTION_SPECIALTYPE, FALSE, global->halfWidth - 3, global->halfHeight - 68},
       { "Sound Driver", NULL, WHITE, &global->sound_driver, NULL, "%s", 0, 5, 1, 0, soundDriver, OPTION_SPECIALTYPE, FALSE, global->halfWidth - 3, global->halfHeight - 48},
@@ -773,7 +773,7 @@ if (global->language == LANGUAGE_RUSSIAN)
    MENUDESC soundMenu = { "Sound", 3, soundOpts, TRUE, FALSE};
 
 
-    MENUENTRY graphicsOpts[12] =
+    static MENUENTRY graphicsOpts[12] =
     {
       { "Full Screen", NULL, WHITE, &global->full_screen, NULL, "%s", 0, 1, 1, 0, onOffText_ru, OPTION_SPECIALTYPE, FALSE, global->halfWidth - 3, global->halfHeight - 108},
       { "Сглаживание", NULL, WHITE, &global->ditherGradients, NULL, "%s", 0, 1, 1, 1, onOffText_ru, OPTION_SPECIALTYPE, FALSE, global->halfWidth - 3, global->halfHeight - 88},
@@ -791,7 +791,7 @@ if (global->language == LANGUAGE_RUSSIAN)
     MENUDESC graphicsMenu = { "Графика", 12, graphicsOpts, TRUE, FALSE};
 
 
-    MENUENTRY financeOpts[9] =
+    static MENUENTRY financeOpts[9] =
     {
       { "Начальные деньги", NULL, WHITE, (double*)&global->startmoney, NULL, "%2.0f", 0, 200000, 5000, 20000, NULL, OPTION_DOUBLETYPE, FALSE, global->halfWidth - 3, global->halfHeight - 68},
       { "Банковский процент", NULL, WHITE, (double*)&global->interest, NULL, "%2.2f", 1.0, 1.5, 0.05, 1.25, NULL, OPTION_DOUBLETYPE, FALSE, global->halfWidth - 3, global->halfHeight - 48},
@@ -806,7 +806,7 @@ if (global->language == LANGUAGE_RUSSIAN)
     MENUDESC financeMenu = { "Экономика", 9, financeOpts, TRUE, FALSE};
 
 
-    MENUENTRY networkOpts[3] =
+    static MENUENTRY networkOpts[3] =
     {
        {  "Проверять обновления", NULL, WHITE, (double*) &global->check_for_updates, NULL, "%s", 0, 1, 1, 1, onOffText_ru, OPTION_SPECIALTYPE, FALSE, global->halfWidth - 3, global->halfHeight - 48},
        {  "Networking", NULL, WHITE, (double*) &global->enable_network, NULL, "%s", 0, 1, 1, 1, onOffText, OPTION_SPECIALTYPE, FALSE, global->halfWidth - 3, global->halfHeight - 28},
@@ -822,7 +822,7 @@ if (global->language == LANGUAGE_RUSSIAN)
     void *pSoundMenu    =       &soundMenu;
 
 
-    MENUENTRY mainOpts[12] =
+    static MENUENTRY mainOpts[12] =
     {
       { "Физика", NULL, WHITE, (double*)pPhysicsMenu, NULL, NULL, 0, 0, 0, 0, NULL, OPTION_MENUTYPE, FALSE, global->halfWidth - 3, global->halfHeight - 88},
       { "Погода", NULL, WHITE, (double*)pWeatherMenu, NULL, NULL, 0, 0, 0, 0, NULL, OPTION_MENUTYPE, FALSE, global->halfWidth - 3, global->halfHeight - 68},
diff --git a/src/missile.cpp b/src/missile.cpp
index a3833d0..330dc7e 100644
--- a/src/missile.cpp
+++ b/src/missile.cpp
@@ -641,15 +641,16 @@ void MISSILE::trigger ()
 
   if ((type >= DIRT_BALL && type <= SMALL_DIRT_SPREAD) || (type >= RIOT_CHARGE && type <= RIOT_BLAST))
     {
-      play_sample ((SAMPLE *) _global->sounds[9], 128 + (expSize / 2), 128, 1000 - (expSize * 2), 0);
+      play_sample ((SAMPLE *) _global->sounds[9], _env->scaleVolume(128 + (expSize / 2)), 128, 1000 - (expSize * 2), 0);
     }
   else if (type == NAPALM_JELLY)
     {
+      // TODO?
       //play_sample ((SAMPLE *) _global->SOUND[9].dat, 128 + (expSize / 2), 128, 1000 - (expSize * 2), 0);
     }
   else
     {
-      play_sample ((SAMPLE *) _global->sounds[WEAPONSOUNDS + sound], 255, 128, 1000, 0);
+      play_sample ((SAMPLE *) _global->sounds[WEAPONSOUNDS + sound], _env->scaleVolume(255), 128, 1000, 0);
     }
 }
 
diff --git a/src/network.cpp b/src/network.cpp
index e712f42..e3bff5a 100644
--- a/src/network.cpp
+++ b/src/network.cpp
@@ -458,6 +458,7 @@ void *Send_And_Receive(void *all_the_data)
          printf("Accepted connection.\n");
          // give connection to AI player
          found = false;
+         counter = 0;
          while ( (! found) && (counter < global->numPlayers) )
          {
               if ( ( global->players[counter]->type >= USELESS_PLAYER) &&
diff --git a/src/player.cpp b/src/player.cpp
index 64a2171..bbcf37f 100644
--- a/src/player.cpp
+++ b/src/player.cpp
@@ -1032,6 +1032,10 @@ int PLAYER::controlTank ()
             }
 
         }    // end of check status keys
+      if ( (k & 0xff) == 'v' )
+        _env->decreaseVolume();
+      else if ( (k & 0xff) == 'V' )
+        _env->increaseVolume();
     }
 
   if ((int)type == HUMAN_PLAYER || !tank)
@@ -1139,12 +1143,11 @@ int PLAYER::computerSelectPreBuyItem (int aMaxBoostValue)
 int PLAYER::chooseItemToBuy (int aMaxBoostValue)
 {
   int currItem = computerSelectPreBuyItem (aMaxBoostValue);
-  int oldItem = 0;
   int itemNum = 0;
   int cumulative;
   int nextMod, curramt, newamt;
   int iTRIES = THINGS; // pow((int)type + 1, 2);
-  int iDesiredItems[iTRIES]; // Deadly bots have large shopping carts. ;)
+  int iDesiredItems[THINGS]; // Deadly bots have large shopping carts. ;)
   bool bIsSorted = false; // Whether the cart is sorted or not
   bool bIsPreSelected = currItem?true:false;	// Whether or not the PreBuy steps found something
   int i = 0;
@@ -1163,9 +1166,7 @@ int PLAYER::chooseItemToBuy (int aMaxBoostValue)
   i = 0;
   while (i < iTRIES)
     {
-      // while (currItem == oldItem)
       currItem = (int) fabs (selectRandomItem());
-      oldItem = currItem;
       if (currItem >= THINGS)
         currItem	%=	THINGS;	// Put in range
       // now currItem is 0<= currItem < THINGS
@@ -1910,7 +1911,7 @@ printf("This is range find function\n");
   int iSpread					=	weapon[tank->cw].spread;
   int iSpreadCount		=	0;
   int iSpreadOdd[]		= {0,-1 * SPREAD, SPREAD, -2 * SPREAD, 2 * SPREAD};
-  int iSpreadEven[]		=	{-0.5 * SPREAD, 0.5 * SPREAD, -1.5 * SPREAD, 1,5 * SPREAD};
+  int iSpreadEven[]		=	{ int(-0.5 * SPREAD), int(0.5 * SPREAD), int(-1.5 * SPREAD), 1, int(5 * SPREAD)};
   int iMaxSpread			=	(int)type; // more intelligent bots can calculate more shots bearing spreads!
   double dStartX, dStartY, dVelocityX, dVelocityY;	// No initialization needed, they are calculated anyway.
   double dHitX, dHitY;
@@ -2674,7 +2675,7 @@ int PLAYER::calculateAttack(TANK *aTarget)
     }
 
   /* --- case d) Fire in non-boxed mode --- */
-  int iRawAngle, iAdjAngle, iPower, iLastPower, iSavetyPower;
+  int iRawAngle, iAdjAngle, iPower, iSavetyPower;
   int iOvershoot = MAX_OVERSHOOT;
   int iLastOvershoot = MAX_OVERSHOOT;
   int iBestOvershoot = MAX_OVERSHOOT;
@@ -2715,8 +2716,6 @@ int PLAYER::calculateAttack(TANK *aTarget)
       iBestOvershoot = tank->smallestOvershoot;
     }
 
-  iLastPower=	iPower;
-
   if (aTarget)
   {
     #ifdef DEBUG_AIM
diff --git a/src/player.h b/src/player.h
index 0881609..cb82708 100644
--- a/src/player.h
+++ b/src/player.h
@@ -55,7 +55,7 @@ enum turnStages
   FIRE_WEAPON
 };
 
-#define TANK_TYPES 8
+#define TANK_TYPES 9
 
 #define	NUM_ROULETTE_SLOTS (THINGS * 100)
 #define	MAX_WEAP_PROBABILITY	10000
diff --git a/src/sky.cpp b/src/sky.cpp
index 00f7f23..685f68b 100644
--- a/src/sky.cpp
+++ b/src/sky.cpp
@@ -414,9 +414,13 @@ void *Generate_Sky_In_Background(void *new_env)
                    (my_global->ditherGradients ? GENSKY_DITHERGRAD : 0 ) |
                    (my_global->detailedSky ? GENSKY_DETAILED : 0 )  );
 
+         #ifdef THREADS
          env->lock(env->waiting_sky_lock);
+         #endif
          env->waiting_sky = sky_in_progress;
+         #ifdef THREADS
          env->unlock(env->waiting_sky_lock);
+         #endif
          sky_in_progress = NULL;
       }
 
diff --git a/src/tank.cpp b/src/tank.cpp
index e0fcb10..28b10f6 100644
--- a/src/tank.cpp
+++ b/src/tank.cpp
@@ -524,7 +524,7 @@ void TANK::applyDamage ()
     }
   else
     {
-      shieldText->set_text ( "");
+      shieldText->set_text (NULL);
     }
   sprintf (buf, "%d", l);
   healthText->set_text (buf);
@@ -544,7 +544,7 @@ void TANK::framelyAccounting ()
      delta_phase = -delta_phase;
 }
 
-int TANK::applyPhysics (GLOBALDATA *global)
+int TANK::applyPhysics ()
 {
   int stable = 0;
   int landed_on_tank;
@@ -571,7 +571,7 @@ int TANK::applyPhysics (GLOBALDATA *global)
       int pixelCol = getpixel (_env->terrain, (int)x, (int)y + (TANKHEIGHT - TANKSAG));
 
       // check to see if we have landed on another tank -- Jesse
-      landed_on_tank = tank_on_tank ( global );
+      landed_on_tank = tank_on_tank ( _global );
 
       // we are falling and have hit the bottom of the screen or fallen onto dirt or on a tank
       if ((l > 0) && (yv > 0) && ((y >= _global->screenHeight - TANKHEIGHT) ||
@@ -692,7 +692,7 @@ void TANK::explode ()
   
 
   destroy = TRUE;
-  play_sample ((SAMPLE *)_global->sounds[WEAPONSOUNDS], 255, 128, 1000, 0);
+  play_sample ((SAMPLE *)_global->sounds[WEAPONSOUNDS], _env->scaleVolume(255), 128, 1000, 0);
 }
 
 void TANK::repulse (double xpos, double ypos, double *xaccel, double *yaccel, int aWeaponType)
@@ -737,7 +737,7 @@ void TANK::printHealth (int offset)
   }
 }
 
-void TANK::draw (BITMAP *dest, int healthOffset)
+void TANK::drawTank (BITMAP *dest, int healthOffset)
 {
   int turretAngle;
 
@@ -802,6 +802,12 @@ void TANK::draw (BITMAP *dest, int healthOffset)
           turret_y = y;
           turret_x = x;
           break;
+        case MINI_TANK:
+          use_tank_bitmap = 16;
+          use_turret_bitmap = 9;
+          turret_y = y;
+          turret_x = x;
+          break;
         default:
           use_tank_bitmap = 0;
           use_turret_bitmap = 0;
@@ -1000,7 +1006,7 @@ void TANK::activateCurrentSelection ()
 
       if (cw < BALLISTICS)
         {
-          play_sample ((SAMPLE *) _global->sounds[weapon[cw].sound], 255, 128, 1000, 0);
+          play_sample ((SAMPLE *) _global->sounds[weapon[cw].sound], _env->scaleVolume(255), 128, 1000, 0);
           for (z = 0; z < _env->am; z++)
             {
               MISSILE *newmis;
@@ -1051,7 +1057,7 @@ void TANK::activateCurrentSelection ()
         }
       else          // BEAM weapon
         {
-          play_sample ((SAMPLE *) _global->sounds[weapon[cw].sound], 255, 128, 1000, 0);
+          play_sample ((SAMPLE *) _global->sounds[weapon[cw].sound], _env->scaleVolume(255), 128, 1000, 0);
           for (z = 0; z < _env->am; z++)
             {
               BEAM *newbeam;
@@ -1098,7 +1104,6 @@ void TANK::activateCurrentSelection ()
         {
           int random_tank_number;
           TANK *other_tank;
-          TELEPORT *my_teleport, *other_teleport;
 
           // pick a random tank (not us)
           random_tank_number = rand() % _global->numTanks;
@@ -1112,14 +1117,13 @@ void TANK::activateCurrentSelection ()
             }
           creditTo = player;
           // create a teleport ojbect for this tank
-          my_teleport = new TELEPORT (_global, _env, this, (int) other_tank->x, (int) other_tank->y, TANKHEIGHT * 4 + GUNLENGTH, 120);
+          new TELEPORT (_global, _env, this, (int) other_tank->x, (int) other_tank->y, TANKHEIGHT * 4 + GUNLENGTH, 120);
           // create a teleport object for the other tank
-          other_teleport = new TELEPORT (_global, _env, other_tank, (int) x, (int) y, TANKHEIGHT * 4 + GUNLENGTH, 120);
+          new TELEPORT (_global, _env, other_tank, (int) x, (int) y, TANKHEIGHT * 4 + GUNLENGTH, 120);
 
         }
       else if (itemNum == ITEM_MASS_TELEPORT)
       {
-          TELEPORT *my_teleport;
           int count;
           int XDest, YDest;
           TANK *current_tank;
@@ -1132,7 +1136,7 @@ void TANK::activateCurrentSelection ()
                 XDest = (rand () % (_global->screenWidth - TANKWIDTH * 2)) + TANKWIDTH;
                 YDest = (rand () % (_global->screenHeight - TANKHEIGHT * 2)) + TANKHEIGHT;
                 creditTo = player;
-                my_teleport = new TELEPORT(_global, _env, current_tank, XDest, YDest, TANKHEIGHT * 4 + GUNLENGTH, 120);
+                new TELEPORT(_global, _env, current_tank, XDest, YDest, TANKHEIGHT * 4 + GUNLENGTH, 120);
              }
           }
              
@@ -1151,13 +1155,13 @@ void TANK::activateCurrentSelection ()
               xv -= 0.3;
          }
 
-         applyPhysics(_global);
+         applyPhysics();
       }
 
       else if ( itemNum == ITEM_FAN )
         {
           // play wind sound
-          play_sample ((SAMPLE *) _global->sounds[2], 255, 128, 1000, 0);
+          play_sample ((SAMPLE *) _global->sounds[2], _env->scaleVolume(255), 128, 1000, 0);
           if (a < 180)   // move wind to the right
             _env->wind += (p / 20);
           else     // wind to the left
@@ -1225,7 +1229,7 @@ void TANK::boost_up_shield ()
     }
   else
     {
-      shieldText->set_text ( "");
+      shieldText->set_text (NULL);
     }
 }
 void TANK::reactivate_shield ()
diff --git a/src/tank.h b/src/tank.h
index 4ea6ceb..cd27602 100644
--- a/src/tank.h
+++ b/src/tank.h
@@ -71,7 +71,7 @@ class TANK: public PHYSICAL_OBJECT
     int	get_heaviest_shield ();
     void	boost_up_shield ();
     void	reactivate_shield ();
-    void	draw (BITMAP *dest, int healthOffset);
+    void	drawTank (BITMAP *dest, int healthOffset);
     void	printHealth (int offset);
     void	update ();
     void	requireUpdate ();
@@ -85,7 +85,7 @@ class TANK: public PHYSICAL_OBJECT
     }
     virtual void setEnvironment(ENVIRONMENT *env);
     void	applyDamage ();
-    int	applyPhysics (GLOBALDATA *global);
+    int	applyPhysics ();
     void	repulse (double xpos, double ypos, double *xaccel, double *yaccel, int aWeaponType);
     int	howBuried ();
     int	shootClearance (int targetAngle, int minimumClearance = MAX_OVERSHOOT);
diff --git a/src/teleport.cpp b/src/teleport.cpp
index 3746f69..6e8aed6 100644
--- a/src/teleport.cpp
+++ b/src/teleport.cpp
@@ -50,7 +50,7 @@ TELEPORT::TELEPORT (GLOBALDATA *global, ENVIRONMENT *env, VIRTUAL_OBJECT *target
     {
       perror ( "teleport.cc: Failed allocating memory for remote in TELEPORT::TELEPORT");
     }
-  play_sample ((SAMPLE *) _global->sounds[item[ITEM_TELEPORT].sound], 255, 128, 1000, 0);
+  play_sample ((SAMPLE *) _global->sounds[item[ITEM_TELEPORT].sound], _env->scaleVolume(255), 128, 1000, 0);
 
   #ifdef NETWORK
   // this seems to be the teleport we usually use
diff --git a/src/update.cpp b/src/update.cpp
index b765ff6..e7966ee 100644
--- a/src/update.cpp
+++ b/src/update.cpp
@@ -42,7 +42,7 @@ char *Check_For_Update(char *server_name, char *remote_file, char *host_name, ch
 
 void *Get_Latest_Version(void *new_data)
 {
-  struct update_data *my_data = (struct update_data *) new_data;
+   struct update_data *my_data = (struct update_data *) new_data;
    // set up socket
    int socket_num, port_number = 80;
    struct sockaddr_in server_address;
diff --git a/tank/16.bmp b/tank/16.bmp
new file mode 100644
index 0000000..35d3cc5
Binary files /dev/null and b/tank/16.bmp differ
diff --git a/tankgun/9.bmp b/tankgun/9.bmp
new file mode 100644
index 0000000..22ef1e3
Binary files /dev/null and b/tankgun/9.bmp differ

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/atanks.git



More information about the Pkg-games-commits mailing list