[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[netPanzer-CVS] netpanzer ./ChangeLog ./TODO src/Lib/Log.hpp sr...
From: |
Matthias Braun |
Subject: |
[netPanzer-CVS] netpanzer ./ChangeLog ./TODO src/Lib/Log.hpp sr... |
Date: |
Mon, 22 Sep 2003 09:53:56 -0400 |
CVSROOT: /cvsroot/netpanzer
Module name: netpanzer
Branch:
Changes by: Matthias Braun <address@hidden> 03/09/22 09:53:54
Modified files:
. : ChangeLog TODO
src/Lib : Log.hpp
src/Lib/2D : ColorTable.cpp
src/Lib/Particles: FireParticleSystem2D.cpp
GroundExplosionParticle2D.cpp
GroundExplosionParticleSystem2D.cpp
ParticleInterface.cpp SnowParticle2D.cpp
SnowParticleSystem2D.cpp
TemplateExplosionSystem.cpp
src/Lib/Types : iXY.hpp
src/Lib/View : ScrollBar.cpp View.cpp cInputField.cpp
cInputField.hpp
src/NetPanzer/Classes: Outpost.cpp PlayerID.hpp
UnitBucketArray.cpp UnitPowerUp.cpp
ViewCamera.cpp
src/NetPanzer/Classes/AI: PathList.cpp PathList.hpp
src/NetPanzer/Classes/Network: ClientConnectDaemon.cpp
ConnectNetMessage.hpp
NetworkState.cpp
src/NetPanzer/Classes/Units: UnitGlobals.cpp Vehicle.cpp
src/NetPanzer/Classes/Weapons: BulletWeapon.cpp MissleWeapon.cpp
ShellWeapon.cpp
src/NetPanzer/Interfaces: GameManager.cpp MiniMapInterface.cpp
ObjectiveInterface.cpp
PathScheduler.cpp PathScheduler.hpp
PlayerInterface.cpp
PowerUpInterface.cpp
ProjectileInterface.cpp
UnitInterface.cpp
UnitProfileInterface.cpp
src/NetPanzer/Views/Game: CodeStatsView.cpp
ControlPaletteView.cpp
GameInfoView.cpp LobbyView.cpp
MiniMapView.cpp ProgressView.cpp
RankView.cpp VehicleSelectionView.cpp
src/NetPanzer/Views/MainMenu/Multi:
DirectPlayErrorExceptionView.cpp
GetSessionHostView.cpp
HostJoinTemplateView.cpp
HostOptionsView.cpp
IPAddressView.cpp
UnitColorView.cpp
src/NetPanzer/Views/MainMenu/Options: InterfaceView.cpp
Log message:
fixed all compile warnings
Patches:
Index: netpanzer/ChangeLog
diff -u netpanzer/ChangeLog:1.1 netpanzer/ChangeLog:1.2
--- netpanzer/ChangeLog:1.1 Sun Sep 21 14:29:31 2003
+++ netpanzer/ChangeLog Mon Sep 22 09:53:47 2003
@@ -1,6 +1,7 @@
22-Sep-2003 by Matthias Braun
-Commited automake stuff from Ivo and merged his autoconf script with mine
-small cleanups/compile fixes
+-fixed all warnings (and did some smaller cleanups again)
21-Sep-2003 by Ivo Danihelka
-solved the higher resolutions problem in MainMenu
Index: netpanzer/TODO
diff -u netpanzer/TODO:1.1 netpanzer/TODO:1.2
--- netpanzer/TODO:1.1 Sun Sep 21 14:29:31 2003
+++ netpanzer/TODO Mon Sep 22 09:53:47 2003
@@ -38,7 +38,7 @@
-Test it (esp. with more than 2 players)
-Make it compiling in mingw again.
-Fix all warnings in the sourcecode
--Add configure script (autoconf) which checks for all prerequesits
+-Add configure script (autoconf) which checks for all prerequesits - OK
-Create "make install" target (also a "make uninstall"?)
-Write a README
-Test it, esp. with more than 2 players and test a complete
Index: netpanzer/src/Lib/2D/ColorTable.cpp
diff -u netpanzer/src/Lib/2D/ColorTable.cpp:1.13
netpanzer/src/Lib/2D/ColorTable.cpp:1.14
--- netpanzer/src/Lib/2D/ColorTable.cpp:1.13 Tue Sep 16 16:16:09 2003
+++ netpanzer/src/Lib/2D/ColorTable.cpp Mon Sep 22 09:53:47 2003
@@ -179,7 +179,6 @@
// it to a file.
float curPercent;
int curOffset;
- RGBColor col;
RGBColor curColor;
const float percent = fudgeValue;
Index: netpanzer/src/Lib/Log.hpp
diff -u netpanzer/src/Lib/Log.hpp:1.7 netpanzer/src/Lib/Log.hpp:1.8
--- netpanzer/src/Lib/Log.hpp:1.7 Fri Sep 19 20:05:28 2003
+++ netpanzer/src/Lib/Log.hpp Mon Sep 22 09:53:47 2003
@@ -50,13 +50,7 @@
};
extern Logger LOGGER;
-#ifdef DO_LOGGING
#define LOG(x) LOGGER.info x
-#else
-#define LOG(x)
-#endif // DO_LOGGING
-// FUNC is deprecated
-#define FUNC(x)
#endif
Index: netpanzer/src/Lib/Particles/FireParticleSystem2D.cpp
diff -u netpanzer/src/Lib/Particles/FireParticleSystem2D.cpp:1.6
netpanzer/src/Lib/Particles/FireParticleSystem2D.cpp:1.7
--- netpanzer/src/Lib/Particles/FireParticleSystem2D.cpp:1.6 Tue Sep 16
16:16:09 2003
+++ netpanzer/src/Lib/Particles/FireParticleSystem2D.cpp Mon Sep 22
09:53:48 2003
@@ -28,20 +28,15 @@
//---------------------------------------------------------------------------
FireParticleSystem2D::FireParticleSystem2D(fXYZ pos, int isFarAway) :
ParticleSystem2D(pos, isFarAway)
{
- FUNC("FireParticleSystem2D::FireParticleSystem2D");
-
reset();
init();
-
} // end FireParticleSystem2D::FireParticleSystem2D
// reset
//---------------------------------------------------------------------------
void FireParticleSystem2D::reset()
{
- FUNC("FireParticleSystem2D::reset");
-
combinedTime = 0.0;
totalTime = 0.0;
@@ -55,8 +50,6 @@
//---------------------------------------------------------------------------
void FireParticleSystem2D::init()
{
- FUNC("FireParticleSystem2D::init");
-
} // end FireParticleSystem2D::init
// initColors
@@ -66,7 +59,6 @@
//---------------------------------------------------------------------------
void FireParticleSystem2D::initColors()
{
- FUNC("FireParticleSystem2D::initColors");
fireColor[ 0] = Palette::findNearestColor(RGBColor(255, 237, 146));
fireColor[ 1] = Palette::findNearestColor(RGBColor(255, 229, 126));
fireColor[ 2] = Palette::findNearestColor(RGBColor(255, 198, 130));
@@ -86,8 +78,6 @@
//---------------------------------------------------------------------------
void FireParticleSystem2D::sim()
{
- FUNC("FireParticleSystem2D::sim");
-
if (totalTime < 10) {
combinedTime += TimerInterface::getTimeSlice();
Index: netpanzer/src/Lib/Particles/GroundExplosionParticle2D.cpp
diff -u netpanzer/src/Lib/Particles/GroundExplosionParticle2D.cpp:1.8
netpanzer/src/Lib/Particles/GroundExplosionParticle2D.cpp:1.9
--- netpanzer/src/Lib/Particles/GroundExplosionParticle2D.cpp:1.8 Tue Sep
16 16:16:09 2003
+++ netpanzer/src/Lib/Particles/GroundExplosionParticle2D.cpp Mon Sep 22
09:53:48 2003
@@ -31,8 +31,6 @@
// XXX trajectoryAngle was missing here, I added 0
: TrajectoryParticle2D(pos, maxSpeed, 0)
{
- FUNC("GroundExplosionParticle2D::init");
-
airLifetime = lifetime;
lifetime = 10;
Index: netpanzer/src/Lib/Particles/GroundExplosionParticleSystem2D.cpp
diff -u netpanzer/src/Lib/Particles/GroundExplosionParticleSystem2D.cpp:1.5
netpanzer/src/Lib/Particles/GroundExplosionParticleSystem2D.cpp:1.6
--- netpanzer/src/Lib/Particles/GroundExplosionParticleSystem2D.cpp:1.5 Tue Sep
16 16:16:09 2003
+++ netpanzer/src/Lib/Particles/GroundExplosionParticleSystem2D.cpp Mon Sep
22 09:53:48 2003
@@ -29,8 +29,6 @@
//---------------------------------------------------------------------------
GroundExplosionParticleSystem2D::GroundExplosionParticleSystem2D(fXYZ pos,
iRect bounds, int maxParticleCount, int maxParticleSpeed) :
ParticleSystem2D(pos)
{
- FUNC("GroundExplosionParticleSystem2D::GroundExplosionParticleSystem2D");
-
// Make sure the the bounding box is not negative.
assert(bounds.getSize().x >= 0);
assert(bounds.getSize().y >= 0);
Index: netpanzer/src/Lib/Particles/ParticleInterface.cpp
diff -u netpanzer/src/Lib/Particles/ParticleInterface.cpp:1.10
netpanzer/src/Lib/Particles/ParticleInterface.cpp:1.11
--- netpanzer/src/Lib/Particles/ParticleInterface.cpp:1.10 Tue Sep 16
16:16:09 2003
+++ netpanzer/src/Lib/Particles/ParticleInterface.cpp Mon Sep 22 09:53:48 2003
@@ -292,8 +292,7 @@
// Chooses light or dark smoke.
int particleType = rand() % 2;
- fXYZ pos(worldPos.x, 0, worldPos.y);
- iRect r(0, 0, 0, 0);
+ //iRect r(0, 0, 0, 0);
if (particleType == 0) {
try {
@@ -313,7 +312,7 @@
//--------------------------------------------------------------------------
void ParticleInterface::addExplosionDirtSystem(const iXY &worldPos, const
iRect &bounds)
{
- fXYZ pos(worldPos.x, 0, worldPos.y);
+ //fXYZ pos(worldPos.x, 0, worldPos.y);
try {
//new ExplosionParticleSystem2D(pos, bounds,
dirtExplosionMaxParticleCount / 2, float(explosionParticleMaxSpeed) * 0.75f,
DIRT_PUFF);
@@ -323,7 +322,7 @@
//--------------------------------------------------------------------------
void ParticleInterface::addGroundExplosionSystem(const iXY &worldPos, const
iRect &bounds, int maxParticleCount, int maxParticleSpeed)
{
- fXYZ pos(worldPos.x, 0, worldPos.y);
+ //fXYZ pos(worldPos.x, 0, worldPos.y);
try {
//new GroundExplosionParticleSystem2D(pos, bounds, maxParticleCount,
maxParticleSpeed);
@@ -345,7 +344,7 @@
}
//if (particleNum == 2) { particleType = DIRT_PUFF; }
- fXYZ pos(worldPos.x, 0, worldPos.y);
+ //fXYZ pos(worldPos.x, 0, worldPos.y);
try {
//new ExplosionParticleSystem2D(pos, bounds, maxParticleCount,
maxParticleSpeed, particleType);
@@ -911,12 +910,12 @@
movePuffWaitTotal = (float(rand()) / float(RAND_MAX)) * 0.05f +
0.05f;
try {
- new PuffParticle2D( pos,
+ new PuffParticle2D( pos,
DIRT,
0.0f,
0.15f,
- smokeFPSMin * 0.75f,
- smokeFPSRand * 0.75f,
+ (int) (smokeFPSMin * 0.75f),
+ (int) (smokeFPSRand * 0.75f),
1,
0,
MuzzleSystem::windScale,
Index: netpanzer/src/Lib/Particles/SnowParticle2D.cpp
diff -u netpanzer/src/Lib/Particles/SnowParticle2D.cpp:1.6
netpanzer/src/Lib/Particles/SnowParticle2D.cpp:1.7
--- netpanzer/src/Lib/Particles/SnowParticle2D.cpp:1.6 Tue Sep 16 16:16:09 2003
+++ netpanzer/src/Lib/Particles/SnowParticle2D.cpp Mon Sep 22 09:53:48 2003
@@ -63,7 +63,6 @@
//---------------------------------------------------------------------------
void SnowParticle2D::sim()
{
- FUNC("SnowParticle2D::sim");
/*
float x = gravity.wind.ParticleSystem2D::wind.x;
float z = ParticleSystem2D::wind.z;
@@ -104,8 +103,6 @@
//---------------------------------------------------------------------------
void SnowParticle2D::draw(const Surface &dest, SpriteSorter &sorter)
{
- FUNC("SnowParticle2D::draw");
-
//if (size == 1) dest.putPixel(iXY(pos.x, pos.z), color);
//else if (size == 2) dest.fillRect(iRect(pos.x, pos.z, pos.x+1, pos.z+1),
color);
//else if (size == 3) dest.fillRect(iRect(pos.x, pos.z, pos.x+2, pos.z+2),
color);
Index: netpanzer/src/Lib/Particles/SnowParticleSystem2D.cpp
diff -u netpanzer/src/Lib/Particles/SnowParticleSystem2D.cpp:1.6
netpanzer/src/Lib/Particles/SnowParticleSystem2D.cpp:1.7
--- netpanzer/src/Lib/Particles/SnowParticleSystem2D.cpp:1.6 Tue Sep 16
16:16:09 2003
+++ netpanzer/src/Lib/Particles/SnowParticleSystem2D.cpp Mon Sep 22
09:53:49 2003
@@ -27,8 +27,6 @@
//---------------------------------------------------------------------------
SnowParticleSystem2D::SnowParticleSystem2D(fXYZ pos) : ParticleSystem2D(pos)
{
- FUNC("SnowParticleSystem2D::SnowParticleSystem2D");
-
reset();
init();
@@ -39,8 +37,6 @@
//---------------------------------------------------------------------------
void SnowParticleSystem2D::reset()
{
- FUNC("SnowParticleSystem2D::reset");
-
combinedTime = 0.0;
totalTime = 0.0;
snowParticleCount = 0;
@@ -53,8 +49,6 @@
//---------------------------------------------------------------------------
void SnowParticleSystem2D::init()
{
- FUNC("SnowParticleSystem2D::init");
-
try {
snowParticles = new SnowParticle2D [SNOW_PARTICLE_COUNT];
} catch(...) {}
@@ -70,8 +64,6 @@
//---------------------------------------------------------------------------
void SnowParticleSystem2D::sim()
{
- FUNC("SnowParticleSystem2D::sim");
-
if (totalTime < 20) {
totalTime += TimerInterface::getTimeSlice();
Index: netpanzer/src/Lib/Particles/TemplateExplosionSystem.cpp
diff -u netpanzer/src/Lib/Particles/TemplateExplosionSystem.cpp:1.6
netpanzer/src/Lib/Particles/TemplateExplosionSystem.cpp:1.7
--- netpanzer/src/Lib/Particles/TemplateExplosionSystem.cpp:1.6 Tue Sep 16
16:16:09 2003
+++ netpanzer/src/Lib/Particles/TemplateExplosionSystem.cpp Mon Sep 22
09:53:49 2003
@@ -124,9 +124,9 @@
float percentScale = Particle2D::getScale(e.percentScaleMin,
e.percentScaleRand);
// Get the number of particles of each type.
- int smallCount = particleCount * e.percentCountSmall;
- int mediumCount = particleCount * e.percentCountMedium;
- int largeCount = particleCount * e.percentCountLarge;
+ int smallCount = int(particleCount * e.percentCountSmall);
+ int mediumCount = int(particleCount * e.percentCountMedium);
+ int largeCount = int(particleCount * e.percentCountLarge);
// Check to see if we need to make some adjustments for low frame rates.
int fpsLow = (TimerInterface::getFPS() < 20) ? 1 : 0;
Index: netpanzer/src/Lib/Types/iXY.hpp
diff -u netpanzer/src/Lib/Types/iXY.hpp:1.2 netpanzer/src/Lib/Types/iXY.hpp:1.3
--- netpanzer/src/Lib/Types/iXY.hpp:1.2 Tue Sep 16 16:16:10 2003
+++ netpanzer/src/Lib/Types/iXY.hpp Mon Sep 22 09:53:49 2003
@@ -18,21 +18,12 @@
#ifndef __iXY_hpp__
#define __iXY_hpp__
-
-#if _MSC_VER > 1000
- #pragma once
-#endif
-
-
struct iXY
{
int x;
int y;
- iXY()
- {}
-
- iXY(const int x, const int y)
+ iXY(int x = 0, int y = 0)
{
iXY::x = x;
iXY::y = y;
Index: netpanzer/src/Lib/View/ScrollBar.cpp
diff -u netpanzer/src/Lib/View/ScrollBar.cpp:1.4
netpanzer/src/Lib/View/ScrollBar.cpp:1.5
--- netpanzer/src/Lib/View/ScrollBar.cpp:1.4 Tue Sep 16 16:16:11 2003
+++ netpanzer/src/Lib/View/ScrollBar.cpp Mon Sep 22 09:53:49 2003
@@ -243,8 +243,6 @@
void ScrollBar::actionPerformed(const iXY &pos)
{
if (parent != 0) {
- iRect cr(((View *) parent)->getClientRect());
-
if (orientation == HORIZONTAL) {
percent = float(pos.x) / float(size.x);
} else if (orientation == VERTICAL) {
@@ -253,7 +251,8 @@
assert(false);
}
- int newValue = percent * float(maximum - minimum - viewableAmount);
+ int newValue = int(percent * float(maximum - minimum -
+ viewableAmount));
int difference = newValue - value;
Index: netpanzer/src/Lib/View/View.cpp
diff -u netpanzer/src/Lib/View/View.cpp:1.14
netpanzer/src/Lib/View/View.cpp:1.15
--- netpanzer/src/Lib/View/View.cpp:1.14 Sun Sep 21 14:29:32 2003
+++ netpanzer/src/Lib/View/View.cpp Mon Sep 22 09:53:49 2003
@@ -1692,7 +1692,8 @@
float xRatio = float(difference.x) / float(getSizeX());
- resize(getSizeX() - difference.x, float(getSizeY()) * xRatio);
+ resize(int(getSizeX() - difference.x),
+ int(float(getSizeY()) * xRatio));
} else if (getSizeY() > SCREEN_YPIX) {
fXY difference;
@@ -1701,7 +1702,8 @@
float yRatio = float(difference.y) / float(getSizeY());
- resize(float(getSizeY()) * yRatio, getSizeY() - difference.y);
+ resize(int(float(getSizeY()) * yRatio),
+ int(getSizeY() - difference.y));
}
}
Index: netpanzer/src/Lib/View/cInputField.cpp
diff -u netpanzer/src/Lib/View/cInputField.cpp:1.9
netpanzer/src/Lib/View/cInputField.cpp:1.10
--- netpanzer/src/Lib/View/cInputField.cpp:1.9 Tue Sep 16 16:16:11 2003
+++ netpanzer/src/Lib/View/cInputField.cpp Mon Sep 22 09:53:49 2003
@@ -126,7 +126,7 @@
// Add the character.
destString[cursorPos] = newChar;
- int length = strlen(destString) + 1;
+ size_t length = strlen(destString) + 1;
if (length <= maxCharCount) {
destString[length] = '\0';
} else {
@@ -156,14 +156,13 @@
break;
case SDLK_LEFT: {
- if(--cursorPos < 0) {
- cursorPos = 0;
- }
+ if(cursorPos>0)
+ cursorPos--;
}
break;
case SDLK_RIGHT: {
- int length = strlen(destString);
+ size_t length = strlen(destString);
if(++cursorPos > length) {
if (cursorPos > maxCharCount) {
cursorPos = maxCharCount - 1;
@@ -261,7 +260,7 @@
//--------------------------------------------------------------------------
void cInputField::checkCursor()
{
- if (cursorPos > int(strlen(destString))) {
+ if (cursorPos > strlen(destString)) {
cursorPos = strlen(destString);
}
} // end checkCursor
Index: netpanzer/src/Lib/View/cInputField.hpp
diff -u netpanzer/src/Lib/View/cInputField.hpp:1.5
netpanzer/src/Lib/View/cInputField.hpp:1.6
--- netpanzer/src/Lib/View/cInputField.hpp:1.5 Tue Sep 16 16:16:11 2003
+++ netpanzer/src/Lib/View/cInputField.hpp Mon Sep 22 09:53:50 2003
@@ -110,11 +110,11 @@
private:
iXY pos;
- int maxCharCount;
+ size_t maxCharCount;
char *destString;
char *excludedCharacters;
iRect bounds;
- int cursorPos;
+ size_t cursorPos;
Surface inputFieldSurface;
void reset();
Index: netpanzer/src/NetPanzer/Classes/AI/PathList.cpp
diff -u netpanzer/src/NetPanzer/Classes/AI/PathList.cpp:1.4
netpanzer/src/NetPanzer/Classes/AI/PathList.cpp:1.5
--- netpanzer/src/NetPanzer/Classes/AI/PathList.cpp:1.4 Tue Sep 16 16:16:11 2003
+++ netpanzer/src/NetPanzer/Classes/AI/PathList.cpp Mon Sep 22 09:53:50 2003
@@ -19,16 +19,7 @@
#include <assert.h>
#include "PathList.hpp"
-unsigned long DEFAULT_PATH_LIST_SIZE = 1000;
-
-PathList::PathList( void )
-{
- list = 0;
- first = 0;
- last = first;
-}
-
-PathList::PathList( long list_size )
+PathList::PathList(size_t list_size )
{
size = list_size;
first = 0;
@@ -38,30 +29,23 @@
assert( list != 0 );
}
-PathList::~PathList( void )
+PathList::PathList(const PathList& other)
{
- if( list != 0 ) {
- free( list );
- }
+ initialize(other.size);
+ *this = other;
}
-void PathList::initialize( void )
+PathList::~PathList()
{
- size = DEFAULT_PATH_LIST_SIZE;
- first = 0;
- last = first;
-
- list = (unsigned long *) malloc( sizeof(unsigned long) * size );
- assert( list != 0 );
+ free(list);
}
-
-void PathList::initialize( long list_size )
+void PathList::initialize(size_t list_size )
{
size = list_size;
- first = 0;
- last = first;
+ first = last = 0;
list = (unsigned long *) malloc( sizeof(unsigned long) * list_size );
assert( list != 0 );
}
+
Index: netpanzer/src/NetPanzer/Classes/AI/PathList.hpp
diff -u netpanzer/src/NetPanzer/Classes/AI/PathList.hpp:1.4
netpanzer/src/NetPanzer/Classes/AI/PathList.hpp:1.5
--- netpanzer/src/NetPanzer/Classes/AI/PathList.hpp:1.4 Tue Sep 16 16:16:11 2003
+++ netpanzer/src/NetPanzer/Classes/AI/PathList.hpp Mon Sep 22 09:53:50 2003
@@ -22,52 +22,37 @@
#include <string.h>
-extern unsigned long DEFAULT_PATH_LIST_SIZE;
-
class PathList
{
protected:
unsigned long *list;
- long size;
- long first;
- long last;
+ size_t size;
+ size_t first;
+ size_t last;
public:
- PathList( void );
- PathList( long list_size );
- ~PathList( void );
+ PathList(size_t list_size = 5000);
+ PathList(const PathList& other);
+ ~PathList();
- void initialize( void );
- void initialize( long list_size );
+ void initialize(size_t list_size);
- inline void reset( void )
+ inline void reset()
{
first = 0;
last = first;
}
- inline bool pushFirst( unsigned long tile )
+ inline bool pushFirst(size_t tile)
{
- long next_first;
+ size_t next_first;
next_first = (first + 1) % size;
if ( next_first == last )
return( false );
- //assert( next_first != last );
-
- /*
- // NOTE: TO BE USED FOR LIST GROWING
- if ( next_first == last )
- {
- size = size + 50;
- list = (unsigned long *) realloc( list, sizeof(unsigned long) *
size );
- assert( list != 0 );
- }
- */
first = next_first;
-
list[ first ] = tile;
return( true );
@@ -89,7 +74,7 @@
inline bool pushLast( unsigned long tile )
{
- long next_last;
+ size_t next_last;
next_last = (last - 1) % size;
@@ -99,19 +84,7 @@
if ( first == next_last )
return( false );
- //assert( first != next_last );
-
- /*
- if ( first == last )
- {
- size = size + 50;
- list = (unsigned long *) realloc( list, sizeof(unsigned long) *
size );
- assert( list != 0 );
- }
- */
-
list[ next_last ] = tile;
-
last = next_last;
return( true );
@@ -129,7 +102,7 @@
return( true );
}
- inline bool take( long count )
+ inline bool take(int count)
{
if ( (first - count) < last )
return( false );
@@ -139,7 +112,7 @@
return( true );
}
- inline bool drop( long count )
+ inline bool drop(int count)
{
if ( (last + count) > first )
return( false );
@@ -149,7 +122,7 @@
return( true );
}
- inline long listCount( void )
+ inline size_t listCount() const
{
if ( last > first )
return ( (first+1) + ( (size-1) - last ) );
@@ -157,7 +130,7 @@
return ( first - last );
}
- void operator=( PathList &rhs )
+ void operator=(const PathList &rhs)
{
PathList::first = rhs.first;
PathList::last = rhs.last;
@@ -171,8 +144,6 @@
PathList::size = rhs.size;
}
}
-
};
-
#endif // ** _PATHLIST_HPP
Index: netpanzer/src/NetPanzer/Classes/Network/ClientConnectDaemon.cpp
diff -u netpanzer/src/NetPanzer/Classes/Network/ClientConnectDaemon.cpp:1.6
netpanzer/src/NetPanzer/Classes/Network/ClientConnectDaemon.cpp:1.7
--- netpanzer/src/NetPanzer/Classes/Network/ClientConnectDaemon.cpp:1.6 Tue Sep
16 16:16:11 2003
+++ netpanzer/src/NetPanzer/Classes/Network/ClientConnectDaemon.cpp Mon Sep
22 09:53:50 2003
@@ -85,7 +85,8 @@
switch( join_request_ack_mesg->result_code ) {
case _join_request_result_success :
lobbyView.scrollAndUpdate( "Link to Server Established" );
- sprintf( buf, "Protocol Version: %d",
join_request_ack_mesg->server_protocol_version);
+ sprintf( buf, "Protocol Version: %u",
+ join_request_ack_mesg->server_protocol_version);
lobbyView.scrollAndUpdate( buf );
break;
@@ -94,7 +95,8 @@
lobbyView.scrollAndUpdate( "Incorrect Network Protocol Revision" );
lobbyView.scrollAndUpdate( "Please update your netPanzer executable
at" );
lobbyView.scrollAndUpdate( "www.nongnu.org/netpanzer" );
- sprintf( buf, "Server Protocol Version: %d",
join_request_ack_mesg->server_protocol_version);
+ sprintf( buf, "Server Protocol Version: %u",
+ join_request_ack_mesg->server_protocol_version);
lobbyView.scrollAndUpdate( buf );
connection_state = _connect_state_connect_failure;
failure_display_timer.reset();
Index: netpanzer/src/NetPanzer/Classes/Network/ConnectNetMessage.hpp
diff -u netpanzer/src/NetPanzer/Classes/Network/ConnectNetMessage.hpp:1.3
netpanzer/src/NetPanzer/Classes/Network/ConnectNetMessage.hpp:1.4
--- netpanzer/src/NetPanzer/Classes/Network/ConnectNetMessage.hpp:1.3 Tue Sep
16 16:16:11 2003
+++ netpanzer/src/NetPanzer/Classes/Network/ConnectNetMessage.hpp Mon Sep
22 09:53:51 2003
@@ -19,6 +19,7 @@
#define _CONNECTNETMESSAGE_HPP
#include <time.h>
+#include <stdint.h>
#include "NetPacket.hpp"
#include "PlayerState.hpp"
@@ -47,9 +48,9 @@
class ClientConnectJoinRequest : public NetMessage
{
public:
- DWORD client_transport_id;
+ uint32_t client_transport_id;
char code_word[24];
- DWORD protocol_version;
+ uint32_t protocol_version;
ClientConnectJoinRequest()
{
@@ -70,7 +71,7 @@
public:
int result_code;
int server_connection_state;
- DWORD server_protocol_version;
+ uint32_t server_protocol_version;
ClientConnectJoinRequestAck()
{
@@ -131,7 +132,7 @@
class ConnectProcessUpdate : public NetMessage
{
public:
- unsigned long queue_position;
+ uint32_t queue_position;
ConnectProcessUpdate()
{
@@ -153,8 +154,8 @@
class ConnectProcessStateMessage : public NetMessage
{
public:
- unsigned long message_enum;
- int percent_complete;
+ uint32_t message_enum;
+ int32_t percent_complete;
ConnectProcessStateMessage()
{
@@ -169,8 +170,8 @@
{
public:
char player_name[64];
- short player_flag;
- unsigned char unit_color;
+ int16_t player_flag;
+ uint8_t unit_color;
ConnectClientSettings()
{
@@ -191,31 +192,29 @@
class ConnectMesgServerGameSettings : public NetMessage
{
public:
- unsigned short max_players;
- unsigned short max_units;
- char map_name[32];
- int cloud_coverage;
- float wind_speed;
- int game_type;
- bool map_cycle_state;
- bool powerup_state;
- int frag_limit;
- int time_limit;
- time_t elapsed_time;
+ uint16_t max_players;
+ uint16_t max_units;
+ char map_name[32];
+ int32_t cloud_coverage;
+ float wind_speed;
+ int32_t game_type;
+ uint8_t map_cycle_state;
+ uint8_t powerup_state;
+ int32_t frag_limit;
+ int32_t time_limit;
+ time_t elapsed_time;
ConnectMesgServerGameSettings()
{
message_class = _net_message_class_connect;
message_id = _net_message_id_connect_server_game_setup;
}
-
}
__attribute__((packed));
class ConnectMesgClientGameSetupAck : public NetMessage
{
public:
-
ConnectMesgClientGameSetupAck()
{
message_class = _net_message_class_connect;
@@ -227,7 +226,6 @@
class ConnectMesgClientGameSetupPing : public NetMessage
{
public:
-
ConnectMesgClientGameSetupPing()
{
message_class = _net_message_class_connect;
@@ -253,13 +251,11 @@
class ConnectMesgNetPanzerServerDisconnect : public NetMessage
{
public:
-
ConnectMesgNetPanzerServerDisconnect()
{
message_class = _net_message_class_connect;
message_id = _net_message_id_connect_netPanzer_server_disconnect;
}
-
}
__attribute__((packed));
Index: netpanzer/src/NetPanzer/Classes/Network/NetworkState.cpp
diff -u netpanzer/src/NetPanzer/Classes/Network/NetworkState.cpp:1.5
netpanzer/src/NetPanzer/Classes/Network/NetworkState.cpp:1.6
--- netpanzer/src/NetPanzer/Classes/Network/NetworkState.cpp:1.5 Tue Sep
16 16:16:11 2003
+++ netpanzer/src/NetPanzer/Classes/Network/NetworkState.cpp Mon Sep 22
09:53:51 2003
@@ -72,11 +72,11 @@
packets_received = 0;
packets_sent_per_sec = 0;
- packets_sent_time = 0.0000001;
+ packets_sent_time = 0;
packets_sent_interval = now();
packets_received_per_sec = 0;
- packets_received_time = 0.0000001;
+ packets_received_time = 0;
packets_received_interval = now();
packets_sent_last_sec = 0;
@@ -113,7 +113,7 @@
bytes_received_last_sec = bytes_received;
packets_received_last_sec = packets_received;
packets_received_interval = stamp;
- packets_received_time += seconds;
+ packets_received_time += long(seconds);
packets_sent_per_sec = (float) packets_sent - (float)
packets_sent_last_sec;
@@ -121,11 +121,10 @@
bytes_sent_last_sec = bytes_sent;
packets_sent_last_sec = packets_sent;
packets_sent_interval = stamp;
- packets_sent_time += seconds;
+ packets_sent_time += long(seconds);
}
-
}
-
void NetworkState::logNetworkStats()
{}
+
Index: netpanzer/src/NetPanzer/Classes/Outpost.cpp
diff -u netpanzer/src/NetPanzer/Classes/Outpost.cpp:1.5
netpanzer/src/NetPanzer/Classes/Outpost.cpp:1.6
--- netpanzer/src/NetPanzer/Classes/Outpost.cpp:1.5 Tue Sep 16 16:16:11 2003
+++ netpanzer/src/NetPanzer/Classes/Outpost.cpp Mon Sep 22 09:53:50 2003
@@ -110,7 +110,6 @@
{
if( occupation_status_timer.count() ) //
{
- PlayerID null_id;
UnitBase *unit_ptr;
iRect bounding_area;
iXY occupation_pad_loc;
Index: netpanzer/src/NetPanzer/Classes/PlayerID.hpp
diff -u netpanzer/src/NetPanzer/Classes/PlayerID.hpp:1.5
netpanzer/src/NetPanzer/Classes/PlayerID.hpp:1.6
--- netpanzer/src/NetPanzer/Classes/PlayerID.hpp:1.5 Tue Sep 16 16:16:11 2003
+++ netpanzer/src/NetPanzer/Classes/PlayerID.hpp Mon Sep 22 09:53:50 2003
@@ -18,13 +18,13 @@
#ifndef _PLAYERID_HPP
#define _PLAYERID_HPP
-#include <string.h>
+#include <stdint.h>
#include "UILib/Network/Client.hpp"
class PlayerID
{
protected:
- unsigned short index_id;
+ uint16_t index_id;
Client::ID networkid;
public:
Index: netpanzer/src/NetPanzer/Classes/UnitBucketArray.cpp
diff -u netpanzer/src/NetPanzer/Classes/UnitBucketArray.cpp:1.6
netpanzer/src/NetPanzer/Classes/UnitBucketArray.cpp:1.7
--- netpanzer/src/NetPanzer/Classes/UnitBucketArray.cpp:1.6 Tue Sep 16
16:16:11 2003
+++ netpanzer/src/NetPanzer/Classes/UnitBucketArray.cpp Mon Sep 22 09:53:50 2003
@@ -265,10 +265,11 @@
traversal_ptr = traversal_ptr->next;
}
- return( 0 );
+ return 0;
}
-bool UnitBucketArray::moveUnit( UnitID unit_id, unsigned long
from_bucket_index, unsigned long to_bucket_index )
+bool UnitBucketArray::moveUnit(UnitID unit_id, unsigned long from_bucket_index,
+ unsigned long to_bucket_index )
{
bool found = false;
UnitBucketPointer *traversal_ptr;
@@ -292,14 +293,14 @@
}
if ( found == false ) {
- from_bucket_index = getUnitBucketIndex( unit_id );
- if( from_bucket_index != -1 ) {
+ long from_bucket_index = getUnitBucketIndex( unit_id );
+ if(from_bucket_index != -1) {
return( moveUnit( unit_id, from_bucket_index, to_bucket_index ) );
} else
- return( false );
+ return false;
}
- return( true );
+ return true;
}
bool UnitBucketArray::deleteUnitBucketPointer( UnitID unit_id, iXY world_loc )
Index: netpanzer/src/NetPanzer/Classes/UnitPowerUp.cpp
diff -u netpanzer/src/NetPanzer/Classes/UnitPowerUp.cpp:1.7
netpanzer/src/NetPanzer/Classes/UnitPowerUp.cpp:1.8
--- netpanzer/src/NetPanzer/Classes/UnitPowerUp.cpp:1.7 Tue Sep 16 16:16:11 2003
+++ netpanzer/src/NetPanzer/Classes/UnitPowerUp.cpp Mon Sep 22 09:53:50 2003
@@ -76,7 +76,8 @@
unit_state->max_hit_points = unit_state->hit_points;
*/
float percent = (rand() % 100) / 100;
- int new_hitpoints = unit_state->max_hit_points +
(unit_state->max_hit_points * percent);
+ int new_hitpoints = int(unit_state->max_hit_points +
+ (unit_state->max_hit_points * percent));
unit_state->hit_points = new_hitpoints;
unit_state->max_hit_points = new_hitpoints;
@@ -84,47 +85,26 @@
void UnitPowerUp::powerUpRange( UnitState *unit_state)
{
- /*
- lua_Object range;
-
- lua_pushnumber( (double) (unit_state->weapon_range) );
- lua_callfunction( lua_getglobal("UnitPowerUpRange") );
- range = lua_getresult(1);
- unit_state->weapon_range = (short) lua_getnumber( range );
- */
float percent = (((rand() % 100) / 100) * 50) / 100;
- int new_weapon_range = unit_state->weapon_range +
(unit_state->weapon_range * percent);
+ int new_weapon_range = int(unit_state->weapon_range +
+ (unit_state->weapon_range * percent));
unit_state->weapon_range = new_weapon_range;
}
void UnitPowerUp::powerUpFirePower( UnitState *unit_state)
{
- /*
- lua_Object damage_factor;
-
- lua_pushnumber( (double) (unit_state->damage_factor) );
- lua_callfunction( lua_getglobal("UnitPowerUpFirePower") );
- damage_factor = lua_getresult(1);
- unit_state->damage_factor = (short) lua_getnumber( damage_factor );
- */
int max_percent_increase = 50;
float percent = (((rand() % 100) / 100) * max_percent_increase) / 100;
- int new_damage_factor = unit_state->damage_factor +
(unit_state->damage_factor * percent);
+ int new_damage_factor = int(unit_state->damage_factor +
+ (unit_state->damage_factor * percent));
unit_state->damage_factor = new_damage_factor;
}
void UnitPowerUp::powerUpSpeed( UnitState *unit_state)
{
- /*
- lua_Object speed_factor;
-
- lua_pushnumber( (double) (unit_state->speed_factor) );
- lua_callfunction( lua_getglobal("UnitPowerUpSpeed") );
- speed_factor = lua_getresult(1);
- unit_state->speed_factor = (short) lua_getnumber( speed_factor );
- */
- int new_speed_factor = unit_state->speed_factor + floor( (((rand() % 100)
/ 100) * 5) );
+ int new_speed_factor = int(unit_state->speed_factor +
+ floor( (((rand() % 100) / 100) * 5) ));
unit_state->speed_factor = new_speed_factor;
}
@@ -135,18 +115,11 @@
void UnitPowerUp::powerUpReload( UnitState *unit_state)
{
- /*
- lua_Object reload_time;
-
- lua_pushnumber( (double) (unit_state->reload_time) );
- lua_callfunction( lua_getglobal("UnitPowerUpReload") );
- reload_time = lua_getresult(1);
- unit_state->reload_time = (short) lua_getnumber( reload_time );
- */
int max_percent_decrease = 50;
float percent = (((rand() % 100) / 100) * max_percent_decrease) / 100;
- int new_reload_time = unit_state->reload_time - (unit_state->reload_time *
percent);
+ int new_reload_time = int(unit_state->reload_time -
+ (unit_state->reload_time * percent));
unit_state->reload_time = new_reload_time;
}
Index: netpanzer/src/NetPanzer/Classes/Units/UnitGlobals.cpp
diff -u netpanzer/src/NetPanzer/Classes/Units/UnitGlobals.cpp:1.5
netpanzer/src/NetPanzer/Classes/Units/UnitGlobals.cpp:1.6
--- netpanzer/src/NetPanzer/Classes/Units/UnitGlobals.cpp:1.5 Tue Sep 16
16:16:11 2003
+++ netpanzer/src/NetPanzer/Classes/Units/UnitGlobals.cpp Mon Sep 22
09:53:51 2003
@@ -177,34 +177,6 @@
gArcherTurret.load( "units/pics/pak/ArchTNSD.pak" );
gArcherBody.load( "units/pics/pak/ArchHNSD.pak" );
- /*
- if ( gAbramsTurret.getFrameCount() < 36) assert( false );
- if ( gAbramsBody.getFrameCount() < 36) assert( false );
-
- if ( gLeopardTurret.getFrameCount() < 36) assert( false );
- if ( gLeopardBody.getFrameCount() < 36) assert( false );
-
- if ( gValentineTurret.getFrameCount() < 36) assert( false );
- if ( gValentineBody.getFrameCount() < 36) assert( false );
-
- if ( gHammerheadTurret.getFrameCount() < 36) assert( false );
- if ( gHammerheadBody.getFrameCount() < 36) assert( false );
-
- if ( gHumveeBody.getFrameCount() < 36) assert( false );
-
- if ( gLynxTurret.getFrameCount() < 36) assert( false );
- if ( gLynxBody.getFrameCount() < 36) assert( false );
-
- if ( gM109Turret.getFrameCount() < 36) assert( false );
- if ( gM109Body.getFrameCount() < 36) assert( false );
-
- if ( gSpahPanzerTurret.getFrameCount() < 36) assert( false );
- if ( gSpahPanzerBody.getFrameCount() < 36) assert( false );
-
- if ( gScorpionTurret.getFrameCount() < 36) assert( false );
- if ( gScorpionBody.getFrameCount() < 36) assert( false );
- */
-
#ifdef _GRAY_MAPPED_UNITS
Palette::init("wads/netp.act");
ColorTable gray256;
@@ -215,7 +187,9 @@
gray256.init(256);
for (int num = 0; num < 256; num++) {
int c = Palette::color[num].getBrightnessInt();
- int nearestColor = Palette::findNearestColor(RGBColor(c * grayPercent,
c * grayPercent, c * grayPercent));
+ int nearestColor = Palette::findNearestColor(
+ RGBColor(int(c * grayPercent), int(c * grayPercent),
+ int(c * grayPercent)));
gray256.setColor(num, nearestColor);
}
@@ -290,36 +264,6 @@
gArcherBodyDarkBlue.load( "units/pics/pak/ArchHNSD.pak" );
#endif
-
- /*
- if ( gAbramsTurretDarkBlue.getFrameCount() < 36) assert( false );
- if ( gAbramsBodyDarkBlue.getFrameCount() < 36) assert( false );
-
- if ( gLeopardTurretDarkBlue.getFrameCount() < 36) assert( false );
- if ( gLeopardBodyDarkBlue.getFrameCount() < 36) assert( false );
-
- if ( gValentineTurretDarkBlue.getFrameCount() < 36) assert( false );
- if ( gValentineBodyDarkBlue.getFrameCount() < 36) assert( false );
-
- if ( gHammerheadTurretDarkBlue.getFrameCount() < 36) assert( false );
- if ( gHammerheadBodyDarkBlue.getFrameCount() < 36) assert( false );
-
- if ( gHumveeBodyDarkBlue.getFrameCount() < 36) assert( false );
-
- if ( gLynxTurretDarkBlue.getFrameCount() < 36) assert( false );
- if ( gLynxBodyDarkBlue.getFrameCount() < 36) assert( false );
-
- if ( gM109TurretDarkBlue.getFrameCount() < 36) assert( false );
- if ( gM109BodyDarkBlue.getFrameCount() < 36) assert( false );
-
- if ( gSpahPanzerTurretDarkBlue.getFrameCount() < 36) assert( false );
- if ( gSpahPanzerBodyDarkBlue.getFrameCount() < 36) assert( false );
-
- if ( gScorpionTurretDarkBlue.getFrameCount() < 36) assert( false );
- if ( gScorpionBodyDarkBlue.getFrameCount() < 36) assert( false );
- */
-
-
//********** SHADOWS ************
gAbramsTurretShadow.load( "units/pics/pak/TitaTSSD.pak" );
Index: netpanzer/src/NetPanzer/Classes/Units/Vehicle.cpp
diff -u netpanzer/src/NetPanzer/Classes/Units/Vehicle.cpp:1.8
netpanzer/src/NetPanzer/Classes/Units/Vehicle.cpp:1.9
--- netpanzer/src/NetPanzer/Classes/Units/Vehicle.cpp:1.8 Tue Sep 16
16:16:11 2003
+++ netpanzer/src/NetPanzer/Classes/Units/Vehicle.cpp Mon Sep 22 09:53:51 2003
@@ -36,7 +36,8 @@
enum{ _rotate_and_move, _rotate_stop_move };
-Vehicle::Vehicle( iXY initial_loc )
+Vehicle::Vehicle(iXY initial_loc)
+ : path(1000)
{
smolderWait = 0.0f;
smolderWaitMin = 0.0f;
@@ -45,7 +46,6 @@
MapInterface::mapXYtoPointXY( initial_loc, &loc );
unit_state.location = loc;
markUnitLoc( initial_loc );
- path.initialize();
fsm_timer.changeRate( 10 );
unit_state_timer.changeRate( 10 );
setAiFsmDefendHold();
Index: netpanzer/src/NetPanzer/Classes/ViewCamera.cpp
diff -u netpanzer/src/NetPanzer/Classes/ViewCamera.cpp:1.7
netpanzer/src/NetPanzer/Classes/ViewCamera.cpp:1.8
--- netpanzer/src/NetPanzer/Classes/ViewCamera.cpp:1.7 Thu Sep 18 13:44:18 2003
+++ netpanzer/src/NetPanzer/Classes/ViewCamera.cpp Mon Sep 22 09:53:50 2003
@@ -84,8 +84,10 @@
}
}
-void ViewCamera::getViewStart( unsigned long view_size_x, unsigned long
view_size_y,
- unsigned long *view_start_x, unsigned long
*view_start_y )
+void ViewCamera::getViewStart(unsigned long view_size_x,
+ unsigned long view_size_y,
+ unsigned long *view_start_x,
+ unsigned long *view_start_y)
{
iXY map_size;
unsigned long view_offset_x;
@@ -106,10 +108,10 @@
if ( start_y < 0 )
start_y = 0;
- if ( (start_x + view_size_x) > map_size.x )
+ if ( (start_x + view_size_x) > (unsigned long) map_size.x )
start_x = (map_size.x - view_size_x) ;
- if ( (start_y + view_size_y) > map_size.y )
+ if ( (start_y + view_size_y) > (unsigned long) map_size.y )
start_y = (map_size.y - view_size_y);
loc.x = start_x + view_offset_x;
Index: netpanzer/src/NetPanzer/Classes/Weapons/BulletWeapon.cpp
diff -u netpanzer/src/NetPanzer/Classes/Weapons/BulletWeapon.cpp:1.8
netpanzer/src/NetPanzer/Classes/Weapons/BulletWeapon.cpp:1.9
--- netpanzer/src/NetPanzer/Classes/Weapons/BulletWeapon.cpp:1.8 Tue Sep
16 16:16:12 2003
+++ netpanzer/src/NetPanzer/Classes/Weapons/BulletWeapon.cpp Mon Sep 22
09:53:51 2003
@@ -42,8 +42,6 @@
{
bool end_cycle = false;
- float dt = TimerInterface::getTimeSlice();
-
do {
switch( fsmFlight_state ) {
case _fsmFlight_idle : {
@@ -52,7 +50,7 @@
break;
case _fsmFlight_in_flight : {
- if (path.increment(&location, velocity) == true ) {
+ if (path.increment(&location, (short) velocity) == true ) {
fsmFlight_state = _fsmFlight_on_target;
end_cycle = true;
} else {
Index: netpanzer/src/NetPanzer/Classes/Weapons/MissleWeapon.cpp
diff -u netpanzer/src/NetPanzer/Classes/Weapons/MissleWeapon.cpp:1.8
netpanzer/src/NetPanzer/Classes/Weapons/MissleWeapon.cpp:1.9
--- netpanzer/src/NetPanzer/Classes/Weapons/MissleWeapon.cpp:1.8 Tue Sep
16 16:16:12 2003
+++ netpanzer/src/NetPanzer/Classes/Weapons/MissleWeapon.cpp Mon Sep 22
09:53:51 2003
@@ -90,7 +90,7 @@
}
- if (path.increment(&location, velocity) == true ) {
+ if (path.increment(&location, (short) velocity) == true ) {
fsmFlight_state = _fsmFlight_on_target;
end_cycle = true;
} else {
@@ -145,7 +145,7 @@
shell.setWorldPos(location);
- iXY thrustOffset(-10.0f * direction.x, -10.0f * direction.y);
+ iXY thrustOffset(int(-10.0f * direction.x), int(-10.0f * direction.y));
thrust.setWorldPos(location + thrustOffset);
Index: netpanzer/src/NetPanzer/Classes/Weapons/ShellWeapon.cpp
diff -u netpanzer/src/NetPanzer/Classes/Weapons/ShellWeapon.cpp:1.8
netpanzer/src/NetPanzer/Classes/Weapons/ShellWeapon.cpp:1.9
--- netpanzer/src/NetPanzer/Classes/Weapons/ShellWeapon.cpp:1.8 Tue Sep 16
16:16:12 2003
+++ netpanzer/src/NetPanzer/Classes/Weapons/ShellWeapon.cpp Mon Sep 22
09:53:51 2003
@@ -35,8 +35,6 @@
ShellWeapon::ShellWeapon(UnitID &owner, unsigned short owner_type_id, unsigned
short damage, iXY &start, iXY &end)
: Weapon(owner, owner_type_id, damage, start, end)
{
- fXYZ muzzleStart(start.x + direction.x * 25, 0.0f, start.y + direction.y *
25);
-
velocity = gShellVelocity;
int frame360 = getGoalAngle(start, end);
@@ -66,8 +64,6 @@
{
bool end_cycle = false;
- float dt = TimerInterface::getTimeSlice();
-
do {
switch( fsmFlight_state ) {
case _fsmFlight_idle : {
@@ -76,7 +72,7 @@
break;
case _fsmFlight_in_flight : {
- if (path.increment(&location, velocity) == true ) {
+ if (path.increment(&location, (short) velocity) == true ) {
fsmFlight_state = _fsmFlight_on_target;
end_cycle = true;
} else {
Index: netpanzer/src/NetPanzer/Interfaces/GameManager.cpp
diff -u netpanzer/src/NetPanzer/Interfaces/GameManager.cpp:1.48
netpanzer/src/NetPanzer/Interfaces/GameManager.cpp:1.49
--- netpanzer/src/NetPanzer/Interfaces/GameManager.cpp:1.48 Sat Sep 20
18:40:15 2003
+++ netpanzer/src/NetPanzer/Interfaces/GameManager.cpp Mon Sep 22 09:53:52 2003
@@ -1402,7 +1402,7 @@
fflush(stdout);
readString(input_str, 256, stdin);
if ( strlen(input_str) > 0 ) {
- short players;
+ int players;
sscanf( input_str, "%d", &players );
GameConfig::SetNumberPlayers( players );
}
@@ -1411,7 +1411,7 @@
fflush(stdout);
readString(input_str, 256, stdin);
if ( strlen(input_str) > 0 ) {
- short units;
+ int units;
sscanf( input_str, "%d", &units );
GameConfig::SetNumberUnits( units );
}
Index: netpanzer/src/NetPanzer/Interfaces/MiniMapInterface.cpp
diff -u netpanzer/src/NetPanzer/Interfaces/MiniMapInterface.cpp:1.5
netpanzer/src/NetPanzer/Interfaces/MiniMapInterface.cpp:1.6
--- netpanzer/src/NetPanzer/Interfaces/MiniMapInterface.cpp:1.5 Tue Sep 16
16:16:12 2003
+++ netpanzer/src/NetPanzer/Interfaces/MiniMapInterface.cpp Mon Sep 22
09:53:52 2003
@@ -241,16 +241,16 @@
bool MiniMapInterface::isValidUnitMove( iXY location )
{
- location.x = location.x * scale_factor.x;
- location.y = location.y * scale_factor.y;
+ location.x = int(location.x * scale_factor.x);
+ location.y = int(location.y * scale_factor.y);
return( COMMAND_PROCESSOR.isValidMoveLocation( location ) );
}
bool MiniMapInterface::moveUnits( iXY location )
{
- location.x = location.x * scale_factor.x;
- location.y = location.y * scale_factor.y;
+ location.x = int(location.x * scale_factor.x);
+ location.y = int(location.y * scale_factor.y);
return( COMMAND_PROCESSOR.sendMoveCommandExternal( location ) );
}
Index: netpanzer/src/NetPanzer/Interfaces/ObjectiveInterface.cpp
diff -u netpanzer/src/NetPanzer/Interfaces/ObjectiveInterface.cpp:1.7
netpanzer/src/NetPanzer/Interfaces/ObjectiveInterface.cpp:1.8
--- netpanzer/src/NetPanzer/Interfaces/ObjectiveInterface.cpp:1.7 Tue Sep
16 16:16:12 2003
+++ netpanzer/src/NetPanzer/Interfaces/ObjectiveInterface.cpp Mon Sep 22
09:53:52 2003
@@ -249,7 +249,7 @@
list_size = objective_list.getSize();
- assert( objective_id < list_size );
+ assert(objective_id < short(list_size));
return( &(objective_list[ objective_id ]->objective_state) );
}
@@ -262,7 +262,7 @@
list_size = objective_list.getSize();
- assert( objective_id < list_size );
+ assert(objective_id < short(list_size));
outpost_ptr = (Outpost *) (objective_list[ objective_id ]);
Index: netpanzer/src/NetPanzer/Interfaces/PathScheduler.cpp
diff -u netpanzer/src/NetPanzer/Interfaces/PathScheduler.cpp:1.5
netpanzer/src/NetPanzer/Interfaces/PathScheduler.cpp:1.6
--- netpanzer/src/NetPanzer/Interfaces/PathScheduler.cpp:1.5 Tue Sep 16
16:16:12 2003
+++ netpanzer/src/NetPanzer/Interfaces/PathScheduler.cpp Mon Sep 22
09:53:52 2003
@@ -16,9 +16,9 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include <config.h>
-#include "PathScheduler.hpp"
-
+#include "Log.hpp"
+#include "PathScheduler.hpp"
#include "PathingState.hpp"
void PathCache::initialize( void )
@@ -35,7 +35,7 @@
cache_list.initialize( PathCache::cache_size );
for( unsigned long i = 0; i < PathCache::cache_size; i++ ) {
- cache_list[ i ].path.initialize();
+ //cache_list[ i ].path.initialize();
cache_list[ i ].valid = false;
}
@@ -69,12 +69,12 @@
return( false );
}
-void PathCache::add( PathRequest &path_request )
+void PathCache::add(PathRequest &path_request)
{
if (cache_size <= 0 )
return;
- if ( path_request.path->listCount() >= add_path_length_threshold ) {
+ if (path_request.path->listCount() >= add_path_length_threshold) {
entry_replace_index = (entry_replace_index % cache_size);
cache_list[ entry_replace_index ].set( path_request.start,
@@ -374,18 +374,19 @@
{
if( MapInterface::isMapLoaded() == true ) {
unsigned long resources;
- unsigned long path_list_size;
+ size_t path_list_size;
float map_x_size = MapInterface::getMapXsize();
float map_y_size = MapInterface::getMapYsize();
float map_size = (map_x_size * map_y_size);
resources = (unsigned long) ( (map_size * 0.019018) + 4018.0 );
- path_list_size = sqrt( (map_x_size * map_x_size) + (map_y_size *
map_y_size) );
- path_list_size = ( 0.3 * path_list_size) + path_list_size;
+ path_list_size = (size_t) sqrt( (map_x_size * map_x_size) +
(map_y_size * map_y_size) );
+ path_list_size += size_t(0.3 * path_list_size);
- if ( path_list_size > 1000 ) {
- DEFAULT_PATH_LIST_SIZE = (unsigned long) (path_list_size);
+ if ( path_list_size > 5000 ) {
+ //DEFAULT_PATH_LIST_SIZE = (unsigned long) (path_list_size);
+ LOG(("Warning: PathListSite>5000..."));
}
initialize( 200, 200, 2000, resources );
@@ -437,7 +438,8 @@
{
long path_distance_estimate;
- path_distance_estimate = (path_request.start - path_request.goal).mag2();
+ path_distance_estimate
+ = long ((path_request.start - path_request.goal).mag2());
if ( path_distance_estimate <= short_queue_distance_threshold ) {
short_request_queue.enqueue( path_request );
Index: netpanzer/src/NetPanzer/Interfaces/PathScheduler.hpp
diff -u netpanzer/src/NetPanzer/Interfaces/PathScheduler.hpp:1.6
netpanzer/src/NetPanzer/Interfaces/PathScheduler.hpp:1.7
--- netpanzer/src/NetPanzer/Interfaces/PathScheduler.hpp:1.6 Tue Sep 16
16:16:12 2003
+++ netpanzer/src/NetPanzer/Interfaces/PathScheduler.hpp Mon Sep 22
09:53:52 2003
@@ -44,7 +44,6 @@
{
memmove( this, &rhs, sizeof( PathCacheEntry ) );
}
-
};
class PathCache
@@ -61,7 +60,6 @@
unsigned long entry_replace_index;
public:
-
void initialize( void );
void initialize( unsigned long cache_size );
@@ -69,11 +67,8 @@
bool search( PathRequest &path_request );
void add( PathRequest &path_request );
-
};
-
-
enum { _path_generator_status_free,
_path_generator_status_busy,
_path_generator_status_waiting };
@@ -120,10 +115,8 @@
void pathingFsmCachePath( void );
public:
-
- void initialize( void );
-
- void initialize( unsigned long resources, unsigned long cache_size );
+ void initialize();
+ void initialize(unsigned long resources, unsigned long cache_size);
void initializePathGeneration( PathRequest &path_request );
void terminatePathGeneration( UnitID &unit_id );
@@ -145,17 +138,13 @@
return( false );
}
- void run( );
-
+ void run();
};
-
class PathRequestQueue : public QueueTemplate< PathRequest >
{
public:
-
void killRequest( UnitID &unit_id );
-
};
class PathScheduler
@@ -173,7 +162,6 @@
static long short_queue_distance_threshold;
public:
-
static void initialize( void );
static void initialize( unsigned long short_queue_size, unsigned long
long_queue_size );
@@ -203,10 +191,6 @@
static BitArray * getShortPatherSetArray( void );
static BitArray * getLongPatherSetArray( void );
-
};
-
-
-
#endif // ** _PATHSCHEDULER_HPP
Index: netpanzer/src/NetPanzer/Interfaces/PlayerInterface.cpp
diff -u netpanzer/src/NetPanzer/Interfaces/PlayerInterface.cpp:1.7
netpanzer/src/NetPanzer/Interfaces/PlayerInterface.cpp:1.8
--- netpanzer/src/NetPanzer/Interfaces/PlayerInterface.cpp:1.7 Tue Sep 16
16:16:12 2003
+++ netpanzer/src/NetPanzer/Interfaces/PlayerInterface.cpp Mon Sep 22
09:53:52 2003
@@ -61,7 +61,7 @@
player_lists[ player_index ].setStatus( _player_state_free );
player_lists[ player_index ].setFlag( 0 );
player_lists[ player_index ].unit_config.initialize( max_spawn_units );
- sprintf( temp_str, "Player %d", player_index );
+ sprintf( temp_str, "Player %lu", player_index );
player_lists[ player_index ].setName( temp_str );
}
Index: netpanzer/src/NetPanzer/Interfaces/PowerUpInterface.cpp
diff -u netpanzer/src/NetPanzer/Interfaces/PowerUpInterface.cpp:1.8
netpanzer/src/NetPanzer/Interfaces/PowerUpInterface.cpp:1.9
--- netpanzer/src/NetPanzer/Interfaces/PowerUpInterface.cpp:1.8 Tue Sep 16
16:16:12 2003
+++ netpanzer/src/NetPanzer/Interfaces/PowerUpInterface.cpp Mon Sep 22
09:53:52 2003
@@ -30,13 +30,11 @@
#include "UnitPowerUp.hpp"
#include "EnemyRadarPowerUp.hpp"
+#include "Log.hpp"
#include "NetworkState.hpp"
#include "Server.hpp"
#include "PowerUpNetMessage.hpp"
-//#include "lua.h"
-//#include "lualib.h"
-
PowerUpList PowerUpInterface::powerup_list;
int PowerUpInterface::power_up_limit;
@@ -152,8 +150,8 @@
//spawn_bound_upper = lua_getresult(2);
//spawn_bound_lower = lua_getresult(3);
- int player_factor = (( 0.10 ) * active_players);
- int power_up_limit = ( ( 0.0000625 ) * ( (map_size_x * map_size_y) ) );
+ int player_factor = int(( 0.10 ) * active_players);
+ int power_up_limit = int( ( 0.0000625 ) * ( (map_size_x * map_size_y) ) );
power_up_limit = power_up_limit + (power_up_limit * player_factor);
PowerUpInterface::power_up_limit = power_up_limit;
@@ -164,7 +162,7 @@
void PowerUpInterface::generatePowerUp( void )
{
unsigned long map_size_x, map_size_y;
- PowerUp *power_up;
+ PowerUp *power_up = 0;
float next_regen_interval;
PowerUpCreateMesg create_mesg;
iXY loc;
@@ -197,12 +195,12 @@
case _powerup_enemy_radar :
power_up = new EnemyRadarPowerUp( loc, powerup_type );
break;
+
+ default:
+ LOGGER.info("Unknown powerup type?!?");
+ return;
}
- //power_up = new BonusUnitPowerUp( loc, _powerup_bonus_units);
- //power_up = new UnitPowerUp( loc, _powerup_unit );
- //power_up = new EnemyRadarPowerUp( loc, _powerup_enemy_radar );
-
powerup_list.add( power_up );
create_mesg.set( power_up->powerup_state.map_loc,
@@ -225,7 +223,6 @@
void PowerUpInterface::initialize( void )
{
- int lua_return;
BONUS_POWERUP_ANIM.load( "powerups/Bolt.pak" );
BONUS_POWERUP_ANIM.setFPS( 15 );
BONUS_POWERUP_ANIM_SHADOW.load( "powerups/BoltS.pak" );
@@ -330,7 +327,7 @@
void PowerUpInterface::netMessagePowerUpCreate( NetMessage *message )
{
- PowerUp *power_up;
+ PowerUp *power_up = 0;
PowerUpCreateMesg *create_mesg;
create_mesg = (PowerUpCreateMesg *) message;
@@ -348,6 +345,10 @@
case _powerup_enemy_radar :
power_up = new EnemyRadarPowerUp( create_mesg->map_loc,
create_mesg->type );
break;
+
+ default:
+ LOGGER.info("Unknown powerup type?!?");
+ return;
}
power_up->powerup_state.ID = create_mesg->ID;
Index: netpanzer/src/NetPanzer/Interfaces/ProjectileInterface.cpp
diff -u netpanzer/src/NetPanzer/Interfaces/ProjectileInterface.cpp:1.7
netpanzer/src/NetPanzer/Interfaces/ProjectileInterface.cpp:1.8
--- netpanzer/src/NetPanzer/Interfaces/ProjectileInterface.cpp:1.7 Tue Sep
16 16:16:12 2003
+++ netpanzer/src/NetPanzer/Interfaces/ProjectileInterface.cpp Mon Sep 22
09:53:52 2003
@@ -87,7 +87,7 @@
//// West outer
endPos = iXY(end.x + (rand() % endRadius << 1) - endRadius, end.y +
(rand() % endRadius << 1) - endRadius);
offsetPos = Math::unitDirectionWest(direction) * startRadius * 2;
- startPos = start + iXY(offsetPos.x, offsetPos.y);
+ startPos = start + iXY(int(offsetPos.x), int(offsetPos.y));
temp = new MissleWeapon( owner, owner_type_id, damage, startPos,
endPos);
temp->addToList( &projectile_list_start, &projectile_list_end );
@@ -96,7 +96,7 @@
// West inner
endPos = iXY(end.x + (rand() % endRadius << 1) - endRadius, end.y +
(rand() % endRadius << 1) - endRadius);
offsetPos = Math::unitDirectionWest(direction) * startRadius;
- startPos = start + iXY(offsetPos.x, offsetPos.y);
+ startPos = start + iXY(int(offsetPos.x), int(offsetPos.y));
temp = new MissleWeapon( owner, owner_type_id, damage, startPos,
endPos);
temp->addToList( &projectile_list_start, &projectile_list_end );
ParticleInterface::addMissleLaunchPuff(startPos, direction,
owner_type_id);
@@ -104,7 +104,7 @@
// East inner
endPos = iXY(end.x + (rand() % endRadius << 1) - endRadius, end.y +
(rand() % endRadius << 1) - endRadius);
offsetPos = Math::unitDirectionEast(direction) * startRadius;
- startPos = start + iXY(offsetPos.x, offsetPos.y);
+ startPos = start + iXY(int(offsetPos.x), int(offsetPos.y));
temp = new MissleWeapon( owner, owner_type_id, damage, startPos,
endPos);
temp->addToList( &projectile_list_start, &projectile_list_end );
ParticleInterface::addMissleLaunchPuff(startPos, direction,
owner_type_id);
@@ -112,7 +112,7 @@
//// East outer
endPos = iXY(end.x + (rand() % endRadius << 1) - endRadius, end.y +
(rand() % endRadius << 1) - endRadius);
offsetPos = Math::unitDirectionEast(direction) * startRadius * 2;
- startPos = start + iXY(offsetPos.x, offsetPos.y);
+ startPos = start + iXY(int(offsetPos.x), int(offsetPos.y));
temp = new MissleWeapon( owner, owner_type_id, damage, startPos,
endPos);
temp->addToList( &projectile_list_start, &projectile_list_end );
ParticleInterface::addMissleLaunchPuff(startPos, direction,
owner_type_id);
@@ -146,7 +146,7 @@
// West inner
endPos = iXY(end.x + (rand() % endRadius << 1) - endRadius, end.y +
(rand() % endRadius << 1) - endRadius);
offsetPos = Math::unitDirectionWest(direction) * startRadius;
- startPos = start + iXY(offsetPos.x, offsetPos.y);
+ startPos = start + iXY(int(offsetPos.x), int(offsetPos.y));
temp = new MissleWeapon( owner, owner_type_id, damage, startPos,
endPos);
temp->addToList( &projectile_list_start, &projectile_list_end );
ParticleInterface::addMissleLaunchPuff(startPos, direction,
owner_type_id);
@@ -154,7 +154,7 @@
// East inner
endPos = iXY(end.x + (rand() % endRadius << 1) - endRadius, end.y +
(rand() % endRadius << 1) - endRadius);
offsetPos = Math::unitDirectionEast(direction) * startRadius;
- startPos = start + iXY(offsetPos.x, offsetPos.y);
+ startPos = start + iXY(int(offsetPos.x), int(offsetPos.y));
temp = new MissleWeapon( owner, owner_type_id, damage, startPos,
endPos);
temp->addToList( &projectile_list_start, &projectile_list_end );
ParticleInterface::addMissleLaunchPuff(startPos, direction,
owner_type_id);
Index: netpanzer/src/NetPanzer/Interfaces/UnitInterface.cpp
diff -u netpanzer/src/NetPanzer/Interfaces/UnitInterface.cpp:1.8
netpanzer/src/NetPanzer/Interfaces/UnitInterface.cpp:1.9
--- netpanzer/src/NetPanzer/Interfaces/UnitInterface.cpp:1.8 Tue Sep 16
16:16:12 2003
+++ netpanzer/src/NetPanzer/Interfaces/UnitInterface.cpp Mon Sep 22
09:53:52 2003
@@ -190,7 +190,6 @@
while( unit != 0 ) {
if ( unit->unit_state.lifecycle_state == _UNIT_LIFECYCLE_INACTIVE
) {
// Particle Shit Hack
- iXY loc = iXY( unit->unit_state.location.x,
unit->unit_state.location.y );
ParticleInterface::addHit(unit->unit_state);
//SFX
@@ -574,7 +573,7 @@
UnitPointer *iterator;
unsigned long list_index;
UnitPointer *closest_unit = 0;
- long closest_magnitude;
+ long closest_magnitude = 0;
for( list_index = 0; list_index < max_players; list_index++) {
if ( ( (search_flags == _search_exclude_player) &&
(player_id.getIndex() != list_index) )
@@ -593,10 +592,10 @@
if ( closest_unit == 0 ) {
closest_unit = unit_ptr;
delta = loc - unit_ptr->unit->unit_state.location;
- closest_magnitude = delta.mag2();
+ closest_magnitude = long(delta.mag2());
} else {
delta = loc - unit_ptr->unit->unit_state.location;
- temp_mag = delta.mag2();
+ temp_mag = long(delta.mag2());
if ( closest_magnitude > temp_mag ) {
closest_unit = unit_ptr;
@@ -623,7 +622,7 @@
bool UnitInterface::quearyClosestUnit( UnitBase **closest_unit_ptr, iRect
&bounding_rect, iXY &loc )
{
UnitBase *closest_unit = 0;
- long closest_magnitude;
+ long closest_magnitude = 0;
iRect bucket_rect;
UnitBucketList *bucket_list;
UnitBucketPointer *traversal_ptr;
@@ -643,10 +642,10 @@
if ( closest_unit == 0 ) {
closest_unit = traversal_ptr->unit;
delta = loc - traversal_ptr->unit->unit_state.location;
- closest_magnitude = delta.mag2();
+ closest_magnitude = long(delta.mag2());
} else {
delta = loc - traversal_ptr->unit->unit_state.location;
- temp_mag = delta.mag2();
+ temp_mag = long(delta.mag2());
if ( closest_magnitude > temp_mag ) {
closest_unit = traversal_ptr->unit;
@@ -678,7 +677,7 @@
UnitPointer *iterator;
unsigned long list_index;
UnitPointer *closest_unit = 0;
- long closest_magnitude;
+ long closest_magnitude = 0;
for( list_index = 0; list_index < max_players; list_index++) {
if ( ( player_index != list_index ) &&
@@ -694,10 +693,10 @@
if ( closest_unit == 0 ) {
closest_unit = unit_ptr;
delta = loc - unit_ptr->unit->unit_state.location;
- closest_magnitude = delta.mag2();
+ closest_magnitude = long(delta.mag2());
} else {
delta = loc - unit_ptr->unit->unit_state.location;
- temp_mag = delta.mag2();
+ temp_mag = long(delta.mag2());
if ( closest_magnitude > temp_mag ) {
closest_unit = unit_ptr;
Index: netpanzer/src/NetPanzer/Interfaces/UnitProfileInterface.cpp
diff -u netpanzer/src/NetPanzer/Interfaces/UnitProfileInterface.cpp:1.5
netpanzer/src/NetPanzer/Interfaces/UnitProfileInterface.cpp:1.6
--- netpanzer/src/NetPanzer/Interfaces/UnitProfileInterface.cpp:1.5 Tue Sep
16 16:16:12 2003
+++ netpanzer/src/NetPanzer/Interfaces/UnitProfileInterface.cpp Mon Sep 22
09:53:52 2003
@@ -122,8 +122,8 @@
str = extract_spaces( str, 0 );
while( (str[index] != 0) && (str[ index ] != token_char) ) {
- if ( str[index] == '""' )
- token_char = '""';
+ if (str[index] == '"')
+ token_char = '"';
else
if ( (str[index] != '\n') && (str[index] != '\r') ) {
token[ token_index ] = str[index];
@@ -149,14 +149,8 @@
void string_to_params( char *string, parameter_list *params )
{
- char *token_ptr;
- //**************
- short string_count=0;
-
-
params->param_count = 0;
-
if( extract_token( params->params[ params->param_count ], &string ) )
params->param_count++;
@@ -173,7 +167,6 @@
void read_vehicle_profile( char *file_path, UnitProfile *profile)
{
int field;
- char parse_str[256];
char temp_str[80];
parameter_list param_list;
int temp_int;
@@ -293,17 +286,10 @@
}
break;
} // ** switch
-
-
-
} // ** while ( !feof )
-
-
} // function
-
UnitProfile UnitProfileInterface::profile_table[ _MAX_UNIT_TYPES ];
-
void UnitProfileInterface::loadUnitProfiles( void )
{
Index: netpanzer/src/NetPanzer/Views/Game/CodeStatsView.cpp
diff -u netpanzer/src/NetPanzer/Views/Game/CodeStatsView.cpp:1.4
netpanzer/src/NetPanzer/Views/Game/CodeStatsView.cpp:1.5
--- netpanzer/src/NetPanzer/Views/Game/CodeStatsView.cpp:1.4 Tue Sep 16
16:16:12 2003
+++ netpanzer/src/NetPanzer/Views/Game/CodeStatsView.cpp Mon Sep 22
09:53:52 2003
@@ -201,14 +201,14 @@
str_loc.y += 12;
- sprintf(strBuf, "Sent %d, %.4f 1/s, %.4f Avg",NetworkState::packets_sent,
+ sprintf(strBuf, "Sent %ld, %.4f 1/s, %.4f Avg",NetworkState::packets_sent,
NetworkState::packets_sent_per_sec,
((float) NetworkState::packets_sent) / ((float)
NetworkState::packets_sent_time) );
clientArea.bltString(str_loc.x, str_loc.y, strBuf, Color::white);
str_loc.y += 12;
- sprintf(strBuf, "Recv %d, %.4f 1/s, %.4f
Avg",NetworkState::packets_received,
+ sprintf(strBuf, "Recv %ld, %.4f 1/s, %.4f
Avg",NetworkState::packets_received,
NetworkState::packets_received_per_sec,
((float) NetworkState::packets_received) / ((float)
NetworkState::packets_received_time) );
clientArea.bltString(str_loc.x, str_loc.y, strBuf, Color::white);
@@ -221,14 +221,14 @@
str_loc.y += 12;
- sprintf(strBuf, "Sent %d, %.4f 1/s, %.4f Avg",NetworkState::bytes_sent,
+ sprintf(strBuf, "Sent %ld, %.4f 1/s, %.4f Avg",NetworkState::bytes_sent,
NetworkState::bytes_sent_per_sec,
((float) NetworkState::bytes_sent) / ((float)
NetworkState::packets_sent_time) );
clientArea.bltString(str_loc.x, str_loc.y, strBuf, Color::white);
str_loc.y += 12;
- sprintf(strBuf, "Recv %d, %.4f 1/s, %.4f Avg",NetworkState::bytes_received,
+ sprintf(strBuf, "Recv %ld, %.4f 1/s, %.4f
Avg",NetworkState::bytes_received,
NetworkState::bytes_received_per_sec,
((float) NetworkState::bytes_received) / ((float)
NetworkState::packets_received_time) );
clientArea.bltString(str_loc.x, str_loc.y, strBuf, Color::white);
@@ -240,13 +240,13 @@
str_loc.y += 12;
- sprintf(strBuf, "Sent : %d, %.4f 1/s ", NetworkState::opcodes_sent,
+ sprintf(strBuf, "Sent : %ld, %.4f 1/s ", NetworkState::opcodes_sent,
NetworkState::opcodes_sent_per_sec );
clientArea.bltString(str_loc.x, str_loc.y, strBuf, Color::white);
str_loc.y += 12;
- sprintf(strBuf, "Recv : %d, %.4f 1/s", NetworkState::opcodes_received,
+ sprintf(strBuf, "Recv : %ld, %.4f 1/s", NetworkState::opcodes_received,
NetworkState::opcodes_received_per_sec );
clientArea.bltString(str_loc.x, str_loc.y, strBuf, Color::white);
@@ -305,7 +305,7 @@
str_loc.y += 12;
for ( unsigned long i = 0; i < _MAX_HEIGHT_LEVELS; i++ ) {
- sprintf(strBuf, "Level %d : %d ", i, SPRITE_SORTER.getMaxSprites( i )
);
+ sprintf(strBuf, "Level %lu : %lu ", i, SPRITE_SORTER.getMaxSprites( i
) );
clientArea.bltString(str_loc.x, str_loc.y, strBuf, Color::white);
str_loc.y += 12;
}
@@ -341,30 +341,29 @@
str_loc.y += 12;
- sprintf(strBuf, "Path Length: %d ", PathingState::path_length );
+ sprintf(strBuf, "Path Length: %ld ", PathingState::path_length );
clientArea.bltString(str_loc.x, str_loc.y, strBuf, Color::white);
str_loc.y += 12;
- sprintf(strBuf, "Paths: %d ", PathingState::path_gen_count );
+ sprintf(strBuf, "Paths: %lu ", PathingState::path_gen_count );
clientArea.bltString(str_loc.x, str_loc.y, strBuf, Color::white);
str_loc.y += 12;
- sprintf(strBuf, "Updates: %d ", PathingState::update_gen_count );
+ sprintf(strBuf, "Updates: %lu ", PathingState::update_gen_count );
clientArea.bltString(str_loc.x, str_loc.y, strBuf, Color::white);
str_loc.y += 12;
- sprintf(strBuf, "Cache Hits: %d ", PathingState::path_cache_hits );
+ sprintf(strBuf, "Cache Hits: %lu ", PathingState::path_cache_hits );
clientArea.bltString(str_loc.x, str_loc.y, strBuf, Color::white);
str_loc.y += 12;
- sprintf(strBuf, "Cache Misses: %d ", PathingState::path_cache_misses );
+ sprintf(strBuf, "Cache Misses: %lu ", PathingState::path_cache_misses );
clientArea.bltString(str_loc.x, str_loc.y, strBuf, Color::white);
-
}
//---------------------------------------------------------------------------
@@ -390,7 +389,7 @@
units = UnitInterface::getUnitCount( i );
total += units;
- sprintf(strBuf, "Player %d : %d ", i, units);
+ sprintf(strBuf, "Player %d : %lu ", i, units);
clientArea.bltString(str_loc.x, str_loc.y, strBuf, Color::white);
str_loc.y += 12;
}
Index: netpanzer/src/NetPanzer/Views/Game/ControlPaletteView.cpp
diff -u netpanzer/src/NetPanzer/Views/Game/ControlPaletteView.cpp:1.6
netpanzer/src/NetPanzer/Views/Game/ControlPaletteView.cpp:1.7
--- netpanzer/src/NetPanzer/Views/Game/ControlPaletteView.cpp:1.6 Tue Sep
16 16:16:12 2003
+++ netpanzer/src/NetPanzer/Views/Game/ControlPaletteView.cpp Mon Sep 22
09:53:53 2003
@@ -70,7 +70,6 @@
//---------------------------------------------------------------------------
void ControlPaletteView::doDraw(const Surface &viewArea, const Surface
&clientArea)
{
- FUNC("ControlPaletteView::doDraw");
assert(this != 0);
assert(viewArea.getDoesExist());
assert(clientArea.getDoesExist());
Index: netpanzer/src/NetPanzer/Views/Game/GameInfoView.cpp
diff -u netpanzer/src/NetPanzer/Views/Game/GameInfoView.cpp:1.7
netpanzer/src/NetPanzer/Views/Game/GameInfoView.cpp:1.8
--- netpanzer/src/NetPanzer/Views/Game/GameInfoView.cpp:1.7 Tue Sep 16
16:16:12 2003
+++ netpanzer/src/NetPanzer/Views/Game/GameInfoView.cpp Mon Sep 22 09:53:53 2003
@@ -106,8 +106,8 @@
void GameInfoView::doDraw(const Surface &viewArea, const Surface &clientArea)
{
char unitsBuf[64];
- char killsBuf[64];
- char lossesBuf[64];
+ //char killsBuf[64];
+ //char lossesBuf[64];
char fragsBuf[64];
char timeBuf[64];
char pingBuf[64];
Index: netpanzer/src/NetPanzer/Views/Game/LobbyView.cpp
diff -u netpanzer/src/NetPanzer/Views/Game/LobbyView.cpp:1.10
netpanzer/src/NetPanzer/Views/Game/LobbyView.cpp:1.11
--- netpanzer/src/NetPanzer/Views/Game/LobbyView.cpp:1.10 Tue Sep 16
16:16:12 2003
+++ netpanzer/src/NetPanzer/Views/Game/LobbyView.cpp Mon Sep 22 09:53:53 2003
@@ -59,8 +59,6 @@
moveTo(0, 0);
resize(640, 480);
- iXY size(getClientRect().getSize());
-
addButtonCenterText(iXY(628 - 60, 302 - 15), 60, "Abort", "Cancel the
joining of this game.", bAbort);
currentline = 0;
Index: netpanzer/src/NetPanzer/Views/Game/MiniMapView.cpp
diff -u netpanzer/src/NetPanzer/Views/Game/MiniMapView.cpp:1.10
netpanzer/src/NetPanzer/Views/Game/MiniMapView.cpp:1.11
--- netpanzer/src/NetPanzer/Views/Game/MiniMapView.cpp:1.10 Tue Sep 16
16:16:12 2003
+++ netpanzer/src/NetPanzer/Views/Game/MiniMapView.cpp Mon Sep 22 09:53:53 2003
@@ -319,7 +319,7 @@
if (value == -1) {
float dt = TimerInterface::getTimeSlice();
- destSize += scaleDelta * dt;
+ destSize += int(scaleDelta * dt);
} else {
destSize += value;
}
@@ -394,7 +394,7 @@
if (value == -1) {
float dt = TimerInterface::getTimeSlice();
- destSize -= scaleDelta * dt;
+ destSize -= int(scaleDelta * dt);
} else {
destSize -= value;
}
Index: netpanzer/src/NetPanzer/Views/Game/ProgressView.cpp
diff -u netpanzer/src/NetPanzer/Views/Game/ProgressView.cpp:1.10
netpanzer/src/NetPanzer/Views/Game/ProgressView.cpp:1.11
--- netpanzer/src/NetPanzer/Views/Game/ProgressView.cpp:1.10 Tue Sep 16
16:16:12 2003
+++ netpanzer/src/NetPanzer/Views/Game/ProgressView.cpp Mon Sep 22 09:53:53 2003
@@ -52,9 +52,6 @@
moveTo(0, 0);
resize(640, 480);
-
- iXY size(getClientRect().getSize());
-
} // end ProgressView::init
// doDraw
Index: netpanzer/src/NetPanzer/Views/Game/RankView.cpp
diff -u netpanzer/src/NetPanzer/Views/Game/RankView.cpp:1.5
netpanzer/src/NetPanzer/Views/Game/RankView.cpp:1.6
--- netpanzer/src/NetPanzer/Views/Game/RankView.cpp:1.5 Tue Sep 16 16:16:12 2003
+++ netpanzer/src/NetPanzer/Views/Game/RankView.cpp Mon Sep 22 09:53:53 2003
@@ -42,7 +42,6 @@
const unsigned MAX_KILLS_CHARS = 6;
const unsigned MAX_LOSSES_CHARS = 7;
const unsigned MAX_POINTS_CHARS = 7;
- const unsigned MAX_OBJECTIVE_CHARS = 10;
//addLabel(iXY nPos, char *nLabel, BYTE color);
unsigned xOffset = 0;
Index: netpanzer/src/NetPanzer/Views/Game/VehicleSelectionView.cpp
diff -u netpanzer/src/NetPanzer/Views/Game/VehicleSelectionView.cpp:1.9
netpanzer/src/NetPanzer/Views/Game/VehicleSelectionView.cpp:1.10
--- netpanzer/src/NetPanzer/Views/Game/VehicleSelectionView.cpp:1.9 Tue Sep
16 17:46:14 2003
+++ netpanzer/src/NetPanzer/Views/Game/VehicleSelectionView.cpp Mon Sep 22
09:53:53 2003
@@ -542,8 +542,8 @@
// Calculate the starting point on the outside of the
vehicleSelectionView box.
fXY v2oSlope(Math::unitDirection(a, b));
- a.x += v2oSlope.x * float(VehicleSelectionView::getSizeX() / 2);
- a.y += v2oSlope.y * float(VehicleSelectionView::getSizeY() / 2);
+ a.x += int(v2oSlope.x * float(VehicleSelectionView::getSizeX() /
2));
+ a.y += int(v2oSlope.y * float(VehicleSelectionView::getSizeY() /
2));
// Calculate the starting point on the outside of the objective
box.
iXY objectiveOutlineSize(3, 3);
@@ -559,7 +559,7 @@
//bltBlendRect(screen, r);
screen.fillRect(r, Color::white);
- int xOffset =
(strlen(WorldInputCmdProcessor::getSelectedObjectiveName()) * CHAR_XPIX) / 2;
+ //int xOffset =
(strlen(WorldInputCmdProcessor::getSelectedObjectiveName()) * CHAR_XPIX) / 2;
//screen.bltStringShadowed(r.min.x - xOffset, r.min.y - 15,
WorldInputCmdProcessor::getSelectedObjectiveName(), Color::white, Color::black);
@@ -800,7 +800,11 @@
sprintf(productionUnitBuf, "Production: %s",
getUnitName(outpostStatus.unit_generation_type));
checkMiniProductionRect(productionUnitBuf);
- sprintf(timeLeftBuf, "Time Left: %01d:%02d",
((int)outpostStatus.unit_generation_time_remaining + 1) / 60,
((int)outpostStatus.unit_generation_time_remaining) % 60,
((int)outpostStatus.unit_generation_time + 1) / 60);
+ sprintf(timeLeftBuf, "Time Left: %01d:%02d",
+ ((int)outpostStatus.unit_generation_time_remaining
+ + 1) / 60,
+ ((int)outpostStatus.unit_generation_time_remaining)
+ % 60);
checkMiniProductionRect(timeLeftBuf);
dest.bltLookup(miniProductionRect,
Palette::darkGray256.getColorArray());
@@ -921,10 +925,10 @@
maxAttackFactor = profile.attack_factor;
}
if (sqrt(profile.attack_range) > maxAttackRange) {
- maxAttackRange = sqrt(profile.attack_range);
+ maxAttackRange = int(sqrt(profile.attack_range));
}
if (sqrt(profile.defend_range) > maxDefendRange) {
- maxDefendRange = sqrt(profile.defend_range);
+ maxDefendRange = int(sqrt(profile.defend_range));
}
if (profile.speed_factor + profile.speed_rate > maxTotalSpeed) {
maxTotalSpeed = profile.speed_factor + profile.speed_rate;
@@ -983,31 +987,9 @@
void VehicleSelectionView::drawBar(const Surface &dest, const iXY &pos, int
length, float percent)
{
- const PIX tickColor = Color::white;
-
iXY size(int(float(length) * percent), CHAR_YPIX);
dest.fillRect(iRect(pos.x, pos.y, pos.x + size.x, pos.y + size.y),
Color::red);
-
- // Draw tick marks.
-
- //// Draw 3 major
- //int topY = pos.y + size.y / 2;
- //int bottomY = pos.y + size.y;
- //
- //dest.drawVLine(pos.x + 0, topY, bottomY, tickColor);
- //dest.drawVLine(pos.x + length / 2 - 1, topY, bottomY, tickColor);
- //dest.drawVLine(pos.x + length - 1, topY, bottomY, tickColor);
- //
- //// Draw 4 minor
- //int oneSixth = length / 6;
- //topY = pos.y + size.y - size.y / 4;
- //bottomY = pos.y + size.y;
- //
- //dest.drawVLine(pos.x + oneSixth - 1, topY, bottomY, tickColor);
- //dest.drawVLine(pos.x + oneSixth * 2 - 1, topY, bottomY, tickColor);
- //dest.drawVLine(pos.x + oneSixth * 4 - 1, topY, bottomY, tickColor);
- //dest.drawVLine(pos.x + oneSixth * 5 - 1, topY, bottomY, tickColor);
}
// actionPerformed
Index:
netpanzer/src/NetPanzer/Views/MainMenu/Multi/DirectPlayErrorExceptionView.cpp
diff -u
netpanzer/src/NetPanzer/Views/MainMenu/Multi/DirectPlayErrorExceptionView.cpp:1.5
netpanzer/src/NetPanzer/Views/MainMenu/Multi/DirectPlayErrorExceptionView.cpp:1.6
---
netpanzer/src/NetPanzer/Views/MainMenu/Multi/DirectPlayErrorExceptionView.cpp:1.5
Tue Sep 16 16:16:13 2003
+++
netpanzer/src/NetPanzer/Views/MainMenu/Multi/DirectPlayErrorExceptionView.cpp
Mon Sep 22 09:53:53 2003
@@ -53,14 +53,11 @@
resize(SCREEN_PIX);
iXY buttonSize(70, 15);
- int BUTTON_COUNT = 2;
int x = (getClientRect().getSize().x - (buttonSize.x * 2 + 12))
/ 2;
int y;
- int yOffset = buttonSize.y * 2;
y = SCREEN_YCENTER + 30;
addButtonCenterText(iXY(x, y), buttonSize.x, "OK", "", bOK);
-
} // end DirectPlayErrorExceptionView::init
// doDraw
Index: netpanzer/src/NetPanzer/Views/MainMenu/Multi/GetSessionHostView.cpp
diff -u netpanzer/src/NetPanzer/Views/MainMenu/Multi/GetSessionHostView.cpp:1.6
netpanzer/src/NetPanzer/Views/MainMenu/Multi/GetSessionHostView.cpp:1.7
--- netpanzer/src/NetPanzer/Views/MainMenu/Multi/GetSessionHostView.cpp:1.6
Tue Sep 16 16:16:13 2003
+++ netpanzer/src/NetPanzer/Views/MainMenu/Multi/GetSessionHostView.cpp Mon Sep
22 09:53:54 2003
@@ -72,8 +72,8 @@
maxViewableItems = getClientRect().getSizeY() / (TEXT_GAP_SPACE +
CHAR_YPIX) - 1;
topViewableItem = 0;
- iXY size(20, 20);
- iXY pos(getClientRect().getSizeX() - size.x, 0);
+ //iXY size(20, 20);
+ //iXY pos(getClientRect().getSizeX() - size.x, 0);
//upButton.setLabel("+");
//upButton.setBounds(iRect(pos, pos + size));
@@ -244,7 +244,7 @@
if (hosts.getCount() > 0 && selectedItem != -1 && selectedItem <
hosts.getCount()) {
sprintf(curHostName, "%s", hosts[selectedItem].getName());
} else {
- sprintf(curHostName, "");
+ strcpy(curHostName, "");
}
hosts.setNum(0);
Index: netpanzer/src/NetPanzer/Views/MainMenu/Multi/HostJoinTemplateView.cpp
diff -u
netpanzer/src/NetPanzer/Views/MainMenu/Multi/HostJoinTemplateView.cpp:1.10
netpanzer/src/NetPanzer/Views/MainMenu/Multi/HostJoinTemplateView.cpp:1.11
--- netpanzer/src/NetPanzer/Views/MainMenu/Multi/HostJoinTemplateView.cpp:1.10
Tue Sep 16 16:16:13 2003
+++ netpanzer/src/NetPanzer/Views/MainMenu/Multi/HostJoinTemplateView.cpp
Mon Sep 22 09:53:54 2003
@@ -419,8 +419,7 @@
{
MenuTemplateView::doDraw(viewArea, clientArea);
- iXY pos(420, 38);
-
+ //iXY pos(420, 38);
//clientArea.bltString(pos, "Are You", Color::white);
// Display the game type.
Index: netpanzer/src/NetPanzer/Views/MainMenu/Multi/HostOptionsView.cpp
diff -u netpanzer/src/NetPanzer/Views/MainMenu/Multi/HostOptionsView.cpp:1.4
netpanzer/src/NetPanzer/Views/MainMenu/Multi/HostOptionsView.cpp:1.5
--- netpanzer/src/NetPanzer/Views/MainMenu/Multi/HostOptionsView.cpp:1.4
Tue Sep 16 16:16:13 2003
+++ netpanzer/src/NetPanzer/Views/MainMenu/Multi/HostOptionsView.cpp Mon Sep
22 09:53:54 2003
@@ -172,27 +172,27 @@
switch (cloudCoverageCount) {
case 0: {
cloudCoverageString = "Clear";
- GameConfig::setCloudCoverage(clearCloudCount);
+ GameConfig::setCloudCoverage(int(clearCloudCount));
}
break;
case 1: {
cloudCoverageString = "Broken";
- GameConfig::setCloudCoverage(brokenCloudCount);
+ GameConfig::setCloudCoverage(int(brokenCloudCount));
}
break;
case 2: {
cloudCoverageString = "Partly Cloudy";
- GameConfig::setCloudCoverage(partlyCloudyCloudCount);
+ GameConfig::setCloudCoverage(int(partlyCloudyCloudCount));
}
break;
case 3: {
cloudCoverageString = "Overcast";
- GameConfig::setCloudCoverage(overcastCloudCount);
+ GameConfig::setCloudCoverage(int(overcastCloudCount));
}
break;
case 4: {
cloudCoverageString = "Extremely Cloudy";
- GameConfig::setCloudCoverage(fuckingCloudyCloudCount);
+ GameConfig::setCloudCoverage(int(fuckingCloudyCloudCount));
}
break;
}
@@ -348,7 +348,7 @@
static int getObjectiveCapturePercent()
{
- return( GameConfig::getObjectiveOccuapationPercentage() );
+ return int(GameConfig::getObjectiveOccuapationPercentage());
}
static void bIncreaseObjectiveCapturePercent()
@@ -540,18 +540,8 @@
{
char strBuf[256];
- const int xTextStart = pos.x;
const int arrowButtonWidth = 16;
const int yOffset = 15;
- const int buttonStartY = pos.y;
-
- // Draw a border around the meters.
- iXY shit(30, buttonStartY - 20);
- //iXY size(SCREEN_XPIX - 60, 154);
- //iXY size(SCREEN_XPIX - 60, 140);
- //iRect meterBorder(shit.x, shit.y, shit.x + size.x, shit.y + size.y);
- //dest.bltLookup(meterBorder, Palette::darkGray256.getColorArray());
- //dest.drawButtonBorder(meterBorder, Color::lightGreen, Color::darkGreen);
int x = pos.x + 270 + arrowButtonWidth;
int y = pos.y;
@@ -564,14 +554,6 @@
sprintf(strBuf, "%d", getCurMaxPlayersCount());
tempSurface.bltStringCenter(strBuf, meterTextColor);
tempSurface.blt(dest, x, y);
- /*
- meterUsageXSize = tempSurface.getPixX() / getCurMaxPlayersCount();
- if (meterUsageXSize < 3) { meterUsageXSize = 3; }
- visualMeter = iRect(0, 0, meterUsageXSize, 14);
- percent = getCurMaxPlayersCount() / getMaxPlayersCount();
- visualMeter.translate(iXY(percent * tempSurface.getPixX(), 0));
- tempSurface.fillRect(visualMeter, Color::red);
- */
// Game Max Unit Count
y += yOffset;
Index: netpanzer/src/NetPanzer/Views/MainMenu/Multi/IPAddressView.cpp
diff -u netpanzer/src/NetPanzer/Views/MainMenu/Multi/IPAddressView.cpp:1.7
netpanzer/src/NetPanzer/Views/MainMenu/Multi/IPAddressView.cpp:1.8
--- netpanzer/src/NetPanzer/Views/MainMenu/Multi/IPAddressView.cpp:1.7 Tue Sep
16 16:16:13 2003
+++ netpanzer/src/NetPanzer/Views/MainMenu/Multi/IPAddressView.cpp Mon Sep
22 09:53:54 2003
@@ -30,7 +30,6 @@
{
ConnectionAddress address;
char * szServerName;
- int ret_val;
szServerName = (char *)IPAddressView::szServer.getString();
Index: netpanzer/src/NetPanzer/Views/MainMenu/Multi/UnitColorView.cpp
diff -u netpanzer/src/NetPanzer/Views/MainMenu/Multi/UnitColorView.cpp:1.7
netpanzer/src/NetPanzer/Views/MainMenu/Multi/UnitColorView.cpp:1.8
--- netpanzer/src/NetPanzer/Views/MainMenu/Multi/UnitColorView.cpp:1.7 Tue Sep
16 16:16:13 2003
+++ netpanzer/src/NetPanzer/Views/MainMenu/Multi/UnitColorView.cpp Mon Sep
22 09:53:54 2003
@@ -55,7 +55,9 @@
gray256.init(256);
for (int num = 0; num < 256; num++) {
int c = Palette::color[num].getBrightnessInt();
- int nearestColor = (int) Palette::findNearestColor(RGBColor(c *
grayPercent, c * grayPercent, c * grayPercent));
+ int nearestColor = Palette::findNearestColor(
+ RGBColor(int(c * grayPercent), int(c * grayPercent),
+ int(c * grayPercent)));
gray256.setColor(num, nearestColor);
}
gray256.setColor(255, 0);
Index: netpanzer/src/NetPanzer/Views/MainMenu/Options/InterfaceView.cpp
diff -u netpanzer/src/NetPanzer/Views/MainMenu/Options/InterfaceView.cpp:1.5
netpanzer/src/NetPanzer/Views/MainMenu/Options/InterfaceView.cpp:1.6
--- netpanzer/src/NetPanzer/Views/MainMenu/Options/InterfaceView.cpp:1.5
Tue Sep 16 16:16:13 2003
+++ netpanzer/src/NetPanzer/Views/MainMenu/Options/InterfaceView.cpp Mon Sep
22 09:53:54 2003
@@ -51,12 +51,12 @@
static int getMiniMapResizeRate()
{
- return GameConfig::getMiniMapResizeRate();
+ return int(GameConfig::getMiniMapResizeRate());
}
static int getConsoleTextDelay()
{
- return GameConfig::getConsoleTextDelay();
+ return int(GameConfig::getConsoleTextDelay());
}
static int getConsoleTextScreenPercent()
@@ -121,7 +121,6 @@
int y = bodyTextRect.min.y;
int yOffset = 15;
- int buttonXSize = 90;
int arrowButtonWidth = 16;
// Settings
@@ -184,9 +183,6 @@
char strBuf[256];
const int arrowButtonWidth = 16;
- iRect visualMeter;
- int meterUsageXSize = 0;
- float percent = 0.0f;
int x = optionsMeterStartX + arrowButtonWidth;
int y = bodyTextRect.min.y + 15;
int yOffset = 15;
@@ -239,5 +235,4 @@
void InterfaceView::loadTitleSurface()
{
doLoadTitleSurface("pics/backgrounds/menus/menu/til/interfaceTitle.til");
-
} // end InterfaceView::loadTitleSurface
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [netPanzer-CVS] netpanzer ./ChangeLog ./TODO src/Lib/Log.hpp sr...,
Matthias Braun <=