netpanzer-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[netPanzer-CVS] netpanzer/src ChangeLog Lib/FileUtil.cpp Lib/Sp...


From: Matthias Braun
Subject: [netPanzer-CVS] netpanzer/src ChangeLog Lib/FileUtil.cpp Lib/Sp...
Date: Mon, 08 Sep 2003 12:46:23 -0400

CVSROOT:        /cvsroot/netpanzer
Module name:    netpanzer
Branch:         
Changes by:     Matthias Braun <address@hidden> 03/09/08 12:46:22

Modified files:
        src            : ChangeLog 
        src/Lib        : FileUtil.cpp SplitPath.cpp 
        src/Lib/2D     : ColorTable.cpp PackedSurface.cpp 
        src/NetPanzer/Views/Game: GameInfoView.cpp 

Log message:
        -fixed some smaller bugs in Splitpath and FileUtil
        -added an fps counter to the info window

Patches:
Index: netpanzer/src/ChangeLog
diff -u netpanzer/src/ChangeLog:1.10 netpanzer/src/ChangeLog:1.11
--- netpanzer/src/ChangeLog:1.10        Mon Sep  8 11:32:02 2003
+++ netpanzer/src/ChangeLog     Mon Sep  8 12:46:22 2003
@@ -7,6 +7,8 @@
 -Added new keyboard handling code
 -fixed lots of code that assumed a key scancode is "only" a char
 -added possibility to switch windows/fullscreen mode on ALT+ENTER
+-fixed some smaller bugs in Splitpath and FileUtil
+-added an fps counter to the info window
 
 7-Sep-2003 by Matze Braun
 -removed NetMessageLog class (because it only contained shit ;-)
Index: netpanzer/src/Lib/2D/ColorTable.cpp
diff -u netpanzer/src/Lib/2D/ColorTable.cpp:1.8 
netpanzer/src/Lib/2D/ColorTable.cpp:1.9
--- netpanzer/src/Lib/2D/ColorTable.cpp:1.8     Sun Sep  7 16:49:02 2003
+++ netpanzer/src/Lib/2D/ColorTable.cpp Mon Sep  8 12:46:22 2003
@@ -361,7 +361,7 @@
 
        FILE *fp = fopen(strBuf, "wb");
        if (fp == 0)
-               throw Exception("couldn't save colortable to '%s'.", filename); 
+               throw Exception("couldn't save colortable to '%s'.", strBuf);   
 
        saveTable(fp);
 
Index: netpanzer/src/Lib/2D/PackedSurface.cpp
diff -u netpanzer/src/Lib/2D/PackedSurface.cpp:1.5 
netpanzer/src/Lib/2D/PackedSurface.cpp:1.6
--- netpanzer/src/Lib/2D/PackedSurface.cpp:1.5  Sun Sep  7 16:49:02 2003
+++ netpanzer/src/Lib/2D/PackedSurface.cpp      Mon Sep  8 12:46:22 2003
@@ -193,8 +193,12 @@
 //--------------------------------------------------------------------------
 void PackedSurface::load(const char *filename) {
        FILE *f = fopen(filename, "rb");
-       if (f == 0) throw Exception("Can't open %s", filename);
+       
+       if (f == 0)
+               throw Exception("Can't open %s", filename);
+       
        load(f);
+
        fclose(f);
 }
 
@@ -239,7 +243,8 @@
 
        // Quick check for error
 
-       if (ferror(f)) throw Exception("Error reading packed surface file!");
+       if (ferror(f))
+               throw Exception("Error reading packed surface file!");
 
        // Add size of rowTableOffset.
        totalByteCount += (pix.y * frameCount + 1) * sizeof(*rowOffsetTable);
Index: netpanzer/src/Lib/FileUtil.cpp
diff -u netpanzer/src/Lib/FileUtil.cpp:1.2 netpanzer/src/Lib/FileUtil.cpp:1.3
--- netpanzer/src/Lib/FileUtil.cpp:1.2  Sat Sep  6 18:31:20 2003
+++ netpanzer/src/Lib/FileUtil.cpp      Mon Sep  8 12:46:22 2003
@@ -31,7 +31,7 @@
 #ifdef WIN32
        return ::mkdir(name);
 #else
-       return ::mkdir(name, 0x0755);
+       return ::mkdir(name, S_IRWXU);
 #endif
 }
 
Index: netpanzer/src/Lib/SplitPath.cpp
diff -u netpanzer/src/Lib/SplitPath.cpp:1.3 netpanzer/src/Lib/SplitPath.cpp:1.4
--- netpanzer/src/Lib/SplitPath.cpp:1.3 Sat Sep  6 18:31:20 2003
+++ netpanzer/src/Lib/SplitPath.cpp     Mon Sep  8 12:46:22 2003
@@ -52,7 +52,7 @@
                if(lastslash == 0)
                        strcpy(dir, "");
                else
-                       strcpypart(dir, path, lastslash - path);
+                       strcpypart(dir, path, lastslash - path + 1);
        }
        
        // Step2: Get the (last) dot in the filename
Index: netpanzer/src/NetPanzer/Views/Game/GameInfoView.cpp
diff -u netpanzer/src/NetPanzer/Views/Game/GameInfoView.cpp:1.5 
netpanzer/src/NetPanzer/Views/Game/GameInfoView.cpp:1.6
--- netpanzer/src/NetPanzer/Views/Game/GameInfoView.cpp:1.5     Sat Sep  6 
14:23:08 2003
+++ netpanzer/src/NetPanzer/Views/Game/GameInfoView.cpp Mon Sep  8 12:46:22 2003
@@ -94,7 +94,7 @@
 
        moveTo(iXY(0, 0));
        //resizeClientArea(iXY(100, 2 * 2 + 12 * 3 + 8));
-       resizeClientArea(iXY(140, 2 * 2 + 12 * 4 + 8));
+       resizeClientArea(iXY(140, 2 * 2 + 12 * 5 + 8));
 
        // Start it in the top-left corner.
        moveTo(iXY(10000, 0));
@@ -112,6 +112,7 @@
     char timeBuf[64];
     char pingBuf[64];
     char gameBuf[64];
+       char fpsBuf[64];
        
        iXY pos(2, 2);
 
@@ -162,6 +163,9 @@
        sprintf(pingBuf, "ping   %.0f ms", NetworkState::ping_time );
        checkGameInfoRect(pingBuf);
 
+       sprintf(fpsBuf, "FPS    %f", TimerInterface::getFPSAvg() );
+       checkGameInfoRect(fpsBuf);                                              
+
        bltViewBackground(viewArea);
 
        clientArea.bltStringShadowed(pos, gameBuf, Color::white, Color::black);
@@ -180,13 +184,14 @@
        pos.y += 12;
        clientArea.bltStringShadowed(pos, pingBuf, Color::white, Color::black);
        pos.y += 12;
+       clientArea.bltStringShadowed(pos, fpsBuf, Color::white, Color::black);
+       pos.y += 12;                                                            
 
        View::doDraw(viewArea, clientArea);
 
        // Make sure the view stays in the screen when the view is resized.
        //resizeClientArea(gameInfoRect.getSize());
        //moveTo(min);
-
 } // end GameInfoView::doDraw
 
 // checkGameInfoRect




reply via email to

[Prev in Thread] Current Thread [Next in Thread]