[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[netPanzer-CVS] netpanzer/src ChangeLog Lib/FindFirst.hpp Lib/U...
From: |
Matthias Braun |
Subject: |
[netPanzer-CVS] netpanzer/src ChangeLog Lib/FindFirst.hpp Lib/U... |
Date: |
Tue, 09 Sep 2003 13:16:13 -0400 |
CVSROOT: /cvsroot/netpanzer
Module name: netpanzer
Branch:
Changes by: Matthias Braun <address@hidden> 03/09/09 13:16:13
Modified files:
src : ChangeLog
src/Lib : FindFirst.hpp Util.hpp cGrowList.hpp
codewiz.hpp
src/Lib/2D : PackedSurface.cpp Surface.cpp Surface.hpp
src/Lib/Particles: ChunkTrajectoryParticle2D.cpp
ParticleSystem2D.cpp
SmokingTrajectoryParticle2D.cpp
VectorPuffParticle2D.cpp
src/Lib/Types : fRect.cpp fRect.hpp fXY.hpp iRect.cpp
src/Lib/View : Choice.cpp Desktop.cpp Desktop.hpp View.cpp
cButton.hpp
src/NetPanzer/Views/Game: ControlPaletteView.cpp ControlView.cpp
MiniMapView.cpp MiniRankView.hpp
Added files:
src/NetPanzer/Views/Game: MiniRankView.cpp
Removed files:
src/NetPanzer/Views/Game: _MiniMapView.cpp _MiniMapView.hpp
Log message:
eleminated isValidPtr, Util.hpp and GOTTA_HAVE_IT from codewiz.hpp
Patches:
Index: netpanzer/src/ChangeLog
diff -u netpanzer/src/ChangeLog:1.13 netpanzer/src/ChangeLog:1.14
--- netpanzer/src/ChangeLog:1.13 Tue Sep 9 12:21:06 2003
+++ netpanzer/src/ChangeLog Tue Sep 9 13:16:11 2003
@@ -3,6 +3,7 @@
is overloaded, but laste C++ draft doesn't allow to return 0 from such an
overloaded new.) I added exceptions and lots of try {} catch{} blocks, let's
hope I didn't miss something.
+-eleminated isValidPtr, Util.hpp and GOTTA_HAVE_IT from codewiz.hpp
8-Sep-2003 by Matze Braun
-added some basic music plying support (all files in sfx/music are played in
Index: netpanzer/src/Lib/2D/PackedSurface.cpp
diff -u netpanzer/src/Lib/2D/PackedSurface.cpp:1.6
netpanzer/src/Lib/2D/PackedSurface.cpp:1.7
--- netpanzer/src/Lib/2D/PackedSurface.cpp:1.6 Mon Sep 8 12:46:22 2003
+++ netpanzer/src/Lib/2D/PackedSurface.cpp Tue Sep 9 13:16:12 2003
@@ -17,9 +17,6 @@
*/
#include <config.h>
-#ifdef WIN32
-#include <io.h>
-#endif
#include "FindFirst.hpp"
#include "PackedSurface.hpp"
#include "Surface.hpp"
@@ -405,7 +402,7 @@
/*
void PackedSurface::setTo(const PackedSurface &source, iRect bounds)
{
- assert(isValidPtr(this));
+ assert(this != 0);
free();
reset();
@@ -438,7 +435,7 @@
//---------------------------------------------------------------------------
void PackedSurface::setTo(const PackedSurface &source)
{
- assert(isValidPtr(this));
+ assert(this != 0);
free();
Index: netpanzer/src/Lib/2D/Surface.cpp
diff -u netpanzer/src/Lib/2D/Surface.cpp:1.14
netpanzer/src/Lib/2D/Surface.cpp:1.15
--- netpanzer/src/Lib/2D/Surface.cpp:1.14 Mon Sep 8 18:50:28 2003
+++ netpanzer/src/Lib/2D/Surface.cpp Tue Sep 9 13:16:12 2003
@@ -17,10 +17,7 @@
*/
#include <config.h>
-#ifdef WIN32
-#include <io.h>
-#endif
-
+#include <algorithm>
#include "FindFirst.hpp"
#include "Surface.hpp"
#include "UtilInterface.hpp"
@@ -31,6 +28,43 @@
#include "Span.hpp"
#include "Exception.hpp"
+using std::swap;
+using std::min;
+using std::max;
+
+// orderCoords
+//---------------------------------------------------------------------------
+// Purpose: Orders a pair of (x,y) coordinates
+//---------------------------------------------------------------------------
+template <class T>
+inline void orderCoords(T &a, T &b)
+{
+ if (a > b) swap(a, b);
+} // end orderCoords
+
+// orderCoords
+//---------------------------------------------------------------------------
+// Purpose: Orders a 2 pairs of (x,y) coordinates, making sure x1 <= x2 and y1
<= y2.
+//---------------------------------------------------------------------------
+template <class T>
+inline void orderCoords(T &x1, T &y1, T &x2, T &y2)
+{
+ if (x1 > x2) swap(x1, x2);
+ if (y1 > y2) swap(y1, y2);
+} // end orderCoords
+
+inline void orderCoords(iRect &bounds)
+{
+ if (bounds.min.x > bounds.max.x)
+ {
+ swap(bounds.min.x, bounds.max.x);
+ }
+ if (bounds.min.y > bounds.max.y)
+ {
+ swap(bounds.min.y, bounds.max.y);
+ }
+} // end orderCoords
+
#ifdef MSVC
#pragma pack(1)
#endif
@@ -146,7 +180,7 @@
//---------------------------------------------------------------------------
Surface::Surface()
{
- assert(isValidPtr(this));
+ assert(this != 0);
reset();
@@ -158,7 +192,7 @@
//---------------------------------------------------------------------------
Surface::Surface(bool nMyMem)
{
- assert(isValidPtr(this));
+ assert(this != 0);
reset();
myMem = nMyMem;
@@ -173,7 +207,7 @@
//---------------------------------------------------------------------------
Surface::Surface(const iXY &nPix, int nStride, int nFrameCount)
{
- assert(isValidPtr(this));
+ assert(this != 0);
reset();
alloc(nPix, true, nStride, nFrameCount);
@@ -188,7 +222,7 @@
//---------------------------------------------------------------------------
Surface::Surface(int xPix, int yPix, int nStride, int nFrameCount)
{
- assert(isValidPtr(this));
+ assert(this != 0);
reset();
create(iXY(xPix, yPix), nStride, nFrameCount);
@@ -202,7 +236,7 @@
//---------------------------------------------------------------------------
Surface::Surface(const Surface &source, const iXY &min, const iXY &max, bool
doGrab)
{
- assert(isValidPtr(this));
+ assert(this != 0);
assert(source.getDoesExist());
reset();
@@ -227,7 +261,7 @@
Surface::Surface(void *nFrame0, const iXY &nPix, int nStride, int nFrameCount)
{
assert(nFrame0 != 0);
- assert(isValidPtr(this));
+ assert(this != 0);
reset();
setTo(nFrame0, nPix, nStride, nFrameCount);
@@ -276,7 +310,7 @@
//---------------------------------------------------------------------------
void Surface::reset()
{
- assert(isValidPtr(this));
+ assert(this != 0);
pix = 0;
stride = 0;
@@ -300,7 +334,7 @@
void Surface::setOffsetCenter()
{
assert(getDoesExist());
- assert(isValidPtr(this));
+ assert(this != 0);
offset = iXY(-center.x, -center.y);
@@ -317,7 +351,7 @@
int stride,
int frameCount)
{
- assert(isValidPtr(this));
+ assert(this != 0);
free();
@@ -381,7 +415,7 @@
void Surface::resize(const iXY &pix)
{
assert(getDoesExist());
- assert(isValidPtr(this));
+ assert(this != 0);
create(pix, pix.x, frameCount);
@@ -396,7 +430,7 @@
void Surface::setTo(const Surface &source, iRect bounds)
{
assert(source.getDoesExist());
- assert(isValidPtr(this));
+ assert(this != 0);
free();
orderCoords(bounds);
@@ -424,7 +458,7 @@
int frameCount)
{
assert(frame0 != 0);
- assert(isValidPtr(this));
+ assert(this != 0);
free();
@@ -447,7 +481,7 @@
//---------------------------------------------------------------------------
void Surface::setTo(const Surface &source)
{
- assert(isValidPtr(this));
+ assert(this != 0);
assert(source.getDoesExist());
free();
@@ -475,7 +509,7 @@
int stride)
{
assert(source.getDoesExist());
- assert(isValidPtr(this));
+ assert(this != 0);
free();
orderCoords(bounds);
@@ -502,7 +536,7 @@
assert(screenLocked);
assert(getDoesExist());
assert(dest.getDoesExist());
- assert(isValidPtr(this));
+ assert(this != 0);
// Add in the offset factor.
min += offset;
@@ -600,7 +634,7 @@
assert(screenLocked);
assert(getDoesExist());
assert(dest.getDoesExist());
- assert(isValidPtr(this));
+ assert(this != 0);
// Add in the offset factor.
min += offset;
@@ -714,7 +748,7 @@
assert(screenLocked);
assert(getDoesExist());
assert(dest.getDoesExist());
- assert(isValidPtr(this));
+ assert(this != 0);
// Add in the offset factor.
min += offset;
@@ -812,7 +846,7 @@
{
assert(screenLocked);
assert(getDoesExist());
- assert(isValidPtr(this));
+ assert(this != 0);
// Check for trivial rejection
if (y < 0 || x2 <= 0 || y >= pix.y || x1 >= pix.x) return;
@@ -849,7 +883,7 @@
{
assert(screenLocked);
assert(getDoesExist());
- assert(isValidPtr(this));
+ assert(this != 0);
// Check for trivial rejection
if (x < 0 || y2 <= 0 || x >= pix.x || y1 >= pix.y) return;
@@ -899,7 +933,7 @@
{
assert(screenLocked);
assert(getDoesExist());
- assert(isValidPtr(this));
+ assert(this != 0);
if (pix.x == 0 || pix.y == 0) return;
@@ -928,7 +962,7 @@
{
assert(screenLocked);
assert(getDoesExist());
- assert(isValidPtr(this));
+ assert(this != 0);
if (pix == 0) return;
@@ -969,7 +1003,7 @@
{
assert(screenLocked);
assert(getDoesExist());
- assert(isValidPtr(this));
+ assert(this != 0);
if (pix == 0) return;
@@ -1001,7 +1035,7 @@
{
assert(screenLocked);
assert(getDoesExist());
- assert(isValidPtr(this));
+ assert(this != 0);
// Check for horizontal lines
if (y1 == y2)
@@ -1102,7 +1136,7 @@
void Surface::extractPCX(const char *filename, int nCols, int gapSpace)
{
assert(getDoesExist());
- assert(isValidPtr(this));
+ assert(this != 0);
Surface pcx;
pcx.loadPCX(filename);
@@ -1169,7 +1203,7 @@
void Surface::loadPCX(const char *fileName, bool needAlloc /* = true */,
void *returnPalette /* = 0 */)
{
- assert(isValidPtr(this));
+ assert(this != 0);
if (needAlloc) free();
@@ -1244,7 +1278,7 @@
void Surface::flipHorizontal()
{
assert(getDoesExist());
- assert(isValidPtr(this));
+ assert(this != 0);
Surface tempSurface(pix, stride, 1);
@@ -1273,7 +1307,7 @@
void Surface::flipVertical()
{
assert(getDoesExist());
- assert(isValidPtr(this));
+ assert(this != 0);
Surface tempSurface(pix, stride, 1);
@@ -1303,7 +1337,7 @@
void Surface::copy(Surface &source)
{
assert(source.getDoesExist());
- assert(isValidPtr(this));
+ assert(this != 0);
// Create a Surface the surface the same size as the source.
create(source);
@@ -1373,7 +1407,7 @@
//---------------------------------------------------------------------------
void Surface::loadRAW(const char *filename, bool needAlloc /* = true */)
{
- assert(isValidPtr(this));
+ assert(this != 0);
if (needAlloc) free();
@@ -1443,7 +1477,7 @@
{
assert(screenLocked);
assert(getDoesExist());
- assert(isValidPtr(this));
+ assert(this != 0);
assert(bounds.min >= 0);
assert(bounds.max <= pix);
@@ -1477,7 +1511,7 @@
void Surface::scale(const iXY &pix)
{
assert(getDoesExist());
- assert(isValidPtr(this));
+ assert(this != 0);
if (pix.x <= 0) { return; }
if (pix.y <= 0) { return; }
@@ -1564,7 +1598,7 @@
void Surface::verticalWave3DAll(int numWaves, float percent)
{
assert(getDoesExist());
- assert(isValidPtr(this));
+ assert(this != 0);
float curOffset = 0;
float offsetStep = 100.0 / float(frameCount);
@@ -1582,7 +1616,7 @@
void Surface::verticalWave3D(int numWaves, float percent, int offset)
{
assert(getDoesExist());
- assert(isValidPtr(this));
+ assert(this != 0);
Surface temp;
temp.create(pix.x, pix.y, pix.x, 1);
@@ -1596,7 +1630,7 @@
int y = 0;
for (int offset1 = 0; offset1 < pix.x * pix.y; offset1 += pix.x)
{
- int offset2 = MAX(MIN(int(((cos(angleRadians) * amplitude +
y))), pix.y - 1), 0) * pix.x;
+ int offset2 = max(min(int(((cos(angleRadians) * amplitude +
y))), pix.y - 1), 0) * pix.x;
y++;
memcpy((mem + offset1), (temp.mem + offset2), pix.x);
@@ -1609,7 +1643,7 @@
void Surface::horizontalWave3DAll(int numWaves, float percent)
{
assert(getDoesExist());
- assert(isValidPtr(this));
+ assert(this != 0);
float curOffset = 0;
float offsetStep = 100.0 / float(frameCount);
@@ -1627,7 +1661,7 @@
void Surface::horizontalWave3D(int numWaves, float percent, int offset)
{
assert(getDoesExist());
- assert(isValidPtr(this));
+ assert(this != 0);
Surface temp;
temp.create(pix.x, pix.y, pix.x, 1);
@@ -1640,7 +1674,7 @@
for (int x = 0; x < pix.x; x++)
{
- int xOffset = MAX(MIN((int)((cos(angleRadians) * amplitude +
x)), pix.x - 1), 0);
+ int xOffset = max(min((int)((cos(angleRadians) * amplitude +
x)), pix.x - 1), 0);
for (int yOffset = 0; yOffset < pix.x * pix.y; yOffset += pix.x)
{
mem[x + yOffset] = temp.mem[xOffset + yOffset];
@@ -1654,7 +1688,7 @@
void Surface::rippleAll(int numWaves, float percent)
{
assert(getDoesExist());
- assert(isValidPtr(this));
+ assert(this != 0);
float curOffset = 0;
float offsetStep = 100.0 / float(frameCount);
@@ -1672,7 +1706,7 @@
void Surface::ripple(int numWaves, float percent, int offset)
{
assert(getDoesExist());
- assert(isValidPtr(this));
+ assert(this != 0);
Surface temp(pix.x, pix.y, pix.x, 1);
@@ -1710,7 +1744,7 @@
void Surface::horizontalWaveAll(int numWaves, float percent)
{
assert(getDoesExist());
- assert(isValidPtr(this));
+ assert(this != 0);
float curOffset = 0;
float offsetStep = 100.0 / float(frameCount);
@@ -1728,7 +1762,7 @@
void Surface::horizontalWave(int numWaves, float percent, int offset)
{
assert(getDoesExist());
- assert(isValidPtr(this));
+ assert(this != 0);
Surface temp(pix.x, pix.y, pix.x, 1);
blt(temp, 0, 0);
@@ -1758,7 +1792,7 @@
void Surface::verticalWaveAll(int numWaves, float percent)
{
assert(getDoesExist());
- assert(isValidPtr(this));
+ assert(this != 0);
float curOffset = 0;
float offsetStep = 100.0 / float(frameCount);
@@ -1776,7 +1810,7 @@
void Surface::verticalWave(int numWaves, float percent, int offset)
{
assert(getDoesExist());
- assert(isValidPtr(this));
+ assert(this != 0);
Surface temp(pix.x, pix.y, pix.x, 1);
blt(temp, 0, 0);
@@ -1810,7 +1844,7 @@
{
assert(screenLocked);
assert(getDoesExist());
- assert(isValidPtr(this));
+ assert(this != 0);
orderCoords(bounds);
@@ -1838,7 +1872,7 @@
assert(screenLocked);
assert(getDoesExist());
assert(source.getDoesExist());
- assert(isValidPtr(this));
+ assert(this != 0);
assert(colorTable.getColorCount() == 256 * 256);
min += source.offset;
@@ -1913,7 +1947,7 @@
assert(screenLocked);
assert(getDoesExist());
assert(source.getDoesExist());
- assert(isValidPtr(this));
+ assert(this != 0);
assert(colorTable.getColorCount() == 256 * 256);
iXY min = destRect.min + source.offset;
@@ -2001,7 +2035,7 @@
{
assert(screenLocked);
assert(getDoesExist());
- assert(isValidPtr(this));
+ assert(this != 0);
iXY min = destRect.min + offset;
@@ -2042,7 +2076,7 @@
assert(screenLocked);
assert(getDoesExist());
assert(source.getDoesExist());
- assert(isValidPtr(this));
+ assert(this != 0);
iXY min = destRect.min + source.offset;
iXY max = destRect.max + source.offset;
@@ -2138,7 +2172,7 @@
{
assert(screenLocked);
assert(getDoesExist());
- assert(isValidPtr(this));
+ assert(this != 0);
assert(Palette::brightness256.getColorCount() == 256);
if (pix == 0) return;
@@ -2215,7 +2249,7 @@
void Surface::shrinkWrap()
{
assert(getDoesExist());
- assert(isValidPtr(this));
+ assert(this != 0);
// Start the bounds values in the center of the surface.
iRect bounds;
@@ -2414,7 +2448,7 @@
void Surface::createFractal(const float &minY, const float &maxY, const float
&ruggedness)
{
assert(getDoesExist());
- assert(isValidPtr(this));
+ assert(this != 0);
// Create some temp buffer to generate the values in.
int *tempBuf = (int *) malloc(stride * pix.y * sizeof(int));
@@ -2536,7 +2570,7 @@
void Surface::smooth()
{
assert(getDoesExist());
- assert(isValidPtr(this));
+ assert(this != 0);
const int XP = pix.x;
const int ZP = pix.y;
@@ -2809,7 +2843,7 @@
assert(screenLocked);
assert(getDoesExist());
assert(dest.getDoesExist());
- assert(isValidPtr(this));
+ assert(this != 0);
assert(Palette::colorTableBrighten.getColorCount() == 256 * 256);
assert(Palette::brightness256.getColorCount() == 256);
@@ -2898,7 +2932,7 @@
{
assert(getDoesExist());
assert(dest.getDoesExist());
- assert(isValidPtr(this));
+ assert(this != 0);
assert(colorTable.getColorCount() == 256 * 100);
iXY min(pos);
@@ -3150,7 +3184,7 @@
assert(screenLocked);
assert(getDoesExist());
assert(dest.getDoesExist());
- assert(isValidPtr(this));
+ assert(this != 0);
static BYTE saturateTable[512];
@@ -3726,7 +3760,7 @@
int loadTGA(FILE *file, cPixel24Bit *dest)
{
- assert(isValidPtr(&this));
+ assert(&this != 0);
// Read in the TGA header.
cTGAHeader TGAheader;
@@ -4248,7 +4282,7 @@
assert(screenLocked);
assert(getDoesExist());
assert(dest.getDoesExist());
- assert(isValidPtr(this));
+ assert(this != 0);
assert(colorTable.getColorCount() > 0);
// Add in the offset factor.
@@ -4682,7 +4716,7 @@
BitmapFileHeader file_header;
BitmapInfoHeader info_header;
- assert(isValidPtr(this));
+ assert(this != 0);
if (needAlloc) free();
Index: netpanzer/src/Lib/2D/Surface.hpp
diff -u netpanzer/src/Lib/2D/Surface.hpp:1.3
netpanzer/src/Lib/2D/Surface.hpp:1.4
--- netpanzer/src/Lib/2D/Surface.hpp:1.3 Wed Sep 3 04:26:33 2003
+++ netpanzer/src/Lib/2D/Surface.hpp Tue Sep 9 13:16:12 2003
@@ -26,41 +26,6 @@
// This must be called before any of the string blitting functions are used.
void initFont();
-
-// orderCoords
-//---------------------------------------------------------------------------
-// Purpose: Orders a pair of (x,y) coordinates
-//---------------------------------------------------------------------------
-template <class T>
-inline void orderCoords(T &a, T &b)
-{
- if (a > b) SWAP(a, b);
-} // end orderCoords
-
-// orderCoords
-//---------------------------------------------------------------------------
-// Purpose: Orders a 2 pairs of (x,y) coordinates, making sure x1 <= x2 and y1
<= y2.
-//---------------------------------------------------------------------------
-template <class T>
-inline void orderCoords(T &x1, T &y1, T &x2, T &y2)
-{
- if (x1 > x2) SWAP(x1, x2);
- if (y1 > y2) SWAP(y1, y2);
-} // end orderCoords
-
-inline void orderCoords(iRect &bounds)
-{
- if (bounds.min.x > bounds.max.x)
- {
- SWAP(bounds.min.x, bounds.max.x);
- }
- if (bounds.min.y > bounds.max.y)
- {
- SWAP(bounds.min.y, bounds.max.y);
- }
-} // end orderCoords
-
-
/////////////////////////////////////////////////////////////////////////////
// Defines.
/////////////////////////////////////////////////////////////////////////////
Index: netpanzer/src/Lib/FindFirst.hpp
diff -u netpanzer/src/Lib/FindFirst.hpp:1.2 netpanzer/src/Lib/FindFirst.hpp:1.3
--- netpanzer/src/Lib/FindFirst.hpp:1.2 Sat Sep 6 18:31:20 2003
+++ netpanzer/src/Lib/FindFirst.hpp Tue Sep 9 13:16:11 2003
@@ -19,7 +19,11 @@
#define __FINDFIRST_HPP__
// unix emulation of the win32 _findfirst and _findnext functions
-#ifdef UNIX
+#ifdef WIN32
+
+#include <io.h>
+
+#else
struct _finddata_t
{
Index: netpanzer/src/Lib/Particles/ChunkTrajectoryParticle2D.cpp
diff -u netpanzer/src/Lib/Particles/ChunkTrajectoryParticle2D.cpp:1.4
netpanzer/src/Lib/Particles/ChunkTrajectoryParticle2D.cpp:1.5
--- netpanzer/src/Lib/Particles/ChunkTrajectoryParticle2D.cpp:1.4 Sat Sep
6 11:39:24 2003
+++ netpanzer/src/Lib/Particles/ChunkTrajectoryParticle2D.cpp Tue Sep 9
13:16:12 2003
@@ -48,7 +48,7 @@
int isFarAway /* = 0 */,
int canHaveSmoke /* = 1 */) :
TrajectoryParticle2D(pos, maxSpeed, (rand() % (90 - minTrajectoryAngle)) +
minTrajectoryAngle, dieAtMidFlight)
{
- assert(isValidPtr(this));
+ assert(this != 0);
assert(minTrajectoryAngle >= 0 && minTrajectoryAngle <= 90);
ChunkTrajectoryParticle2D::isFarAway = isFarAway;
@@ -118,7 +118,7 @@
//---------------------------------------------------------------------------
void ChunkTrajectoryParticle2D::draw(const Surface &dest, SpriteSorter &sorter)
{
- assert(isValidPtr(this));
+ assert(this != 0);
packedSurface.setAttrib(PointXYi((int) pos.x, (int) (pos.z - arcYPix)),
layer);
sorter.addSprite(&packedSurface);
@@ -137,7 +137,7 @@
//---------------------------------------------------------------------------
void ChunkTrajectoryParticle2D::sim()
{
- assert(isValidPtr(this));
+ assert(this != 0);
arcYPix = pos.y * arcScale;
Index: netpanzer/src/Lib/Particles/ParticleSystem2D.cpp
diff -u netpanzer/src/Lib/Particles/ParticleSystem2D.cpp:1.3
netpanzer/src/Lib/Particles/ParticleSystem2D.cpp:1.4
--- netpanzer/src/Lib/Particles/ParticleSystem2D.cpp:1.3 Fri Sep 5
22:01:18 2003
+++ netpanzer/src/Lib/Particles/ParticleSystem2D.cpp Tue Sep 9 13:16:12 2003
@@ -186,18 +186,18 @@
void ParticleSystem2D::verifyList()
{
/* // Verify head/tail node
- assert(isValidPtr(zParticleSystem2D));
- assert(isValidPtr(zParticleSystem2D->next));
- assert(isValidPtr(zParticleSystem2D->prev));
+ assert(zParticleSystem2D != 0);
+ assert(zParticleSystem2D->next != 0);
+ assert(zParticleSystem2D->prev != 0);
// Go through links and verify nodes match up
ParticleSystem2D *e = zParticleSystem2D;
int numLeftToCount = particleSystemCount+1;
do
{
- assert(isValidPtr(e));
- assert(isValidPtr(e->next));
- assert(isValidPtr(e->prev));
+ assert(e != 0);
+ assert(e->next != 0);
+ assert(e->prev != 0);
assert(e->prev->next == e);
assert(e->next->prev == e);
Index: netpanzer/src/Lib/Particles/SmokingTrajectoryParticle2D.cpp
diff -u netpanzer/src/Lib/Particles/SmokingTrajectoryParticle2D.cpp:1.3
netpanzer/src/Lib/Particles/SmokingTrajectoryParticle2D.cpp:1.4
--- netpanzer/src/Lib/Particles/SmokingTrajectoryParticle2D.cpp:1.3 Fri Sep
5 22:01:18 2003
+++ netpanzer/src/Lib/Particles/SmokingTrajectoryParticle2D.cpp Tue Sep 9
13:16:12 2003
@@ -30,7 +30,7 @@
// XXX had to add an angle here
: TrajectoryParticle2D(pos, maxSpeed, 0)
{
- assert(isValidPtr(this));
+ assert(this != 0);
SmokingTrajectoryParticle2D::waitMin = waitMin;
SmokingTrajectoryParticle2D::waitRand = waitRand;
@@ -46,7 +46,7 @@
//---------------------------------------------------------------------------
void SmokingTrajectoryParticle2D::sim()
{
- assert(isValidPtr(this));
+ assert(this != 0);
assert(false);
// waitTime += TimerInterface::getTimeSlice();
Index: netpanzer/src/Lib/Particles/VectorPuffParticle2D.cpp
diff -u netpanzer/src/Lib/Particles/VectorPuffParticle2D.cpp:1.3
netpanzer/src/Lib/Particles/VectorPuffParticle2D.cpp:1.4
--- netpanzer/src/Lib/Particles/VectorPuffParticle2D.cpp:1.3 Fri Sep 5
22:01:18 2003
+++ netpanzer/src/Lib/Particles/VectorPuffParticle2D.cpp Tue Sep 9
13:16:12 2003
@@ -55,7 +55,7 @@
//---------------------------------------------------------------------------
void VectorPuffParticle2D::sim()
{
- assert(isValidPtr(this));
+ assert(this != 0);
float dt = TimerInterface::getTimeSlice();
Index: netpanzer/src/Lib/Types/fRect.cpp
diff -u netpanzer/src/Lib/Types/fRect.cpp:1.3
netpanzer/src/Lib/Types/fRect.cpp:1.4
--- netpanzer/src/Lib/Types/fRect.cpp:1.3 Fri Sep 5 22:01:18 2003
+++ netpanzer/src/Lib/Types/fRect.cpp Tue Sep 9 13:16:12 2003
@@ -15,8 +15,9 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-
#include <config.h>
+
+#include <algorithm>
#include "codewiz.hpp"
#include "fRect.hpp"
@@ -31,8 +32,7 @@
return *this;
}
- return fRect(
- MIN(min.x, a.min.x), MIN(min.y, a.min.y),
- MAX(max.x, a.max.x), MAX(max.y, a.max.y)
- );
+ return fRect(std::min(min.x, a.min.x), std::min(min.y, a.min.y),
+ std::max(max.x, a.max.x), std::max(max.y,
a.max.y));
}
+
Index: netpanzer/src/Lib/Types/fRect.hpp
diff -u netpanzer/src/Lib/Types/fRect.hpp:1.2
netpanzer/src/Lib/Types/fRect.hpp:1.3
--- netpanzer/src/Lib/Types/fRect.hpp:1.2 Mon Sep 1 16:24:19 2003
+++ netpanzer/src/Lib/Types/fRect.hpp Tue Sep 9 13:16:12 2003
@@ -26,23 +26,20 @@
fXY min;
fXY max;
- inline fRect() {}
-
- inline fRect(float x1, float y1, float x2, float y2)
+ fRect() {}
+ fRect(float x1, float y1, float x2, float y2)
{
min.x = x1;
min.y = y1;
max.x = x2;
max.y = y2;
}
-
- inline fRect(const fRect &a)
+ fRect(const fRect &a)
{
min = a.min;
max = a.max;
}
-
- inline fRect(fXY &min, fXY &max)
+ fRect(const fXY& min, const fXY& max)
{
fRect::min = min;
fRect::max = max;
@@ -92,12 +89,12 @@
a.y >= min.y && a.y < max.y;
}
- inline bool operator ==(const fRect &a)
+ inline bool operator ==(const fRect &a) const
{
return min == a.max && min == a.max;
}
- inline bool operator !=(const fRect &a)
+ inline bool operator !=(const fRect &a) const
{
return min.x != a.max.x || min.y != a.max.y;
}
Index: netpanzer/src/Lib/Types/fXY.hpp
diff -u netpanzer/src/Lib/Types/fXY.hpp:1.1 netpanzer/src/Lib/Types/fXY.hpp:1.2
--- netpanzer/src/Lib/Types/fXY.hpp:1.1 Sun Dec 1 12:51:46 2002
+++ netpanzer/src/Lib/Types/fXY.hpp Tue Sep 9 13:16:12 2003
@@ -18,24 +18,19 @@
#ifndef __fXY_hpp__
#define __fXY_hpp__
-
-#if _MSC_VER > 1000
- #pragma once
-#endif
-
-
-struct fXY
+class fXY
{
+public:
float x, y;
- inline fXY() {}
- inline fXY(float x, float y)
+ fXY()
+ {}
+ fXY(float x, float y)
{
fXY::x = x;
fXY::y = y;
}
-
- inline fXY(const fXY &a)
+ fXY(const fXY &a)
{
x = a.x;
y = a.y;
@@ -80,7 +75,7 @@
inline fXY operator * (float a) const { return fXY(x * a, y *
a); }
inline fXY operator / (float a) const { return fXY(x / a, y /
a); }
- inline bool operator ==(const fXY &a)
+ inline bool operator ==(const fXY &a) const
{
return x == a.x && y == a.y;
}
@@ -90,7 +85,7 @@
return x == a && y == a;
}
- inline bool operator !=(const fXY &a)
+ inline bool operator !=(const fXY &a) const
{
return x != a.x || y != a.y;
}
Index: netpanzer/src/Lib/Types/iRect.cpp
diff -u netpanzer/src/Lib/Types/iRect.cpp:1.3
netpanzer/src/Lib/Types/iRect.cpp:1.4
--- netpanzer/src/Lib/Types/iRect.cpp:1.3 Fri Sep 5 22:01:18 2003
+++ netpanzer/src/Lib/Types/iRect.cpp Tue Sep 9 13:16:12 2003
@@ -15,8 +15,9 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-
#include <config.h>
+
+#include <algorithm>
#include "codewiz.hpp"
#include "iRect.hpp"
@@ -32,7 +33,7 @@
}
return iRect(
- MIN(min.x, a.min.x), MIN(min.y, a.min.y),
- MAX(max.x, a.max.x), MAX(max.y, a.max.y)
+ std::min(min.x, a.min.x), std::min(min.y,
a.min.y),
+ std::max(max.x, a.max.x), std::max(max.y,
a.max.y)
);
}
Index: netpanzer/src/Lib/Util.hpp
diff -u netpanzer/src/Lib/Util.hpp:1.2 netpanzer/src/Lib/Util.hpp:1.3
--- netpanzer/src/Lib/Util.hpp:1.2 Sat Sep 6 18:31:20 2003
+++ netpanzer/src/Lib/Util.hpp Tue Sep 9 13:16:12 2003
@@ -18,34 +18,5 @@
#ifndef __LIB_UTIL_HPP__
#define __LIB_UTIL_HPP__
-// Utility functions (these have been used but not defined in the code?)
-
-template<typename T>
-static inline void SWAP(T& v1, T& v2)
-{
- T temp = v1;
- v1 = v2;
- v2 = temp;
-}
-
-template<typename T>
-static inline void SWAP(T& v1, T& v2, T& temp)
-{
- temp = v1;
- v1 = v2;
- v2 = temp;
-}
-
-template<typename T>
-static inline const T& MIN(const T& v1, const T& v2)
-{
- return v1 < v2 ? v1 : v2;
-}
-
-template<typename T>
-static inline const T& MAX(const T& v1, const T& v2)
-{
- return v1 < v2 ? v2 : v1;
-}
#endif
Index: netpanzer/src/Lib/View/Choice.cpp
diff -u netpanzer/src/Lib/View/Choice.cpp:1.3
netpanzer/src/Lib/View/Choice.cpp:1.4
--- netpanzer/src/Lib/View/Choice.cpp:1.3 Fri Sep 5 22:01:18 2003
+++ netpanzer/src/Lib/View/Choice.cpp Tue Sep 9 13:16:13 2003
@@ -15,13 +15,12 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-
-
#include <config.h>
+
+#include <algorithm>
#include "Choice.hpp"
#include "View.hpp"
-
//---------------------------------------------------------------------------
void Choice::reset()
{
@@ -42,7 +41,7 @@
int borderSpace = borderSize * 2;
- size.x = MAX(int(strlen(item) * CHAR_XPIX + borderSpace), size.y);
+ size.x = std::max(int(strlen(item) * CHAR_XPIX + borderSpace), size.y);
size.y = ChoiceItemHeight;
}
@@ -55,7 +54,7 @@
int borderSpace = borderSize * 2;
- size.x = MAX(int(strlen(item) * CHAR_XPIX + borderSpace), size.y);
+ size.x = std::max(int(strlen(item) * CHAR_XPIX + borderSpace), size.y);
size.y = CHAR_XPIX + borderSpace;
select(item);
@@ -286,8 +285,8 @@
int borderSpace = borderSize * 2;
int length = strlen((const char *) item);
- size.x = MAX(int(length * CHAR_XPIX + borderSpace), size.y);
- size.x = MAX(minWidth, size.x);
+ size.x = std::max(int(length * CHAR_XPIX + borderSpace), size.y);
+ size.x = std::max(minWidth, size.x);
} // end Choice::add
Index: netpanzer/src/Lib/View/Desktop.cpp
diff -u netpanzer/src/Lib/View/Desktop.cpp:1.6
netpanzer/src/Lib/View/Desktop.cpp:1.7
--- netpanzer/src/Lib/View/Desktop.cpp:1.6 Sun Sep 7 16:49:02 2003
+++ netpanzer/src/Lib/View/Desktop.cpp Tue Sep 9 13:16:13 2003
@@ -16,12 +16,16 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include <config.h>
+
+#include <algorithm>
#include "Desktop.hpp"
#include "KeyboardInterface.hpp"
#include "loadPics.hpp"
#include "TimerInterface.hpp"
#include "MouseInterface.hpp"
+using std::min;
+using std::max;
float Desktop::totalMouseDownTime = 0.0;
float Desktop::currentMouseDownTime = 0.0;
@@ -484,7 +488,7 @@
//--------------------------------------------------------------------------
void Desktop::add(View *view, bool autoActivate /* = true */)
{
- assert(isValidPtr(view));
+ assert(view != 0);
//printf("Initting Window: %s\n", view->getTitle());
@@ -738,22 +742,22 @@
if (mouseActions & View::MA_RESIZE_LEFT)
{
- resizeMin.x = MIN( mousePos.x -
mouseActionOffset.x,
+ resizeMin.x = min( mousePos.x -
mouseActionOffset.x,
lMouseView->max.x - View::RESIZE_XMINSIZE);
}
if (mouseActions & View::MA_RESIZE_TOP)
{
- resizeMin.y = MIN( mousePos.y +
mouseActionOffset.y,
+ resizeMin.y = min( mousePos.y +
mouseActionOffset.y,
lMouseView->max.y - View::RESIZE_XMINSIZE);
}
if (mouseActions & View::MA_RESIZE_RIGHT)
{
- resizeMax.x = MAX( mousePos.x +
mouseActionOffset.x,
+ resizeMax.x = max( mousePos.x +
mouseActionOffset.x,
lMouseView->min.x + View::RESIZE_XMINSIZE);
}
if (mouseActions & View::MA_RESIZE_BOTTOM)
{
- resizeMax.y = MAX( mousePos.y +
mouseActionOffset.y,
+ resizeMax.y = max( mousePos.y +
mouseActionOffset.y,
lMouseView->min.y + View::RESIZE_YMINSIZE);
}
Index: netpanzer/src/Lib/View/Desktop.hpp
diff -u netpanzer/src/Lib/View/Desktop.hpp:1.2
netpanzer/src/Lib/View/Desktop.hpp:1.3
--- netpanzer/src/Lib/View/Desktop.hpp:1.2 Mon Sep 1 16:24:20 2003
+++ netpanzer/src/Lib/View/Desktop.hpp Tue Sep 9 13:16:13 2003
@@ -77,7 +77,7 @@
//static View const &topWindow() const { assertTopWindowExist(); return
*top; }
static View &topView() { assertTopViewExist(); return *top; }
- static void assertTopViewExist() { assert(isValidPtr(top)); }
+ static void assertTopViewExist() { assert(top != 0); }
static bool isMouseInView(int mouseX, int mouseY);
static View *findViewContaining(iXY p);
static void doMouseActions(const iXY &mousePos);
Index: netpanzer/src/Lib/View/View.cpp
diff -u netpanzer/src/Lib/View/View.cpp:1.7 netpanzer/src/Lib/View/View.cpp:1.8
--- netpanzer/src/Lib/View/View.cpp:1.7 Mon Sep 8 11:32:04 2003
+++ netpanzer/src/Lib/View/View.cpp Tue Sep 9 13:16:13 2003
@@ -233,7 +233,7 @@
//---------------------------------------------------------------------------
void View::drawBorder(const Surface &viewArea)
{
- assert(isValidPtr(this));
+ assert(this != 0);
#ifdef GRAPHIC_BORDERS
// Straight edges.
@@ -286,7 +286,7 @@
//---------------------------------------------------------------------------
void View::drawButtons(const Surface &viewArea)
{
- assert(isValidPtr(this));
+ assert(this != 0);
//pics.setFrame(CLOSE);
//pics.blt(viewArea, iXY(getSizeX()-pics.getPix().x-borderSize-2,
borderSize+2));
@@ -303,7 +303,7 @@
//---------------------------------------------------------------------------
void View::drawTitle(const Surface &viewArea)
{
- assert(isValidPtr(this));
+ assert(this != 0);
iRect r(borderSize, borderSize, getSizeX() - borderSize, borderSize +
moveAreaHeight - 1);
@@ -511,7 +511,7 @@
//---------------------------------------------------------------------------
void View::draw()
{
- assert(isValidPtr(this));
+ assert(this != 0);
if (getVisible())
{
@@ -610,7 +610,7 @@
//---------------------------------------------------------------------------
void View::doActivate()
{
- assert(isValidPtr(this));
+ assert(this != 0);
// Tell all the components the mouse entered the view.
for (int i = 0; i < componentsUsedCount; i++)
@@ -635,7 +635,7 @@
//---------------------------------------------------------------------------
void View::doDeactivate()
{
- assert(isValidPtr(this));
+ assert(this != 0);
// Tell all the components the mouse exited the view.
for (int i = 0; i < componentsUsedCount; i++)
@@ -656,7 +656,7 @@
//---------------------------------------------------------------------------
int View::getMouseActions(const iXY &pos) const
{
- assert(isValidPtr(this));
+ assert(this != 0);
int actions = 0;
@@ -730,7 +730,7 @@
//---------------------------------------------------------------------------
iXY View::getScreenToClientPos(const iXY &pos)
{
- assert(isValidPtr(this));
+ assert(this != 0);
if (getBordered())
{
@@ -750,7 +750,7 @@
//---------------------------------------------------------------------------
iXY View::getScreenToViewPos(const iXY &pos)
{
- assert(isValidPtr(this));
+ assert(this != 0);
return iXY(pos.x - min.x, pos.y - min.y);
@@ -762,7 +762,7 @@
//---------------------------------------------------------------------------
void View::getViewArea(Surface &dest)
{
- assert(isValidPtr(this));
+ assert(this != 0);
iRect rect(min, max);
@@ -820,7 +820,7 @@
//---------------------------------------------------------------------------
Surface View::getViewArea()
{
- assert(isValidPtr(this));
+ assert(this != 0);
iRect rect(min, max);
//iRect rect;
@@ -848,7 +848,7 @@
//---------------------------------------------------------------------------
void View::getClientArea(Surface &dest)
{
- assert(isValidPtr(this));
+ assert(this != 0);
if (getBordered())
{
@@ -1229,7 +1229,7 @@
//---------------------------------------------------------------------------
void View::mouseExit(const iXY &pos)
{
- assert(isValidPtr(this));
+ assert(this != 0);
// Check all components for a exited event.
for (int i = 0; i < componentsUsedCount; i++)
@@ -1358,7 +1358,7 @@
//---------------------------------------------------------------------------
void View::drawHighlightedButton(const Surface &clientArea)
{
- assert(isValidPtr(this));
+ assert(this != 0);
if (highlightedButton < 0)
{
@@ -1473,7 +1473,7 @@
void View::addButton(const iXY &pos, const char *name, const char *toolTip,
ITEM_FUNC func)
{
- assert(isValidPtr(this));
+ assert(this != 0);
// Grow the list
buttons.setNum(buttons.getCount()+1);
@@ -1490,7 +1490,7 @@
const char *toolTip,
ITEM_FUNC func)
{
- assert(isValidPtr(this));
+ assert(this != 0);
// Grow the list.
buttons.setNum(buttons.getCount()+1);
@@ -1508,7 +1508,7 @@
ITEM_FUNC leftClickFunc,
ITEM_FUNC rightClickFunc)
{
- assert(isValidPtr(this));
+ assert(this != 0);
// Grow the list
buttons.setNum(buttons.getCount()+1);
@@ -1636,7 +1636,7 @@
//---------------------------------------------------------------------------
int View::findButtonContaining(const iXY &pos)
{
- assert(isValidPtr(this));
+ assert(this != 0);
for (int num = 0; num < buttons.getCount(); num++)
{
@@ -1655,7 +1655,7 @@
//---------------------------------------------------------------------------
int View::findInputFieldContaining(const iXY &pos)
{
- assert(isValidPtr(this));
+ assert(this != 0);
for (int num = 0; num < inputFields.getCount(); num++)
{
@@ -1673,7 +1673,7 @@
//---------------------------------------------------------------------------
void View::drawPressedButton(const Surface &clientArea)
{
- assert(isValidPtr(this));
+ assert(this != 0);
if (pressedButton < 0 ||
buttons[pressedButton].topSurface.getFrameCount() < 2) return;
if (highlightedButton != pressedButton) return;
@@ -1692,7 +1692,7 @@
//---------------------------------------------------------------------------
void View::drawToolTip(const Surface &dest)
{
- assert(isValidPtr(this));
+ assert(this != 0);
iRect rect;
rect.min.x = 0;
@@ -2141,8 +2141,8 @@
//void View::add(Component *Component)
//{
-// assert(isValidPtr(this));
-// assert(isValidPtr(Component));
+// assert(this != 0);
+// assert(Component != 0);
//
// // First remove it from the list if we already have it somehow.
// remove(Component);
Index: netpanzer/src/Lib/View/cButton.hpp
diff -u netpanzer/src/Lib/View/cButton.hpp:1.3
netpanzer/src/Lib/View/cButton.hpp:1.4
--- netpanzer/src/Lib/View/cButton.hpp:1.3 Sat Sep 6 11:18:18 2003
+++ netpanzer/src/Lib/View/cButton.hpp Tue Sep 9 13:16:13 2003
@@ -102,7 +102,7 @@
inline bool contains(iXY pos)
{
- assert(isValidPtr(this));
+ assert(this != 0);
if ( pos.x >= bounds.min.x &&
pos.y >= bounds.min.y &&
Index: netpanzer/src/Lib/cGrowList.hpp
diff -u netpanzer/src/Lib/cGrowList.hpp:1.3 netpanzer/src/Lib/cGrowList.hpp:1.4
--- netpanzer/src/Lib/cGrowList.hpp:1.3 Sun Sep 7 16:49:02 2003
+++ netpanzer/src/Lib/cGrowList.hpp Tue Sep 9 13:16:12 2003
@@ -35,8 +35,8 @@
cGrowList(int initSize = 0);
TYPE *add(const TYPE &a);
- bool setAlloced(int nAlloced, bool gottaHaveIt = GOTTA_HAVE_IT);
- bool setNum(int nNum, bool gottaHaveIt = GOTTA_HAVE_IT);
+ bool setAlloced(int nAlloced, bool gottaHaveIt = true);
+ bool setNum(int nNum, bool gottaHaveIt = true);
void free();
void removeByIndex(int index);
void sort( int (* compare)( const void *elem1, const void *elem2 ));
@@ -86,7 +86,7 @@
array = 0;
alloced = 0;
- setNum(initSize, GOTTA_HAVE_IT);
+ setNum(initSize, true);
assertValid();
}
@@ -95,7 +95,7 @@
//---------------------------------------------------------------------------
template <class TYPE>
-bool cGrowList<TYPE>::setAlloced(int nAlloced, bool gottaHaveIt /* =
GOTTA_HAVE_IT */) {
+bool cGrowList<TYPE>::setAlloced(int nAlloced, bool gottaHaveIt) {
assertValid();
if (nAlloced == alloced) return true;
@@ -158,7 +158,7 @@
//---------------------------------------------------------------------------
template <class TYPE>
-bool cGrowList<TYPE>::setNum(int nNum, bool gottaHaveIt /* = GOTTA_HAVE_IT */)
{
+bool cGrowList<TYPE>::setNum(int nNum, bool gottaHaveIt) {
assertValid();
if (nNum > alloced) {
@@ -185,8 +185,8 @@
void cGrowList<TYPE>::free() {
assertValid();
- setNum(0, GOTTA_HAVE_IT);
- setAlloced(0, GOTTA_HAVE_IT);
+ setNum(0, true);
+ setAlloced(0, true);
}
Index: netpanzer/src/Lib/codewiz.hpp
diff -u netpanzer/src/Lib/codewiz.hpp:1.5 netpanzer/src/Lib/codewiz.hpp:1.6
--- netpanzer/src/Lib/codewiz.hpp:1.5 Sun Sep 7 16:49:02 2003
+++ netpanzer/src/Lib/codewiz.hpp Tue Sep 9 13:16:12 2003
@@ -15,25 +15,9 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-
#ifndef __CODEWIZ_H_INCLUDED__
#define __CODEWIZ_H_INCLUDED__
-#include "Util.hpp"
#include "Types/LibTypes.hpp"
-//***************************************************************************
-// favorite consts
-//***************************************************************************
-const bool GOTTA_HAVE_IT = true;
-const bool LIVE_WITHOUT_IT = false;
-
-// XXX changed this, as it was stupid code (on unix this failed from time to
-// time
-inline bool isValidPtr(const void *ptr) {
- //return (ptr > 0) && (ptr < (void *)0x90000000);
- return ptr != 0;
-}
-
-//***************************************************************************
#endif // #ifndef __CODEWIZ_H_INCLUDED__
Index: netpanzer/src/NetPanzer/Views/Game/ControlPaletteView.cpp
diff -u netpanzer/src/NetPanzer/Views/Game/ControlPaletteView.cpp:1.4
netpanzer/src/NetPanzer/Views/Game/ControlPaletteView.cpp:1.5
--- netpanzer/src/NetPanzer/Views/Game/ControlPaletteView.cpp:1.4 Sat Sep
6 11:18:19 2003
+++ netpanzer/src/NetPanzer/Views/Game/ControlPaletteView.cpp Tue Sep 9
13:16:13 2003
@@ -32,7 +32,7 @@
//---------------------------------------------------------------------------
ControlPaletteView::ControlPaletteView() : View()
{
- assert(isValidPtr(this));
+ assert(this != 0);
setSearchName("ControlPaletteView");
setTitle("Control Palette");
@@ -71,7 +71,7 @@
void ControlPaletteView::doDraw(const Surface &viewArea, const Surface
&clientArea)
{
FUNC("ControlPaletteView::doDraw");
- assert(isValidPtr(this));
+ assert(this != 0);
assert(viewArea.getDoesExist());
assert(clientArea.getDoesExist());
Index: netpanzer/src/NetPanzer/Views/Game/ControlView.cpp
diff -u netpanzer/src/NetPanzer/Views/Game/ControlView.cpp:1.3
netpanzer/src/NetPanzer/Views/Game/ControlView.cpp:1.4
--- netpanzer/src/NetPanzer/Views/Game/ControlView.cpp:1.3 Fri Sep 5
22:01:19 2003
+++ netpanzer/src/NetPanzer/Views/Game/ControlView.cpp Tue Sep 9 13:16:13 2003
@@ -55,7 +55,7 @@
setTitle("Control");
setSubTitle("");
- assert(isValidPtr(this));
+ assert(this != 0);
setTitle(title);
setAllowResize(false);
@@ -88,7 +88,7 @@
//---------------------------------------------------------------------------
void ControlView::doDraw(const Surface &viewArea, const Surface &clientArea)
{
- assert(isValidPtr(this));
+ assert(this != 0);
assert(viewArea.getDoesExist());
assert(clientArea.getDoesExist());
Index: netpanzer/src/NetPanzer/Views/Game/MiniMapView.cpp
diff -u netpanzer/src/NetPanzer/Views/Game/MiniMapView.cpp:1.6
netpanzer/src/NetPanzer/Views/Game/MiniMapView.cpp:1.7
--- netpanzer/src/NetPanzer/Views/Game/MiniMapView.cpp:1.6 Sat Sep 6
06:34:29 2003
+++ netpanzer/src/NetPanzer/Views/Game/MiniMapView.cpp Tue Sep 9 13:16:13 2003
@@ -15,9 +15,9 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-
-
#include <config.h>
+
+#include <algorithm>
#include "MiniMapView.hpp"
#include "cMouse.hpp"
#include "MiniMapInterface.hpp"
@@ -40,7 +40,7 @@
//---------------------------------------------------------------------------
MiniMapView::MiniMapView() : GameTemplateView()
{
- assert(isValidPtr(this));
+ assert(this != 0);
setSearchName("MiniMapView");
setTitle("MiniMapView");
@@ -96,7 +96,7 @@
//---------------------------------------------------------------------------
void MiniMapView::doDraw(const Surface &viewArea, const Surface &clientArea)
{
- assert(isValidPtr(this));
+ assert(this != 0);
assert(viewArea.getDoesExist());
assert(clientArea.getDoesExist());
@@ -254,7 +254,7 @@
//--------------------------------------------------------------------------
void MiniMapView::setViewWindow(const iXY &pos)
{
- assert(isValidPtr(this));
+ assert(this != 0);
iXY size(getViewRect().getSize());
@@ -272,7 +272,7 @@
//--------------------------------------------------------------------------
void MiniMapView::drawMouseBox(const Surface &dest)
{
- assert(isValidPtr(this));
+ assert(this != 0);
assert(dest.getDoesExist());
iRect r(MiniMapInterface::getWorldWindow());
@@ -291,7 +291,7 @@
//--------------------------------------------------------------------------
void MiniMapView::lMouseDown(const iXY &pos)
{
- assert(isValidPtr(this));
+ assert(this != 0);
if
(getClientRect().contains(getScreenToClientPos(mouse.getScreenPos())))
{
@@ -317,8 +317,8 @@
void MiniMapView::rMouseDrag(const iXY &downPos, const iXY &prevPos, const iXY
&newPos)
{
// Let the map go up to the min screen dimension.
- //maxMapSize = MIN(SCREEN_XPIX, SCREEN_YPIX);
- maxMapSize = MIN(640, 480);
+ //maxMapSize = std::min(SCREEN_XPIX, SCREEN_YPIX);
+ maxMapSize = std::min(640, 480);
moveTo(min + newPos - prevPos);
Index: netpanzer/src/NetPanzer/Views/Game/MiniRankView.hpp
diff -u netpanzer/src/NetPanzer/Views/Game/MiniRankView.hpp:1.2
netpanzer/src/NetPanzer/Views/Game/MiniRankView.hpp:1.3
--- netpanzer/src/NetPanzer/Views/Game/MiniRankView.hpp:1.2 Mon Sep 1
16:24:21 2003
+++ netpanzer/src/NetPanzer/Views/Game/MiniRankView.hpp Tue Sep 9 13:16:13 2003
@@ -18,46 +18,8 @@
#ifndef __MiniRankView_hpp__
#define __MiniRankView_hpp__
-#include "iXY.hpp"
-#include "iRect.hpp"
-#include "Surface.hpp"
-#include "Stats.hpp"
+class Surface;
-
-void drawMiniRankView(const Surface &dest)
-{
- iXY size(200, 60);
-
- iRect r(iXY(SCREEN_XPIX - size.x, SCREEN_YPIX - size.y), SCREEN_PIX);
-
- // Just shove it in the bottom corner for now.
- dest.bltLookup(r, Palette::darkGray256.getColorArray());
-
- Stats::Initialize();
- Stats::SortPlayers();
-
- char strBuf[256];
- char playerFlagName[256];
- short playerKills;
- short playerLosses;
- short playerTotalPoints;
- char *playerName;
-
- int playerCount = Stats::getActivePlayers();
-
- iXY pos(5, 5);
-
- int yOffset = 10;
-
- for (int i = 0; i < MIN(playerCount, 4); i++)
- {
- Stats::GetPlayerStats(playerFlagName, &playerKills,
&playerLosses, &playerTotalPoints, 0, &playerName, 0);
-
- sprintf(strBuf, "%-10s%10i", playerName, playerTotalPoints);
-
- dest.bltString(r.min.x + pos.x, r.min.y + pos.y, strBuf,
Color::white);
- pos.y += yOffset;
- }
-}
+void drawMiniRankView(const Surface &dest);
#endif // end __MiniRankView_hpp__
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [netPanzer-CVS] netpanzer/src ChangeLog Lib/FindFirst.hpp Lib/U...,
Matthias Braun <=