# HG changeset patch # User nemo # Date 1388433407 18000 # Node ID 749369ad65a924f4785a9fb11dc0d971344cd867 # Parent 2d206defd97408cf5069d2b7407650965c9c2c32# Parent 9530e391fa7754e6dc0265c746879f7ca4ce54d9 merge safe fixes from default. physfs include order, tips file length check, server checker fixes, shoppa border fix, land drawing optimisations, physfs off by 1 (probably unused by us), rubber svg image diff -r 2d206defd974 -r 749369ad65a9 .hgtags diff -r 2d206defd974 -r 749369ad65a9 CMakeLists.txt diff -r 2d206defd974 -r 749369ad65a9 QTfrontend/CMakeLists.txt --- a/QTfrontend/CMakeLists.txt Mon Dec 30 13:33:58 2013 -0500 +++ b/QTfrontend/CMakeLists.txt Mon Dec 30 14:56:47 2013 -0500 @@ -61,8 +61,8 @@ include_directories(${CMAKE_CURRENT_SOURCE_DIR}/util/platform) include_directories(${SDL_INCLUDE_DIR}) include_directories(${SDLMIXER_INCLUDE_DIR}) -include_directories(${PHYSFS_INCLUDE_DIR}) -include_directories(${PHYSLAYER_INCLUDE_DIR}) +include_directories(BEFORE ${PHYSFS_INCLUDE_DIR}) +include_directories(BEFORE ${PHYSLAYER_INCLUDE_DIR}) if(UNIX) diff -r 2d206defd974 -r 749369ad65a9 QTfrontend/ui/page/pagemain.cpp --- a/QTfrontend/ui/page/pagemain.cpp Mon Dec 30 13:33:58 2013 -0500 +++ b/QTfrontend/ui/page/pagemain.cpp Mon Dec 30 14:56:47 2013 -0500 @@ -158,7 +158,7 @@ #else int platform = 3; #endif - if(Tips.length() == 0) + if(!Tips.length()) { DataManager & dataMgr = DataManager::instance(); @@ -209,7 +209,11 @@ file.close(); } - return Tips[QTime(0, 0, 0).secsTo(QTime::currentTime()) % Tips.length()]; + + if(Tips.length()) + return Tips[QTime(0, 0, 0).secsTo(QTime::currentTime()) % Tips.length()]; + else + return QString(); } void PageMain::toggleNetworkChoice() diff -r 2d206defd974 -r 749369ad65a9 cmake_modules/paths.cmake diff -r 2d206defd974 -r 749369ad65a9 gameServer/Actions.hs --- a/gameServer/Actions.hs Mon Dec 30 13:33:58 2013 -0500 +++ b/gameServer/Actions.hs Mon Dec 30 14:56:47 2013 -0500 @@ -717,8 +717,9 @@ processAction (CheckSuccess info) = do Just (CheckInfo fileName teams) <- client's checkInfo + p <- client's clientProto si <- gets serverInfo - io $ writeChan (dbQueries si) $ StoreAchievements (B.pack fileName) (map toPair teams) info + io $ writeChan (dbQueries si) $ StoreAchievements p (B.pack fileName) (map toPair teams) info io $ moveCheckedRecord fileName where toPair t = (teamname t, teamowner t) diff -r 2d206defd974 -r 749369ad65a9 gameServer/CoreTypes.hs --- a/gameServer/CoreTypes.hs Mon Dec 30 13:33:58 2013 -0500 +++ b/gameServer/CoreTypes.hs Mon Dec 30 14:56:47 2013 -0500 @@ -275,7 +275,7 @@ CheckAccount ClientIndex Int B.ByteString B.ByteString | ClearCache | SendStats Int Int - | StoreAchievements B.ByteString [(B.ByteString, B.ByteString)] [B.ByteString] + | StoreAchievements Word16 B.ByteString [(B.ByteString, B.ByteString)] [B.ByteString] | GetReplayName ClientIndex Int B.ByteString deriving (Show, Read) diff -r 2d206defd974 -r 749369ad65a9 gameServer/OfficialServer/checker.hs --- a/gameServer/OfficialServer/checker.hs Mon Dec 30 13:33:58 2013 -0500 +++ b/gameServer/OfficialServer/checker.hs Mon Dec 30 14:56:47 2013 -0500 @@ -36,7 +36,7 @@ deriving Show serverAddress = "netserver.hedgewars.org" -protocolNumber = "45" +protocolNumber = "47" getLines :: Handle -> IO [B.ByteString] getLines h = g @@ -77,10 +77,10 @@ hFlush h hClose h - (_, _, Just hOut, _) <- createProcess (proc "/usr/home/unC0Rr/Sources/Hedgewars/Releases/0.9.19/bin/hwengine" + (_, _, Just hOut, _) <- createProcess (proc "/usr/home/unC0Rr/Sources/Hedgewars/Releases/0.9.20/bin/hwengine" [fileName , "--user-prefix", "/usr/home/unC0Rr/.hedgewars" - , "--prefix", "/usr/home/unC0Rr/Sources/Hedgewars/Releases/0.9.19/share/hedgewars/Data" + , "--prefix", "/usr/home/unC0Rr/Sources/Hedgewars/Releases/0.9.20/share/hedgewars/Data" , "--nomusic" , "--nosound" , "--stats-only" diff -r 2d206defd974 -r 749369ad65a9 gameServer/OfficialServer/extdbinterface.hs --- a/gameServer/OfficialServer/extdbinterface.hs Mon Dec 30 13:33:58 2013 -0500 +++ b/gameServer/OfficialServer/extdbinterface.hs Mon Dec 30 14:56:47 2013 -0500 @@ -26,9 +26,9 @@ "INSERT INTO gameserver_stats (players, rooms, last_update) VALUES (?, ?, UNIX_TIMESTAMP())" dbQueryAchievement = - "INSERT INTO achievements (time, typeid, userid, value, filename, location) \ + "INSERT INTO achievements (time, typeid, userid, value, filename, location, protocol) \ \ VALUES (?, (SELECT id FROM achievement_types WHERE name = ?), (SELECT uid FROM users WHERE name = ?), \ - \ ?, ?, ?)" + \ ?, ?, ?, ?)" dbQueryReplayFilename = "SELECT filename FROM achievements WHERE id = ?" @@ -70,15 +70,15 @@ SendStats clients rooms -> run dbConn dbQueryStats [SqlInt32 $ fromIntegral clients, SqlInt32 $ fromIntegral rooms] >> return () --StoreAchievements (B.pack fileName) (map toPair teams) info - StoreAchievements fileName teams info -> - mapM_ (run dbConn dbQueryAchievement) $ (parseStats fileName teams) info + StoreAchievements p fileName teams info -> + mapM_ (run dbConn dbQueryAchievement) $ (parseStats p fileName teams) info readTime = read . B.unpack . B.take 19 . B.drop 8 -parseStats :: B.ByteString -> [(B.ByteString, B.ByteString)] -> [B.ByteString] -> [[SqlValue]] -parseStats fileName teams = ps +parseStats :: Word16 -> B.ByteString -> [(B.ByteString, B.ByteString)] -> [B.ByteString] -> [[SqlValue]] +parseStats p fileName teams = ps where time = readTime fileName ps [] = [] @@ -91,6 +91,7 @@ , SqlInt32 (readInt_ value) , SqlByteString fileName , SqlByteString location + , SqlInt32 p ] : ps bs ps (b:bs) = ps bs diff -r 2d206defd974 -r 749369ad65a9 hedgewars/uGearsHandlersMess.pas diff -r 2d206defd974 -r 749369ad65a9 hedgewars/uLand.pas --- a/hedgewars/uLand.pas Mon Dec 30 13:33:58 2013 -0500 +++ b/hedgewars/uLand.pas Mon Dec 30 14:56:47 2013 -0500 @@ -123,7 +123,7 @@ for x:= 0 to LAND_WIDTH - 1 do for y:= 0 to LAND_HEIGHT - 1 do - if LandPixels[y, x] = 0 then + if Land[y, x] = 0 then if s < y then begin for i:= max(s, y - 8) to y - 1 do @@ -157,7 +157,7 @@ for y:= 0 to LAND_HEIGHT - 1 do for x:= 0 to LAND_WIDTH - 1 do - if LandPixels[y, x] = 0 then + if Land[y, x] = 0 then if s < x then begin for i:= max(s, x - 8) to x - 1 do diff -r 2d206defd974 -r 749369ad65a9 hedgewars/uLandGraphics.pas --- a/hedgewars/uLandGraphics.pas Mon Dec 30 13:33:58 2013 -0500 +++ b/hedgewars/uLandGraphics.pas Mon Dec 30 14:56:47 2013 -0500 @@ -40,7 +40,7 @@ procedure DrawHLinesExplosions(ar: PRangeArray; Radius: LongInt; y, dY: LongInt; Count: Byte); procedure DrawTunnel(X, Y, dX, dY: hwFloat; ticks, HalfWidth: LongInt); procedure FillRoundInLand(X, Y, Radius: LongInt; Value: Longword); -function FillRoundInLand(X, Y, Radius: LongInt; fill: fillType): LongWord; +function FillRoundInLandFT(X, Y, Radius: LongInt; fill: fillType): Longword; procedure ChangeRoundInLand(X, Y, Radius: LongInt; doSet, isCurrent: boolean); function LandBackPixel(x, y: LongInt): LongWord; procedure DrawLine(X1, Y1, X2, Y2: LongInt; Color: Longword); @@ -171,44 +171,44 @@ end; -function FillLandCircleLine(y, fromPix, toPix: LongInt; fill : fillType): Longword; +function FillLandCircleLineFT(y, fromPix, toPix: LongInt; fill : fillType): Longword; var px, py, i: LongInt; begin //get rid of compiler warning px := 0; py := 0; - FillLandCircleLine := 0; + FillLandCircleLineFT := 0; case fill of backgroundPixel: - for i:= fromPix to toPix do - begin - calculatePixelsCoordinates(i, y, px, py); - inc(FillLandCircleLine, drawPixelBG(i, y, px, py)); - end; + for i:= fromPix to toPix do + begin + calculatePixelsCoordinates(i, y, px, py); + inc(FillLandCircleLineFT, drawPixelBG(i, y, px, py)); + end; ebcPixel: - for i:= fromPix to toPix do - begin - calculatePixelsCoordinates(i, y, px, py); - drawPixelEBC(i, y, px, py); - end; + for i:= fromPix to toPix do + begin + calculatePixelsCoordinates(i, y, px, py); + drawPixelEBC(i, y, px, py); + end; nullPixel: - for i:= fromPix to toPix do - begin - calculatePixelsCoordinates(i, y, px, py); - if ((Land[y, i] and lfIndestructible) = 0) and (not disableLandBack or (Land[y, i] > 255)) then - LandPixels[py, px]:= 0 - end; + for i:= fromPix to toPix do + begin + calculatePixelsCoordinates(i, y, px, py); + if ((Land[y, i] and lfIndestructible) = 0) and (not disableLandBack or (Land[y, i] > 255)) then + LandPixels[py, px]:= 0 + end; icePixel: - for i:= fromPix to toPix do - begin - calculatePixelsCoordinates(i, y, px, py); - DrawPixelIce(i, y, px, py); - end; + for i:= fromPix to toPix do + begin + calculatePixelsCoordinates(i, y, px, py); + DrawPixelIce(i, y, px, py); + end; setNotCurrentMask: - for i:= fromPix to toPix do - begin - Land[y, i]:= Land[y, i] and lfNotCurrentMask; - end; + for i:= fromPix to toPix do + begin + Land[y, i]:= Land[y, i] and lfNotCurrentMask; + end; changePixelSetNotCurrent: for i:= fromPix to toPix do begin @@ -216,10 +216,10 @@ Land[y, i]:= Land[y, i] - 1; end; setCurrentHog: - for i:= fromPix to toPix do - begin - Land[y, i]:= Land[y, i] or lfCurrentHog - end; + for i:= fromPix to toPix do + begin + Land[y, i]:= Land[y, i] or lfCurrentHog + end; changePixelNotSetNotCurrent: for i:= fromPix to toPix do begin @@ -229,29 +229,29 @@ end; end; -function FillLandCircleSegment(x, y, dx, dy: LongInt; fill : fillType): Longword; inline; +function FillLandCircleSegmentFT(x, y, dx, dy: LongInt; fill : fillType): Longword; inline; begin - FillLandCircleSegment := 0; + FillLandCircleSegmentFT := 0; if ((y + dy) and LAND_HEIGHT_MASK) = 0 then - inc(FillLandCircleSegment, FillLandCircleLine(y + dy, Max(x - dx, 0), Min(x + dx, LAND_WIDTH - 1), fill)); + inc(FillLandCircleSegmentFT, FillLandCircleLineFT(y + dy, Max(x - dx, 0), Min(x + dx, LAND_WIDTH - 1), fill)); if ((y - dy) and LAND_HEIGHT_MASK) = 0 then - inc(FillLandCircleSegment, FillLandCircleLine(y - dy, Max(x - dx, 0), Min(x + dx, LAND_WIDTH - 1), fill)); + inc(FillLandCircleSegmentFT, FillLandCircleLineFT(y - dy, Max(x - dx, 0), Min(x + dx, LAND_WIDTH - 1), fill)); if ((y + dx) and LAND_HEIGHT_MASK) = 0 then - inc(FillLandCircleSegment, FillLandCircleLine(y + dx, Max(x - dy, 0), Min(x + dy, LAND_WIDTH - 1), fill)); + inc(FillLandCircleSegmentFT, FillLandCircleLineFT(y + dx, Max(x - dy, 0), Min(x + dy, LAND_WIDTH - 1), fill)); if ((y - dx) and LAND_HEIGHT_MASK) = 0 then - inc(FillLandCircleSegment, FillLandCircleLine(y - dx, Max(x - dy, 0), Min(x + dy, LAND_WIDTH - 1), fill)); + inc(FillLandCircleSegmentFT, FillLandCircleLineFT(y - dx, Max(x - dy, 0), Min(x + dy, LAND_WIDTH - 1), fill)); end; -function FillRoundInLand(X, Y, Radius: LongInt; fill: fillType): Longword; inline; +function FillRoundInLandFT(X, Y, Radius: LongInt; fill: fillType): Longword; inline; var dx, dy, d: LongInt; begin dx:= 0; dy:= Radius; d:= 3 - 2 * Radius; -FillRoundInLand := 0; +FillRoundInLandFT := 0; while (dx < dy) do begin - inc(FillRoundInLand, FillLandCircleSegment(x, y, dx, dy, fill)); + inc(FillRoundInLandFT, FillLandCircleSegmentFT(x, y, dx, dy, fill)); if (d < 0) then d:= d + 4 * dx + 6 else @@ -262,7 +262,7 @@ inc(dx) end; if (dx = dy) then - inc (FillRoundInLand, FillLandCircleSegment(x, y, dx, dy, fill)); + inc (FillRoundInLandFT, FillLandCircleSegmentFT(x, y, dx, dy, fill)); end; @@ -343,13 +343,13 @@ procedure ChangeRoundInLand(X, Y, Radius: LongInt; doSet, isCurrent: boolean); begin if not doSet and isCurrent then - FillRoundInLand(X, Y, Radius, setNotCurrentMask) + FillRoundInLandFT(X, Y, Radius, setNotCurrentMask) else if not doSet and not IsCurrent then - FillRoundInLand(X, Y, Radius, changePixelSetNotCurrent) + FillRoundInLandFT(X, Y, Radius, changePixelSetNotCurrent) else if doSet and IsCurrent then - FillRoundInLand(X, Y, Radius, setCurrentHog) + FillRoundInLandFT(X, Y, Radius, setCurrentHog) else if doSet and not IsCurrent then - FillRoundInLand(X, Y, Radius, changePixelNotSetNotCurrent); + FillRoundInLandFT(X, Y, Radius, changePixelNotSetNotCurrent); end; procedure DrawIceBreak(x, y, iceRadius, iceHeight: Longint); @@ -379,11 +379,11 @@ var tx, ty, dx, dy: Longint; begin - DrawExplosion := FillRoundInLand(x, y, Radius, backgroundPixel); + DrawExplosion := FillRoundInLandFT(x, y, Radius, backgroundPixel); if Radius > 20 then - FillRoundInLand(x, y, Radius - 15, nullPixel); + FillRoundInLandFT(x, y, Radius - 15, nullPixel); FillRoundInLand(X, Y, Radius, 0); - FillRoundInLand(x, y, Radius + 4, ebcPixel); + FillRoundInLandFT(x, y, Radius + 4, ebcPixel); tx:= Max(X - Radius - 5, 0); dx:= Min(X + Radius + 5, LAND_WIDTH) - tx; ty:= Max(Y - Radius - 5, 0); diff -r 2d206defd974 -r 749369ad65a9 misc/libphysfs/platform_unix.c --- a/misc/libphysfs/platform_unix.c Mon Dec 30 13:33:58 2013 -0500 +++ b/misc/libphysfs/platform_unix.c Mon Dec 30 14:56:47 2013 -0500 @@ -193,7 +193,7 @@ if (access(exe, X_OK) == 0) /* Exists as executable? We're done. */ { - exe[size - binlen] = '\0'; /* chop off filename, leave '/' */ + exe[size - binlen - 1] = '\0'; /* chop off filename, leave '/' */ return exe; } /* if */ diff -r 2d206defd974 -r 749369ad65a9 share/hedgewars/Data/Graphics/amRubber.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/share/hedgewars/Data/Graphics/amRubber.svg Mon Dec 30 14:56:47 2013 -0500 @@ -0,0 +1,657 @@ + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +