Update of /cvsroot/wpdev/wolfpack
In directory sc8-pr-cvs1:/tmp/cvs-serv1724
Modified Files:
commands.cpp sectors.cpp targetrequests.h wolf.dsp
Log Message:
moved 'nuke to python script. Also made 'wipe an alias to it.
Index: commands.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/commands.cpp,v
retrieving revision 1.196
retrieving revision 1.197
diff -C2 -d -r1.196 -r1.197
*** commands.cpp 31 Aug 2003 20:06:42 -0000 1.196
--- commands.cpp 1 Sep 2003 05:03:03 -0000 1.197
***************
*** 1018,1030 ****
}
- void commandNuke( cUOSocket *socket, const QString &command, QStringList &args ) throw()
- {
- Q_UNUSED(args);
- Q_UNUSED(command);
- // Nuke does not take any parameters (At least for now it does not.)
- socket->sysMessage( tr( "Please select first corner of the box you want to nuke." ) );
- socket->attachTarget( new cNukeTarget );
- }
-
void commandTile( cUOSocket *socket, const QString &command, QStringList &args ) throw()
{
--- 1018,1021 ----
***************
*** 1248,1252 ****
{ "MAKEMENU", commandMakeMenu },
{ "MOVE", commandMove },
- { "NUKE", commandNuke },
{ "PAGES", commandPages },
{ "PAGENOTIFY", commandPageNotify },
--- 1239,1242 ----
Index: sectors.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/sectors.cpp,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -d -r1.13 -r1.14
*** sectors.cpp 20 Aug 2003 17:16:00 -0000 1.13
--- sectors.cpp 1 Sep 2003 05:03:03 -0000 1.14
***************
*** 14,17 ****
--- 14,18 ----
#include <math.h>
+ #include <algorithm>
// 8 uses more memory but is faster
***************
*** 386,389 ****
--- 387,397 ----
unsigned int gridSize = sector->gridWidth() * sector->gridHeight();
unsigned int xBlock, yBlock;
+
+ if ( x1 > x2 )
+ {
+ std::swap(x1, x2);
+ std::swap(y1, y2);
+ }
+
for( xBlock = x1 / SECTOR_SIZE; xBlock <= x2 / SECTOR_SIZE; xBlock++ )
Index: targetrequests.h
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/targetrequests.h,v
retrieving revision 1.44
retrieving revision 1.45
diff -C2 -d -r1.44 -r1.45
*** targetrequests.h 28 Aug 2003 20:56:16 -0000 1.44
--- targetrequests.h 1 Sep 2003 05:03:03 -0000 1.45
***************
*** 574,640 ****
};
- class cNukeTarget: public cTargetRequest
- {
- Q_OBJECT
- private:
- INT16 x1, y1;
- public:
- cNukeTarget( INT16 _x1 = -1, INT16 _y1 = -1 ): x1( _x1 ), y1( _y1 ) {}
-
- virtual bool responsed( cUOSocket *socket, cUORxTarget *target )
- {
- // Set the first corner and readd ourself
- if( x1 == -1 || y1 == -1 )
- {
- x1 = target->x();
- y1 = target->y();
- socket->sysMessage( tr( "Please select the second corner of the box you want to nuke." ) );
- return false;
- }
- else
- {
- INT16 x2;
- if( target->x() < x1 )
- {
- x2 = x1;
- x1 = target->x();
- }
- else
- x2 = target->x();
-
- INT16 y2;
- if( target->y() < y1 )
- {
- y2 = y1;
- y1 = target->y();
- }
- else
- y2 = target->y();
-
- socket->sysMessage( tr( "Nuking from %1,%2 to %3,%4" ).arg( x1 ).arg( y1 ).arg( x2 ).arg( y2 ) );
- UINT16 dCount = 0;
- std::vector< P_ITEM > toDelete;
-
- // This could eventually be optimized
- cItemIterator iter;
- for( P_ITEM pItem = iter.first(); pItem; pItem = iter.next() )
- {
- if( pItem && pItem->isInWorld() && pItem->pos().x >= x1 && pItem->pos().x <= x2 && pItem->pos().y >= y1 && pItem->pos().y <= y2 )
- {
- // Delete the item
- toDelete.push_back( pItem );
- dCount++;
- }
- }
-
- for( std::vector< P_ITEM >::iterator sIter = toDelete.begin(); sIter != toDelete.end(); ++sIter )
- (*sIter)->remove();
-
- socket->sysMessage( tr( "Deleted %1 items." ).arg( dCount ) );
- return true;
- }
- }
- };
-
class cTileTarget: public cTargetRequest
{
--- 574,577 ----
Index: wolf.dsp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/wolf.dsp,v
retrieving revision 1.209
retrieving revision 1.210
diff -C2 -d -r1.209 -r1.210
*** wolf.dsp 30 Aug 2003 17:00:09 -0000 1.209
--- wolf.dsp 1 Sep 2003 05:03:04 -0000 1.210
***************
*** 1,23 ****
# Microsoft Developer Studio Project File - Name="wolf" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
! # ** NICHT BEARBEITEN **
# TARGTYPE "Win32 (x86) Console Application" 0x0103
CFG=wolf - Win32 Debug
! !MESSAGE Dies ist kein gültiges Makefile. Zum Erstellen dieses Projekts mit NMAKE
! !MESSAGE verwenden Sie den Befehl "Makefile exportieren" und führen Sie den Befehl
!MESSAGE
!MESSAGE NMAKE /f "wolf.mak".
!MESSAGE
! !MESSAGE Sie können beim Ausführen von NMAKE eine Konfiguration angeben
! !MESSAGE durch Definieren des Makros CFG in der Befehlszeile. Zum Beispiel:
!MESSAGE
!MESSAGE NMAKE /f "wolf.mak" CFG="wolf - Win32 Debug"
!MESSAGE
! !MESSAGE Für die Konfiguration stehen zur Auswahl:
!MESSAGE
! !MESSAGE "wolf - Win32 Release" (basierend auf "Win32 (x86) Console Application")
! !MESSAGE "wolf - Win32 Debug" (basierend auf "Win32 (x86) Console Application")
!MESSAGE
--- 1,23 ----
# Microsoft Developer Studio Project File - Name="wolf" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
! # ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Console Application" 0x0103
CFG=wolf - Win32 Debug
! !MESSAGE This is not a valid makefile. To build this project using NMAKE,
! !MESSAGE use the Export Makefile command and run
!MESSAGE
!MESSAGE NMAKE /f "wolf.mak".
!MESSAGE
! !MESSAGE You can specify a configuration when running NMAKE
! !MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE
!MESSAGE NMAKE /f "wolf.mak" CFG="wolf - Win32 Debug"
!MESSAGE
! !MESSAGE Possible choices for configuration are:
!MESSAGE
! !MESSAGE "wolf - Win32 Release" (based on "Win32 (x86) Console Application")
! !MESSAGE "wolf - Win32 Debug" (based on "Win32 (x86) Console Application")
!MESSAGE
***************
*** 26,30 ****
# PROP Scc_ProjName "wolf"
# PROP Scc_LocalPath "."
! CPP=cl.exe
RSC=rc.exe
--- 26,30 ----
# PROP Scc_ProjName "wolf"
# PROP Scc_LocalPath "."
! CPP=xicl6.exe
RSC=rc.exe
***************
*** 50,54 ****
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
! LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
# ADD LINK32 kernel32.lib user32.lib advapi32.lib ws2_32.lib $(QTDIR)\lib\qt-mt312.lib libmysql.lib /nologo /subsystem:console /map /machine:I386 /nodefaultlib:"libcmt MSVCRTD" /out:"D:\wolfpack\wolfpack.exe" /libpath:"lib\ZThread\lib" /libpath:"lib\Python\lib" /libpath:"lib\bugreport\lib" /libpath:"flatstore\Release" /opt:ref /opt:nowin98
--- 50,54 ----
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
! LINK32=xilink6.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
# ADD LINK32 kernel32.lib user32.lib advapi32.lib ws2_32.lib $(QTDIR)\lib\qt-mt312.lib libmysql.lib /nologo /subsystem:console /map /machine:I386 /nodefaultlib:"libcmt MSVCRTD" /out:"D:\wolfpack\wolfpack.exe" /libpath:"lib\ZThread\lib" /libpath:"lib\Python\lib" /libpath:"lib\bugreport\lib" /libpath:"flatstore\Release" /opt:ref /opt:nowin98
***************
*** 75,81 ****
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
! LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
! # ADD LINK32 kernel32.lib user32.lib advapi32.lib ws2_32.lib $(QTDIR)\lib\qt-mt312.lib libmysql.lib /nologo /version:12.9 /subsystem:console /map /debug /machine:I386 /out:"..\Wolfpack.exe" /pdbtype:sept /libpath:"lib\bugreport\lib" /libpath:"flatstore\Debug"
# SUBTRACT LINK32 /pdb:none
--- 75,81 ----
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
! LINK32=xilink6.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
! # ADD LINK32 kernel32.lib user32.lib advapi32.lib ws2_32.lib $(QTDIR)\lib\qt-mt320.lib libmysql.lib /nologo /version:12.9 /subsystem:console /map /debug /machine:I386 /out:"..\Wolfpack.exe" /pdbtype:sept /libpath:"lib\bugreport\lib" /libpath:"flatstore\Debug"
# SUBTRACT LINK32 /pdb:none
***************
*** 120,127 ****
SOURCE=.\boats.cpp
- # End Source File
- # Begin Source File
-
- SOURCE=.\books.cpp
# End Source File
# Begin Source File
--- 120,123 ----
|