From: <je...@us...> - 2007-05-24 18:54:34
|
Revision: 1392 http://cs-sdl.svn.sourceforge.net/cs-sdl/?rev=1392&view=rev Author: jendave Date: 2007-05-24 11:54:29 -0700 (Thu, 24 May 2007) Log Message: ----------- fxcop fixes Modified Paths: -------------- trunk/scsharp/src/SCSharpLib/MpqLib/Chk.cs trunk/scsharp/src/SCSharpLib/MpqLib/MapDataDat.cs trunk/scsharp/src/SCSharpLib/Properties/AssemblyInfo.cs trunk/scsharp/src/SCSharpLib/UI/BriefingRunner.cs trunk/scsharp/src/SCSharpLib/UI/ButtonElement.cs trunk/scsharp/src/SCSharpLib/UI/ComboBoxElement.cs trunk/scsharp/src/SCSharpLib/UI/CursorAnimator.cs trunk/scsharp/src/SCSharpLib/UI/DialogBoxElement.cs trunk/scsharp/src/SCSharpLib/UI/FFmpeg.cs trunk/scsharp/src/SCSharpLib/UI/Game.cs trunk/scsharp/src/SCSharpLib/UI/GameModeDialog.cs trunk/scsharp/src/SCSharpLib/UI/GameScreen.cs trunk/scsharp/src/SCSharpLib/UI/GlobalResources.cs trunk/scsharp/src/SCSharpLib/UI/GuiUtil.cs trunk/scsharp/src/SCSharpLib/UI/ImageElement.cs trunk/scsharp/src/SCSharpLib/UI/LabelElement.cs trunk/scsharp/src/SCSharpLib/UI/ListBoxElement.cs trunk/scsharp/src/SCSharpLib/UI/MainMenu.cs trunk/scsharp/src/SCSharpLib/UI/MapRenderer.cs trunk/scsharp/src/SCSharpLib/UI/MarkupScreen.cs trunk/scsharp/src/SCSharpLib/UI/Painter.cs trunk/scsharp/src/SCSharpLib/UI/PlayCustomScreen.cs trunk/scsharp/src/SCSharpLib/UI/ReadyRoomScreen.cs trunk/scsharp/src/SCSharpLib/UI/SmackerPlayer.cs trunk/scsharp/src/SCSharpLib/UI/Sprite.cs trunk/scsharp/src/SCSharpLib/UI/SpriteManager.cs trunk/scsharp/src/SCSharpLib/UI/TextBoxElement.cs trunk/scsharp/src/SCSharpLib/UI/UIDialog.cs trunk/scsharp/src/SCSharpLib/UI/UIElement.cs trunk/scsharp/src/SCSharpLib/UI/UIScreen.cs trunk/scsharp/src/SCSharpLib/UI/Unit.cs trunk/scsharp/src/SCSharpLib/UI/Utilities.cs trunk/scsharp/tests/DumpChk.cs trunk/scsharp/tests/FontFoo.cs Modified: trunk/scsharp/src/SCSharpLib/MpqLib/Chk.cs =================================================================== --- trunk/scsharp/src/SCSharpLib/MpqLib/Chk.cs 2007-05-23 17:45:10 UTC (rev 1391) +++ trunk/scsharp/src/SCSharpLib/MpqLib/Chk.cs 2007-05-24 18:54:29 UTC (rev 1392) @@ -39,7 +39,7 @@ /// <summary> /// /// </summary> - public enum Tileset + public enum TileSet { /// <summary> /// @@ -220,7 +220,7 @@ } else if (sectionName == "ERA ") { - tileSet = (Tileset)Utilities.ReadWord(sectionData, 0); + tileSet = (TileSet)Utilities.ReadWord(sectionData, 0); } else if (sectionName == "DIM ") { @@ -269,7 +269,7 @@ } else if (sectionName == "OWNR") { - numPlayers = 0; + numberOfPlayers = 0; for (int i = 0; i < 12; i++) { /* @@ -281,11 +281,11 @@ */ if (sectionData[i] == 0x05) { - numComputerSlots++; + numberOfComputerSlots++; } else if (sectionData[i] == 0x06) { - numHumanSlots++; + numberOfHumanSlots++; } } } @@ -301,12 +301,12 @@ 07 - Inactive 10 - Human */ - numPlayers = 0; + numberOfPlayers = 0; for (int i = 0; i < 12; i++) { if (sectionData[i] == 0x05) /* user select */ { - numPlayers++; + numberOfPlayers++; } } } @@ -404,15 +404,15 @@ /// <summary> /// /// </summary> - /// <param name="idx"></param> + /// <param name="index"></param> /// <returns></returns> - public string GetMapString(int idx) + public string GetMapString(int index) { - if (idx == 0) + if (index == 0) { return ""; } - return strings[idx - 1]; + return strings[index - 1]; } string mapName; @@ -443,11 +443,11 @@ get { return scenarioType; } } - Tileset tileSet; + TileSet tileSet; /// <summary> /// /// </summary> - public Tileset Tileset + public TileSet TileSet { get { return tileSet; } } @@ -521,31 +521,31 @@ } } - int numComputerSlots; + int numberOfComputerSlots; /// <summary> /// /// </summary> - public int NumComputerSlots + public int NumberOfComputerSlots { - get { return numComputerSlots; } + get { return numberOfComputerSlots; } } - int numHumanSlots; + int numberOfHumanSlots; /// <summary> /// /// </summary> - public int NumHumanSlots + public int NumberOfHumanSlots { - get { return numHumanSlots; } + get { return numberOfHumanSlots; } } - int numPlayers; + int numberOfPlayers; /// <summary> /// /// </summary> - public int NumPlayers + public int NumberOfPlayers { - get { return numPlayers; } + get { return numberOfPlayers; } } TriggerData briefingData; Modified: trunk/scsharp/src/SCSharpLib/MpqLib/MapDataDat.cs =================================================================== --- trunk/scsharp/src/SCSharpLib/MpqLib/MapDataDat.cs 2007-05-23 17:45:10 UTC (rev 1391) +++ trunk/scsharp/src/SCSharpLib/MpqLib/MapDataDat.cs 2007-05-24 18:54:29 UTC (rev 1392) @@ -77,7 +77,7 @@ /// <summary> /// /// </summary> - public int NumIndexes + public int NumberOfIndexes { get { return buf.Length / 4; } } Modified: trunk/scsharp/src/SCSharpLib/Properties/AssemblyInfo.cs =================================================================== --- trunk/scsharp/src/SCSharpLib/Properties/AssemblyInfo.cs 2007-05-23 17:45:10 UTC (rev 1391) +++ trunk/scsharp/src/SCSharpLib/Properties/AssemblyInfo.cs 2007-05-24 18:54:29 UTC (rev 1392) @@ -71,3 +71,74 @@ [module: SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", Scope = "member", Target = "SCSharp.UI.GameScreen..ctor(SCSharp.MpqLib.Mpq,System.String,SCSharp.MpqLib.Chk)", MessageId = "0#mpq")] [module: SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", Scope = "member", Target = "SCSharp.UI.CreditsScreen..ctor(SCSharp.MpqLib.Mpq)", MessageId = "0#mpq")] [module: SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", Scope = "member", Target = "SCSharp.UI.EndMissionDialog..ctor(SCSharp.UI.UIScreen,SCSharp.MpqLib.Mpq)", MessageId = "1#mpq")] +[module: SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", Scope = "member", Target = "SCSharp.MpqLib.UnitsDat.GetFlingyId(System.Int32):System.Byte", MessageId = "Flingy")] +[module: SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", Scope = "member", Target = "SCSharp.MpqLib.ImagesDat.GetGrpIndex(System.UInt32):System.UInt16", MessageId = "Grp")] +[module: SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", Scope = "type", Target = "SCSharp.MpqLib.MpqDirectory", MessageId = "Mpq")] +[module: SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", Scope = "type", Target = "SCSharp.MpqLib.Grp", MessageId = "Grp")] +[module: SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", Scope = "type", Target = "SCSharp.MpqLib.SfxDataDat", MessageId = "Sfx")] +[module: SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", Scope = "type", Target = "SCSharp.MpqLib.MpqArchive", MessageId = "Mpq")] +[module: SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", Scope = "member", Target = "SCSharp.MpqLib.TileSet.Ashworld", MessageId = "Ashworld")] +[module: SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", Scope = "type", Target = "SCSharp.MpqLib.Tbl", MessageId = "Tbl")] +[module: SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", Scope = "type", Target = "SCSharp.MpqLib.Spk", MessageId = "Spk")] +[module: SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", Scope = "type", Target = "SCSharp.MpqLib.Chk", MessageId = "Chk")] +[module: SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", Scope = "type", Target = "SCSharp.MpqLib.MpqWavCompression", MessageId = "Mpq")] +[module: SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", Scope = "type", Target = "SCSharp.MpqLib.FlingyDat", MessageId = "Flingy")] +[module: SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", Scope = "type", Target = "SCSharp.UI.ProtossReadyRoomScreen", MessageId = "Protoss")] +[module: SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", Scope = "member", Target = "SCSharp.UI.ProtossReadyRoomScreen..ctor(SCSharp.MpqLib.Mpq,System.String)", MessageId = "0#mpq")] +[module: SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", Scope = "member", Target = "SCSharp.UI.Unit.FlingyId", MessageId = "Flingy")] +[module: SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", Scope = "member", Target = "SCSharp.UI.Unit.CreateSprite(SCSharp.MpqLib.Mpq,System.Byte[]):SCSharp.UI.Sprite", MessageId = "0#mpq")] +[module: SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", Scope = "type", Target = "SCSharp.UI.TerranReadyRoomScreen", MessageId = "Terran")] +[module: SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", Scope = "member", Target = "SCSharp.UI.TerranReadyRoomScreen..ctor(SCSharp.MpqLib.Mpq,System.String)", MessageId = "0#mpq")] +[module: SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", Scope = "type", Target = "SCSharp.UI.Pcx", MessageId = "Pcx")] +[module: SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", Scope = "member", Target = "SCSharp.UI.Pcx.RgbaData", MessageId = "Rgba")] +[module: SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", Scope = "member", Target = "SCSharp.UI.Pcx.RgbData", MessageId = "Rgb")] +[module: SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", Scope = "member", Target = "SCSharp.UI.ConnectionScreen..ctor(SCSharp.MpqLib.Mpq)", MessageId = "0#mpq")] +[module: SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", Scope = "member", Target = "SCSharp.UI.UIElement.Mpq", MessageId = "Mpq")] +[module: SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", Scope = "member", Target = "SCSharp.UI.TitleScreen..ctor(SCSharp.MpqLib.Mpq)", MessageId = "0#mpq")] +[module: SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", Scope = "member", Target = "SCSharp.UI.GlobalResources.MapDataTbl", MessageId = "Tbl")] +[module: SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", Scope = "member", Target = "SCSharp.UI.GlobalResources.BroodDataMpq", MessageId = "Mpq")] +[module: SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", Scope = "member", Target = "SCSharp.UI.GlobalResources.SfxDataTbl", MessageId = "Sfx")] +[module: SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", Scope = "member", Target = "SCSharp.UI.GlobalResources.SfxDataTbl", MessageId = "Tbl")] +[module: SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", Scope = "member", Target = "SCSharp.UI.GlobalResources.SfxDataDat", MessageId = "Sfx")] +[module: SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", Scope = "member", Target = "SCSharp.UI.GlobalResources.ImagesTbl", MessageId = "Tbl")] +[module: SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", Scope = "member", Target = "SCSharp.UI.GlobalResources.StarDataMpq", MessageId = "Mpq")] +[module: SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", Scope = "member", Target = "SCSharp.UI.GlobalResources.GluAllTbl", MessageId = "Tbl")] +[module: SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", Scope = "member", Target = "SCSharp.UI.GlobalResources.GluAllTbl", MessageId = "Glu")] +[module: SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", Scope = "member", Target = "SCSharp.UI.GlobalResources.SpritesTbl", MessageId = "Tbl")] +[module: SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", Scope = "member", Target = "SCSharp.UI.GlobalResources.LoadMpq(SCSharp.MpqLib.Mpq,SCSharp.MpqLib.Mpq):System.Void", MessageId = "0#Mpq")] +[module: SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", Scope = "member", Target = "SCSharp.UI.GlobalResources.LoadMpq(SCSharp.MpqLib.Mpq,SCSharp.MpqLib.Mpq):System.Void", MessageId = "Mpq")] +[module: SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", Scope = "member", Target = "SCSharp.UI.GlobalResources.LoadMpq(SCSharp.MpqLib.Mpq,SCSharp.MpqLib.Mpq):System.Void", MessageId = "1#Mpq")] +[module: SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", Scope = "member", Target = "SCSharp.UI.GlobalResources.FlingyDat", MessageId = "Flingy")] +[module: SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", Scope = "member", Target = "SCSharp.UI.Sprite.Mpq", MessageId = "Mpq")] +[module: SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", Scope = "member", Target = "SCSharp.UI.Sprite..ctor(SCSharp.MpqLib.Mpq,System.Int32,System.Byte[],System.Int32,System.Int32)", MessageId = "0#mpq")] +[module: SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", Scope = "type", Target = "SCSharp.UI.ZergReadyRoomScreen", MessageId = "Zerg")] +[module: SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", Scope = "type", Target = "SCSharp.UI.FFmpeg", MessageId = "Fmpeg")] +[module: SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", Scope = "member", Target = "SCSharp.UI.SCResources.MapDataTbl", MessageId = "Tbl")] +[module: SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", Scope = "member", Target = "SCSharp.UI.SCResources.SfxDataTbl", MessageId = "Sfx")] +[module: SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", Scope = "member", Target = "SCSharp.UI.SCResources.SfxDataTbl", MessageId = "Tbl")] +[module: SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", Scope = "member", Target = "SCSharp.UI.SCResources.SfxDataDat", MessageId = "Sfx")] +[module: SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", Scope = "member", Target = "SCSharp.UI.SCResources.ImagesTbl", MessageId = "Tbl")] +[module: SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", Scope = "member", Target = "SCSharp.UI.SCResources.FlingyDat", MessageId = "Flingy")] +[module: SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", Scope = "member", Target = "SCSharp.UI.SCResources.GluAllTbl", MessageId = "Tbl")] +[module: SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", Scope = "member", Target = "SCSharp.UI.SCResources.GluAllTbl", MessageId = "Glu")] +[module: SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", Scope = "member", Target = "SCSharp.UI.SCResources.SpritesTbl", MessageId = "Tbl")] +[module: SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", Scope = "member", Target = "SCSharp.UI.ReadyRoomScreen.Create(SCSharp.MpqLib.Mpq,System.String):SCSharp.UI.ReadyRoomScreen", MessageId = "0#mpq")] +[module: SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", Scope = "member", Target = "SCSharp.UI.ReadyRoomScreen..ctor(SCSharp.MpqLib.Mpq,System.String,System.Int32,System.Int32,System.Int32,System.Int32,System.Int32,System.Int32,System.Int32)", MessageId = "0#mpq")] +[module: SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", Scope = "member", Target = "SCSharp.UI.VideoDialog..ctor(SCSharp.UI.UIScreen,SCSharp.MpqLib.Mpq)", MessageId = "1#mpq")] +[module: SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", Scope = "member", Target = "SCSharp.UI.CursorAnimator..ctor(SCSharp.MpqLib.Grp,System.Byte[])", MessageId = "0#grp")] +[module: SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", Scope = "member", Target = "SCSharp.UI.SmackerPlayer.BlitSurface(SdlDotNet.Graphics.Surface):System.Void", MessageId = "Blit")] +[module: SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", Scope = "member", Target = "SCSharp.UI.ObjectivesDialog..ctor(SCSharp.UI.UIScreen,SCSharp.MpqLib.Mpq)", MessageId = "1#mpq")] +[module: SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", Scope = "member", Target = "SCSharp.UI.NetworkDialog..ctor(SCSharp.UI.UIScreen,SCSharp.MpqLib.Mpq)", MessageId = "1#mpq")] +[module: SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", Scope = "member", Target = "SCSharp.UI.QuitMissionDialog..ctor(SCSharp.UI.UIScreen,SCSharp.MpqLib.Mpq)", MessageId = "1#mpq")] +[module: SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", Scope = "member", Target = "SCSharp.UI.MarkupScreen..ctor(SCSharp.MpqLib.Mpq)", MessageId = "0#mpq")] +[module: SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", Scope = "member", Target = "SCSharp.UI.Race.Zerg", MessageId = "Zerg")] +[module: SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", Scope = "member", Target = "SCSharp.UI.Race.Terran", MessageId = "Terran")] +[module: SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", Scope = "member", Target = "SCSharp.UI.Race.Protoss", MessageId = "Protoss")] +[module: SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", Scope = "member", Target = "SCSharp.UI.Cinematic..ctor(SCSharp.MpqLib.Mpq,System.String)", MessageId = "0#mpq")] +[module: SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", Scope = "member", Target = "SCSharp.UI.OptionsDialog..ctor(SCSharp.UI.UIScreen,SCSharp.MpqLib.Mpq)", MessageId = "1#mpq")] +[module: SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", Scope = "member", Target = "SCSharp.UI.ExitConfirmationDialog..ctor(SCSharp.UI.UIScreen,SCSharp.MpqLib.Mpq)", MessageId = "1#mpq")] +[module: SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", Scope = "member", Target = "SCSharp.UI.SpriteManager.CreateSprite(SCSharp.MpqLib.Mpq,System.Int32,System.Byte[],System.Int32,System.Int32):SCSharp.UI.Sprite", MessageId = "0#mpq")] +[module: SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", Scope = "member", Target = "SCSharp.UI.UIScreen.Mpq", MessageId = "Mpq")] +[module: SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", Scope = "member", Target = "SCSharp.UI.UIScreen.ArrowGrpPath", MessageId = "Grp")] +[module: SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", Scope = "member", Target = "SCSharp.UI.UIScreen..ctor(SCSharp.MpqLib.Mpq,System.String,System.String)", MessageId = "0#mpq")] +[module: SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", Scope = "member", Target = "SCSharp.UI.UIScreen..ctor(SCSharp.MpqLib.Mpq)", MessageId = "0#mpq")] Modified: trunk/scsharp/src/SCSharpLib/UI/BriefingRunner.cs =================================================================== --- trunk/scsharp/src/SCSharpLib/UI/BriefingRunner.cs 2007-05-23 17:45:10 UTC (rev 1391) +++ trunk/scsharp/src/SCSharpLib/UI/BriefingRunner.cs 2007-05-24 18:54:29 UTC (rev 1392) @@ -129,7 +129,7 @@ sleepUntil = (int)action.Delay; return; case 2: - GuiUtil.PlaySound(screen.Mpq, prefix + "\\" + scenario.GetMapString((int)action.WavIndex)); + GuiUtility.PlaySound(screen.Mpq, prefix + "\\" + scenario.GetMapString((int)action.WavIndex)); sleepUntil = (int)action.Delay; return; case 3: @@ -151,7 +151,7 @@ Console.WriteLine("Transmission(Text, Slot, Time, Modifier, Wave, WavTime)"); screen.SetTransmissionText(scenario.GetMapString((int)action.TextIndex)); screen.HighlightPortrait((int)action.Group1); - GuiUtil.PlaySound(screen.Mpq, prefix + "\\" + scenario.GetMapString((int)action.WavIndex)); + GuiUtility.PlaySound(screen.Mpq, prefix + "\\" + scenario.GetMapString((int)action.WavIndex)); sleepUntil = (int)action.Delay; return; default: Modified: trunk/scsharp/src/SCSharpLib/UI/ButtonElement.cs =================================================================== --- trunk/scsharp/src/SCSharpLib/UI/ButtonElement.cs 2007-05-23 17:45:10 UTC (rev 1391) +++ trunk/scsharp/src/SCSharpLib/UI/ButtonElement.cs 2007-05-24 18:54:29 UTC (rev 1392) @@ -66,7 +66,7 @@ surf.TransparentColor = Color.Black; /* XXX */ surf.Transparent = true; - Surface textSurf = GuiUtil.ComposeText(Text, Font, Palette, -1, -1, + Surface textSurf = GuiUtility.ComposeText(Text, Font, Palette, -1, -1, Sensitive ? 4 : 24); surf.Blit(textSurf, new Point((surf.Width - textSurf.Width) / 2, @@ -107,7 +107,7 @@ if (Sensitive && (Flags & SCElement.RespondToMouse) == SCElement.RespondToMouse) { /* highlight the text */ - GuiUtil.PlaySound(Mpq, Builtins.MouseoverWav); + GuiUtility.PlaySound(Mpq, Builtins.MouseoverWav); } base.MouseEnter(); } Modified: trunk/scsharp/src/SCSharpLib/UI/ComboBoxElement.cs =================================================================== --- trunk/scsharp/src/SCSharpLib/UI/ComboBoxElement.cs 2007-05-23 17:45:10 UTC (rev 1391) +++ trunk/scsharp/src/SCSharpLib/UI/ComboBoxElement.cs 2007-05-24 18:54:29 UTC (rev 1392) @@ -46,8 +46,8 @@ { List<string> items; int cursor = -1; - Surface dropdownSurface; - bool dropdownVisible; + Surface dropDownSurface; + bool dropDownVisible; int selectedItem; /// <summary> @@ -170,7 +170,7 @@ throw new ArgumentNullException("args"); } /* if the dropdown is visible, see if we're inside it */ - if (!dropdownVisible) + if (!dropDownVisible) { return; } @@ -178,7 +178,7 @@ starcraft doesn't include this check.. should we? args.X >= X1 && args.X < X1 + dropdownSurface.Width && */ - if (args.Y >= Y1 + Height && args.Y < Y1 + Height + dropdownSurface.Height) + if (args.Y >= Y1 + Height && args.Y < Y1 + Height + dropDownSurface.Height) { int new_selected_item = (args.Y - (Y1 + Height)) / Font.LineSize; @@ -192,12 +192,12 @@ void PaintDropdown(Surface surf, DateTime dt) { - surf.Blit(dropdownSurface, new Point(X1, Y1 + Height)); + surf.Blit(dropDownSurface, new Point(X1, Y1 + Height)); } void ShowDropdown() { - dropdownVisible = true; + dropDownVisible = true; selectedItem = cursor; CreateDropdownSurface(); ParentScreen.Painter.Add(Layer.Popup, PaintDropdown); @@ -205,7 +205,7 @@ void HideDropdown() { - dropdownVisible = false; + dropDownVisible = false; if (cursor != selectedItem) { cursor = selectedItem; @@ -230,7 +230,7 @@ if (cursor != -1) { - Surface itemSurface = GuiUtil.ComposeText(items[cursor], Font, Palette, 4); + Surface itemSurface = GuiUtility.ComposeText(items[cursor], Font, Palette, 4); itemSurface.TransparentColor = Color.Black; itemSurface.Transparent = true; @@ -242,18 +242,18 @@ void CreateDropdownSurface() { - dropdownSurface = new Surface(Width, items.Count * Font.LineSize); + dropDownSurface = new Surface(Width, items.Count * Font.LineSize); int y = 0; for (int i = 0; i < items.Count; i++) { - Surface itemSurface = GuiUtil.ComposeText(items[i], Font, Palette, + Surface itemSurface = GuiUtility.ComposeText(items[i], Font, Palette, i == selectedItem ? 4 : 24); itemSurface.TransparentColor = Color.Black; itemSurface.Transparent = true; - dropdownSurface.Blit(itemSurface, new Point(0, y)); + dropDownSurface.Blit(itemSurface, new Point(0, y)); y += itemSurface.Height; } } @@ -265,21 +265,53 @@ #region IDisposable Members + bool disposed; /// <summary> - /// + /// Destroy sprite /// </summary> + /// <param name="disposing">If true, remove all unamanged resources</param> + protected virtual void Dispose(bool disposing) + { + if (!this.disposed) + { + if (disposing) + { + if (this.dropDownSurface != null) + { + this.dropDownSurface.Dispose(); + this.dropDownSurface = null; + } + } + this.disposed = true; + } + } + + /// <summary> + /// Destroy object + /// </summary> public void Dispose() { - throw new SCException("The method or operation is not implemented."); + this.Dispose(true); + GC.SuppressFinalize(this); } + /// <summary> + /// Destroy object + /// </summary> + public void Close() + { + Dispose(); + } + + /// <summary> + /// Destroy object + /// </summary> + ~ComboBoxElement() + { + Dispose(false); + } + + #endregion } - - ///// <summary> - ///// - ///// </summary> - ///// <param name="e"></param> - ///// <param name="sender"></param> - //public delegate void ComboBoxSelectionChangedEventHandler(object sender, BoxSelectionChangedEventArgs e); } Modified: trunk/scsharp/src/SCSharpLib/UI/CursorAnimator.cs =================================================================== --- trunk/scsharp/src/SCSharpLib/UI/CursorAnimator.cs 2007-05-23 17:45:10 UTC (rev 1391) +++ trunk/scsharp/src/SCSharpLib/UI/CursorAnimator.cs 2007-05-24 18:54:29 UTC (rev 1392) @@ -48,8 +48,8 @@ Surface[] surfaces; - uint x; - uint y; + uint positionX; + uint positionY; uint hotX; uint hotY; @@ -69,8 +69,8 @@ } this.grp = grp; - this.x = 100; - this.y = 100; + this.positionX = 100; + this.positionY = 100; this.palette = palette; surfaces = new Surface[grp.FrameCount]; } @@ -90,31 +90,31 @@ /// <summary> /// /// </summary> - /// <param name="x"></param> - /// <param name="y"></param> + /// <param name="positionX"></param> + /// <param name="positionY"></param> [CLSCompliant(false)] - public void SetPosition(uint x, uint y) + public void SetPosition(uint positionX, uint positionY) { - this.x = x; - this.y = y; + this.positionX = positionX; + this.positionY = positionY; } /// <summary> /// /// </summary> [CLSCompliant(false)] - public uint X + public uint PositionX { - get { return x; } + get { return positionX; } } /// <summary> /// /// </summary> [CLSCompliant(false)] - public uint Y + public uint PositionY { - get { return y; } + get { return positionY; } } /// <summary> @@ -155,8 +155,8 @@ } last = now; - int drawX = (int)(x - hotX); - int drawY = (int)(y - hotY); + int drawX = (int)(positionX - hotX); + int drawY = (int)(positionY - hotY); if (currentFrame == grp.FrameCount) { @@ -165,7 +165,7 @@ if (surfaces[currentFrame] == null) { - surfaces[currentFrame] = GuiUtil.CreateSurfaceFromBitmap(grp.GetFrame(currentFrame), + surfaces[currentFrame] = GuiUtility.CreateSurfaceFromBitmap(grp.GetFrame(currentFrame), grp.Width, grp.Height, palette, true); Modified: trunk/scsharp/src/SCSharpLib/UI/DialogBoxElement.cs =================================================================== --- trunk/scsharp/src/SCSharpLib/UI/DialogBoxElement.cs 2007-05-23 17:45:10 UTC (rev 1391) +++ trunk/scsharp/src/SCSharpLib/UI/DialogBoxElement.cs 2007-05-24 18:54:29 UTC (rev 1392) @@ -70,18 +70,18 @@ static void TileRow(Surface surf, Grp grp, byte[] pal, int l, int c, int r, int y) { - Surface lsurf = GuiUtil.CreateSurfaceFromBitmap(grp.GetFrame(l), + Surface lsurf = GuiUtility.CreateSurfaceFromBitmap(grp.GetFrame(l), grp.Width, grp.Height, pal, 41, 0); - Surface csurf = GuiUtil.CreateSurfaceFromBitmap(grp.GetFrame(c), + Surface csurf = GuiUtility.CreateSurfaceFromBitmap(grp.GetFrame(c), grp.Width, grp.Height, pal, 41, 0); - Surface rsurf = GuiUtil.CreateSurfaceFromBitmap(grp.GetFrame(r), + Surface rsurf = GuiUtility.CreateSurfaceFromBitmap(grp.GetFrame(r), grp.Width, grp.Height, pal, 41, 0); Modified: trunk/scsharp/src/SCSharpLib/UI/FFmpeg.cs =================================================================== --- trunk/scsharp/src/SCSharpLib/UI/FFmpeg.cs 2007-05-23 17:45:10 UTC (rev 1391) +++ trunk/scsharp/src/SCSharpLib/UI/FFmpeg.cs 2007-05-24 18:54:29 UTC (rev 1392) @@ -66,8 +66,8 @@ /// /// </summary> /// <param name="fileName"></param> - /// <param name="buf"></param> - public FFmpeg(string fileName, byte[] buf) + /// <param name="buffer"></param> + public FFmpeg(string fileName, byte[] buffer) { //if (!initSucceeded) //{ @@ -102,9 +102,9 @@ /// <summary> /// /// </summary> - /// <param name="buf"></param> + /// <param name="buffer"></param> /// <returns></returns> - public bool GetNextFrame(byte[] buf) + public bool GetNextFrame(byte[] buffer) { return true; //get_next_frame(handle, buf); } Modified: trunk/scsharp/src/SCSharpLib/UI/Game.cs =================================================================== --- trunk/scsharp/src/SCSharpLib/UI/Game.cs 2007-05-23 17:45:10 UTC (rev 1391) +++ trunk/scsharp/src/SCSharpLib/UI/Game.cs 2007-05-24 18:54:29 UTC (rev 1392) @@ -107,10 +107,10 @@ /// <summary> /// /// </summary> - /// <param name="starcraftDir"></param> + /// <param name="scProgramDir"></param> /// <param name="scCDDir"></param> /// <param name="bwCDDir"></param> - public Game(string starcraftDir, string scCDDir, string bwCDDir) + public Game(string scProgramDir, string scCDDir, string bwCDDir) { instance = this; @@ -119,9 +119,9 @@ installedMpq = new MpqContainer(); playingMpq = new MpqContainer(); - if (starcraftDir != null) + if (scProgramDir != null) { - foreach (string path in Directory.GetFileSystemEntries(starcraftDir)) + foreach (string path in Directory.GetFileSystemEntries(scProgramDir)) { if (Path.GetFileName(path).ToLower() == "broodat.mpq") { @@ -224,7 +224,7 @@ PlayingBroodWar = (broodatMpq != null); isBroodWar = (broodatMpq != null); - this.rootDir = starcraftDir; + this.rootDir = scProgramDir; } static Mpq GetMpq(string path) Modified: trunk/scsharp/src/SCSharpLib/UI/GameModeDialog.cs =================================================================== --- trunk/scsharp/src/SCSharpLib/UI/GameModeDialog.cs 2007-05-23 17:45:10 UTC (rev 1391) +++ trunk/scsharp/src/SCSharpLib/UI/GameModeDialog.cs 2007-05-24 18:54:29 UTC (rev 1392) @@ -72,7 +72,7 @@ Console.WriteLine("{0}: {1}", i, Elements[i].Text); } - Elements[TITLE_ELEMENT_INDEX].Text = GlobalResources.BrooDat.GluAllTbl.Strings[172]; + Elements[TITLE_ELEMENT_INDEX].Text = GlobalResources.BroodDat.GluAllTbl.Strings[172]; Elements[ORIGINAL_ELEMENT_INDEX].Activate += delegate(object sender, SCEventArgs args) Modified: trunk/scsharp/src/SCSharpLib/UI/GameScreen.cs =================================================================== --- trunk/scsharp/src/SCSharpLib/UI/GameScreen.cs 2007-05-23 17:45:10 UTC (rev 1391) +++ trunk/scsharp/src/SCSharpLib/UI/GameScreen.cs 2007-05-24 18:54:29 UTC (rev 1392) @@ -112,9 +112,9 @@ Got template) : base(mpq) { - this.EffectpalPath = "game\\tblink.pcx"; - this.ArrowgrpPath = "cursor\\arrow.grp"; - this.FontpalPath = "game\\tfontgam.pcx"; + this.EffectPalettePath = "game\\tblink.pcx"; + this.ArrowGrpPath = "cursor\\arrow.grp"; + this.FontPalettePath = "game\\tfontgam.pcx"; //this.scenario_mpq = scenario_mpq; this.scenario = scenario; this.template = template; @@ -132,9 +132,9 @@ Chk scenario) : base(mpq) { - this.EffectpalPath = "game\\tblink.pcx"; - this.ArrowgrpPath = "cursor\\arrow.grp"; - this.FontpalPath = "game\\tfontgam.pcx"; + this.EffectPalettePath = "game\\tblink.pcx"; + this.ArrowGrpPath = "cursor\\arrow.grp"; + this.FontPalettePath = "game\\tfontgam.pcx"; //this.scenario_mpq = scenario_mpq; this.scenario = scenario; ScrollCursors = new CursorAnimator[8]; @@ -247,7 +247,7 @@ painter.Add(Layer.Hud, PaintHud); painter.Add(Layer.Hud, PaintMinimap); - if (scenario.Tileset == Tileset.Platform) + if (scenario.TileSet == TileSet.Platform) { painter.Add(Layer.Background, PaintStarfield); } @@ -271,7 +271,7 @@ painter.Remove(Layer.Hud, PaintHud); painter.Remove(Layer.Hud, PaintMinimap); - if (scenario.Tileset == Tileset.Platform) + if (scenario.TileSet == TileSet.Platform) { painter.Remove(Layer.Background, PaintStarfield); } @@ -297,11 +297,11 @@ pcx.ReadFromStream((Stream)this.Mpq.GetResource("tileset\\badlands\\dark.pcx"), 0, 0); tileset_palette = pcx.Palette; - hud = GuiUtil.SurfaceFromStream((Stream)this.Mpq.GetResource(String.Format(Builtins.GameConsolePcx, + hud = GuiUtility.SurfaceFromStream((Stream)this.Mpq.GetResource(String.Format(Builtins.GameConsolePcx, Utilities.RaceCharLower[(int)Game.Instance.Race])), 254, 0); - if (scenario.Tileset == Tileset.Platform) + if (scenario.TileSet == TileSet.Platform) { Spk starfield = (Spk)this.Mpq.GetResource("parallax\\star.spk"); @@ -340,7 +340,7 @@ for (int i = 0; i < cursornames.Length; i++) { ScrollCursors[i] = new CursorAnimator((Grp)this.Mpq.GetResource(cursornames[i]), - Effectpal.Palette); + EffectPalette.Palette); ScrollCursors[i].SetHotspot(60, 60); } @@ -354,7 +354,7 @@ for (int i = 0; i < magcursornames.Length; i++) { MagCursors[i] = new CursorAnimator((Grp)this.Mpq.GetResource(magcursornames[i]), - Effectpal.Palette); + EffectPalette.Palette); MagCursors[i].SetHotspot(60, 60); } @@ -368,7 +368,7 @@ for (int i = 0; i < targetcursornames.Length; i++) { TargetCursors[i] = new CursorAnimator((Grp)this.Mpq.GetResource(targetcursornames[i]), - Effectpal.Palette); + EffectPalette.Palette); TargetCursors[i].SetHotspot(60, 60); } @@ -399,8 +399,8 @@ CursorAnimator c = Game.Instance.Cursor; - if (c.X + topleft_x > s.TopLeftPosition.X && c.X + topleft_x <= s.TopLeftPosition.X + 100 /* XXX */ - && c.Y + topleft_y > s.TopLeftPosition.Y && c.Y + topleft_y <= s.TopLeftPosition.Y + 100 /* XXX */) + if (c.PositionX + topleft_x > s.TopLeftPosition.X && c.PositionX + topleft_x <= s.TopLeftPosition.X + 100 /* XXX */ + && c.PositionY + topleft_y > s.TopLeftPosition.Y && c.PositionY + topleft_y <= s.TopLeftPosition.Y + 100 /* XXX */) { Game.Instance.Cursor = MagCursors[MAG_CURSOR_G]; unitUnderCursor = u; @@ -677,8 +677,8 @@ protoss nexus = 154 */ Unit unit = new Unit(154); - unit.X = sl.X; - unit.Y = sl.Y; + unit.PositionX = sl.PositionX; + unit.PositionY = sl.PositionY; unit.CreateSprite(this.Mpq, tileset_palette); units.Add(unit); @@ -686,7 +686,7 @@ } /* for now assume the player is at startLocations[0], and center the view there */ - Recenter(startLocations[0].X, startLocations[0].Y); + Recenter(startLocations[0].PositionX, startLocations[0].PositionY); } } } Modified: trunk/scsharp/src/SCSharpLib/UI/GlobalResources.cs =================================================================== --- trunk/scsharp/src/SCSharpLib/UI/GlobalResources.cs 2007-05-23 17:45:10 UTC (rev 1391) +++ trunk/scsharp/src/SCSharpLib/UI/GlobalResources.cs 2007-05-24 18:54:29 UTC (rev 1392) @@ -227,7 +227,7 @@ /// <summary> /// /// </summary> - public static SCResources BrooDat + public static SCResources BroodDat { get { return broodwarResources; } } Modified: trunk/scsharp/src/SCSharpLib/UI/GuiUtil.cs =================================================================== --- trunk/scsharp/src/SCSharpLib/UI/GuiUtil.cs 2007-05-23 17:45:10 UTC (rev 1391) +++ trunk/scsharp/src/SCSharpLib/UI/GuiUtil.cs 2007-05-24 18:54:29 UTC (rev 1392) @@ -54,7 +54,7 @@ /// <summary> /// /// </summary> - public static class GuiUtil + public static class GuiUtility { static SCFont[] fonts; @@ -95,13 +95,13 @@ /// <summary> /// /// </summary> - /// <param name="g"></param> + /// <param name="glyph"></param> /// <param name="palette"></param> /// <param name="offset"></param> /// <returns></returns> - public static Surface RenderGlyph(Glyph g, byte[] palette, int offset) + public static Surface RenderGlyph(Glyph glyph, byte[] palette, int offset) { - if (g == null) + if (glyph == null) { throw new ArgumentNullException("g"); } @@ -109,18 +109,18 @@ { throw new ArgumentNullException("palette"); } - byte[] buf = new byte[g.Width * g.Height * 4]; + byte[] buf = new byte[glyph.Width * glyph.Height * 4]; int i = 0; - for (int y = g.Height - 1; y >= 0; y--) + for (int y = glyph.Height - 1; y >= 0; y--) { - for (int x = g.Width - 1; x >= 0; x--) + for (int x = glyph.Width - 1; x >= 0; x--) { - if (g.Bitmap[y, x] == 0) + if (glyph.Bitmap[y, x] == 0) { buf[i + 0] = 0; } - else if (g.Bitmap[y, x] == 1) + else if (glyph.Bitmap[y, x] == 1) { buf[i + 0] = 255; } @@ -129,9 +129,9 @@ buf[i + 0] = 128; } - buf[i + 1] = palette[(g.Bitmap[y, x] + offset) * 3 + 2]; - buf[i + 2] = palette[(g.Bitmap[y, x] + offset) * 3 + 1]; - buf[i + 3] = palette[(g.Bitmap[y, x] + offset) * 3]; + buf[i + 1] = palette[(glyph.Bitmap[y, x] + offset) * 3 + 2]; + buf[i + 2] = palette[(glyph.Bitmap[y, x] + offset) * 3 + 1]; + buf[i + 3] = palette[(glyph.Bitmap[y, x] + offset) * 3]; if (buf[i + 1] == 252 && buf[i + 2] == 0 && buf[i + 3] == 252) { @@ -142,7 +142,7 @@ } } - return CreateSurfaceFromRgbaData(buf, (ushort)g.Width, (ushort)g.Height, 32, g.Width * 4); + return CreateSurfaceFromRgbaData(buf, (ushort)glyph.Width, (ushort)glyph.Height, 32, glyph.Width * 4); } /// <summary> @@ -550,7 +550,7 @@ /// <returns></returns> public static Surface SurfaceFromStream(Stream stream) { - return GuiUtil.SurfaceFromStream(stream, -1, -1); + return GuiUtility.SurfaceFromStream(stream, -1, -1); } /// <summary> @@ -560,7 +560,7 @@ /// <returns></returns> public static Sound SoundFromStream(Stream stream) { - byte[] buf = GuiUtil.ReadStream(stream); + byte[] buf = GuiUtility.ReadStream(stream); return Mixer.Sound(buf); } @@ -580,7 +580,7 @@ { return; } - Sound s = GuiUtil.SoundFromStream(stream); + Sound s = GuiUtility.SoundFromStream(stream); s.Play(); } @@ -589,8 +589,8 @@ /// </summary> /// <param name="mpq"></param> /// <param name="resourcePath"></param> - /// <param name="numLoops"></param> - public static void PlayMusic(Mpq mpq, string resourcePath, int numLoops) + /// <param name="numberOfLoops"></param> + public static void PlayMusic(Mpq mpq, string resourcePath, int numberOfLoops) { if (mpq == null) { @@ -601,7 +601,7 @@ { return; } - Sound s = GuiUtil.SoundFromStream(stream); + Sound s = GuiUtility.SoundFromStream(stream); s.Play(true); } } Modified: trunk/scsharp/src/SCSharpLib/UI/ImageElement.cs =================================================================== --- trunk/scsharp/src/SCSharpLib/UI/ImageElement.cs 2007-05-23 17:45:10 UTC (rev 1391) +++ trunk/scsharp/src/SCSharpLib/UI/ImageElement.cs 2007-05-24 18:54:29 UTC (rev 1392) @@ -64,12 +64,12 @@ if ((Flags & SCElement.Translucent) == SCElement.Translucent) { - surface = GuiUtil.SurfaceFromStream((Stream)Mpq.GetResource(Text), + surface = GuiUtility.SurfaceFromStream((Stream)Mpq.GetResource(Text), 254, 0); } else { - surface = GuiUtil.SurfaceFromStream((Stream)Mpq.GetResource(Text)); + surface = GuiUtility.SurfaceFromStream((Stream)Mpq.GetResource(Text)); } // surface.TransparentColor = Color.Black; /* XXX */ Modified: trunk/scsharp/src/SCSharpLib/UI/LabelElement.cs =================================================================== --- trunk/scsharp/src/SCSharpLib/UI/LabelElement.cs 2007-05-23 17:45:10 UTC (rev 1391) +++ trunk/scsharp/src/SCSharpLib/UI/LabelElement.cs 2007-05-24 18:54:29 UTC (rev 1392) @@ -62,7 +62,7 @@ /* this is wrong */ Surface surf = new Surface(Width, Height); - Surface textSurf = GuiUtil.ComposeText(Text, Font, Palette, Width, Height, + Surface textSurf = GuiUtility.ComposeText(Text, Font, Palette, Width, Height, Sensitive ? 4 : 24); ; int x = 0; Modified: trunk/scsharp/src/SCSharpLib/UI/ListBoxElement.cs =================================================================== --- trunk/scsharp/src/SCSharpLib/UI/ListBoxElement.cs 2007-05-23 17:45:10 UTC (rev 1391) +++ trunk/scsharp/src/SCSharpLib/UI/ListBoxElement.cs 2007-05-24 18:54:29 UTC (rev 1392) @@ -308,7 +308,7 @@ { break; } - Surface item_surface = GuiUtil.ComposeText(items[i], Font, Palette, + Surface item_surface = GuiUtility.ComposeText(items[i], Font, Palette, (!selectable || (!selecting && cursor == i) || (selecting && selectionIndex == i)) ? 4 : 24); Modified: trunk/scsharp/src/SCSharpLib/UI/MainMenu.cs =================================================================== --- trunk/scsharp/src/SCSharpLib/UI/MainMenu.cs 2007-05-23 17:45:10 UTC (rev 1391) +++ trunk/scsharp/src/SCSharpLib/UI/MainMenu.cs 2007-05-24 18:54:29 UTC (rev 1392) @@ -72,7 +72,7 @@ try { Game.Instance.PlayingBroodWar = args.Expansion; - GuiUtil.PlaySound(this.Mpq, Builtins.Mousedown2Wav); + GuiUtility.PlaySound(this.Mpq, Builtins.Mousedown2Wav); Game.Instance.SwitchToScreen(nextScreen); } catch (Exception e) @@ -101,7 +101,7 @@ } else { - GuiUtil.PlaySound(this.Mpq, Builtins.Mousedown2Wav); + GuiUtility.PlaySound(this.Mpq, Builtins.Mousedown2Wav); Game.Instance.SwitchToScreen(UIScreenType.LogOn); } }; @@ -115,7 +115,7 @@ } else { - GuiUtil.PlaySound(this.Mpq, Builtins.Mousedown2Wav); + GuiUtility.PlaySound(this.Mpq, Builtins.Mousedown2Wav); Game.Instance.SwitchToScreen(UIScreenType.Connection); } }; Modified: trunk/scsharp/src/SCSharpLib/UI/MapRenderer.cs =================================================================== --- trunk/scsharp/src/SCSharpLib/UI/MapRenderer.cs 2007-05-23 17:45:10 UTC (rev 1391) +++ trunk/scsharp/src/SCSharpLib/UI/MapRenderer.cs 2007-05-24 18:54:29 UTC (rev 1392) @@ -49,12 +49,13 @@ /// <returns></returns> public static Surface RenderToSurface(Mpq mpq, Chk chk) { - ushort pixelWidth; - ushort pixelHeight; + ushort pixelWidth = 0; + ushort pixelHeight = 0; - byte[] bitmap = RenderToBitmap(mpq, chk, out pixelWidth, out pixelHeight); + //byte[] bitmap = RenderToBitmap(mpq, chk, out pixelWidth, out pixelHeight); + BitmapImage bitmap = RenderToBitmap(mpq, chk, pixelWidth, pixelHeight); - return GuiUtil.CreateSurfaceFromRgbaData(bitmap, pixelWidth, pixelHeight, 32, pixelWidth * 4); + return GuiUtility.CreateSurfaceFromRgbaData(bitmap.Image, bitmap.PixelWidth, bitmap.PixelHeight, 32, bitmap.PixelWidth * 4); } /// <summary> @@ -66,8 +67,10 @@ /// <param name="pixelHeight"></param> /// <returns></returns> [CLSCompliant(false)] - public static byte[] RenderToBitmap(Mpq mpq, Chk chk, out ushort pixelWidth, out ushort pixelHeight) + public static BitmapImage RenderToBitmap(Mpq mpq, Chk chk, ushort pixelWidth, ushort pixelHeight) { + BitmapImage bitmapImage = new BitmapImage(); + //public static byte[] RenderToBitmap(Mpq mpq, Chk chk, out ushort pixelWidth, out ushort pixelHeight) if (chk == null) { throw new ArgumentNullException("chk"); @@ -78,15 +81,15 @@ } ushort[,] mapTiles = chk.MapTiles; - byte[] image = new byte[chk.Width * 32 * chk.Height * 32 * 4]; + bitmapImage.Image = new byte[chk.Width * 32 * chk.Height * 32 * 4]; - pixelWidth = (ushort)(chk.Width * 32); - pixelHeight = (ushort)(chk.Height * 32); + bitmapImage.PixelWidth = (ushort)(chk.Width * 32); + bitmapImage.PixelHeight = (ushort)(chk.Height * 32); - Stream cv5_fs = (Stream)mpq.GetResource(String.Format("tileset\\{0}.cv5", Utilities.TilesetNames[(int)chk.Tileset])); - Stream vx4_fs = (Stream)mpq.GetResource(String.Format("tileset\\{0}.vx4", Utilities.TilesetNames[(int)chk.Tileset])); - Stream vr4_fs = (Stream)mpq.GetResource(String.Format("tileset\\{0}.vr4", Utilities.TilesetNames[(int)chk.Tileset])); - Stream wpe_fs = (Stream)mpq.GetResource(String.Format("tileset\\{0}.wpe", Utilities.TilesetNames[(int)chk.Tileset])); + Stream cv5_fs = (Stream)mpq.GetResource(String.Format("tileset\\{0}.cv5", Utilities.TileSetNames[(int)chk.TileSet])); + Stream vx4_fs = (Stream)mpq.GetResource(String.Format("tileset\\{0}.vx4", Utilities.TileSetNames[(int)chk.TileSet])); + Stream vr4_fs = (Stream)mpq.GetResource(String.Format("tileset\\{0}.vr4", Utilities.TileSetNames[(int)chk.TileSet])); + Stream wpe_fs = (Stream)mpq.GetResource(String.Format("tileset\\{0}.wpe", Utilities.TileSetNames[(int)chk.TileSet])); byte[] cv5 = new byte[cv5_fs.Length]; cv5_fs.Read(cv5, 0, (int)cv5_fs.Length); @@ -134,10 +137,10 @@ byte palette_entry = vr4[minitile_id * 64 + pixel_y * 8 + pixel_x]; - image[0 + 4 * (x + y)] = (byte)(255 - wpe[palette_entry * 4 + 3]); - image[1 + 4 * (x + y)] = wpe[palette_entry * 4 + 2]; - image[2 + 4 * (x + y)] = wpe[palette_entry * 4 + 1]; - image[3 + 4 * (x + y)] = wpe[palette_entry * 4 + 0]; + bitmapImage.Image[0 + 4 * (x + y)] = (byte)(255 - wpe[palette_entry * 4 + 3]); + bitmapImage.Image[1 + 4 * (x + y)] = wpe[palette_entry * 4 + 2]; + bitmapImage.Image[2 + 4 * (x + y)] = wpe[palette_entry * 4 + 1]; + bitmapImage.Image[3 + 4 * (x + y)] = wpe[palette_entry * 4 + 0]; } } else @@ -151,10 +154,10 @@ byte palette_entry = vr4[minitile_id * 64 + pixel_y * 8 + pixel_x]; - image[0 + 4 * (x + y)] = (byte)(255 - wpe[palette_entry * 4 + 3]); - image[1 + 4 * (x + y)] = wpe[palette_entry * 4 + 2]; - image[2 + 4 * (x + y)] = wpe[palette_entry * 4 + 1]; - image[3 + 4 * (x + y)] = wpe[palette_entry * 4 + 0]; + bitmapImage.Image[0 + 4 * (x + y)] = (byte)(255 - wpe[palette_entry * 4 + 3]); + bitmapImage.Image[1 + 4 * (x + y)] = wpe[palette_entry * 4 + 2]; + bitmapImage.Image[2 + 4 * (x + y)] = wpe[palette_entry * 4 + 1]; + bitmapImage.Image[3 + 4 * (x + y)] = wpe[palette_entry * 4 + 0]; } } } @@ -163,7 +166,7 @@ } } - return image; + return bitmapImage; } } } Modified: trunk/scsharp/src/SCSharpLib/UI/MarkupScreen.cs =================================================================== --- trunk/scsharp/src/SCSharpLib/UI/MarkupScreen.cs 2007-05-23 17:45:10 UTC (rev 1391) +++ trunk/scsharp/src/SCSharpLib/UI/MarkupScreen.cs 2007-05-24 18:54:29 UTC (rev 1392) @@ -98,7 +98,7 @@ /// <param name="background"></param> public MarkupPage(Stream background) { - newBackground = GuiUtil.SurfaceFromStream(background, 254, 0); + newBackground = GuiUtility.SurfaceFromStream(background, 254, 0); } /// <summary> @@ -124,7 +124,7 @@ } else { - lineSurfaces.Add(GuiUtil.ComposeText(l, fnt, pal)); + lineSurfaces.Add(GuiUtility.ComposeText(l, fnt, pal)); } } } @@ -230,13 +230,13 @@ /// <summary> /// /// </summary> - /// <param name="s"></param> - protected void AddMarkup(Stream s) + /// <param name="stream"></param> + protected void AddMarkup(Stream stream) { string l; MarkupPage currentPage = null; - StreamReader sr = new StreamReader(s); + StreamReader sr = new StreamReader(stream); while ((l = sr.ReadLine()) != null) { @@ -305,7 +305,7 @@ pal = pcx.RgbData; Console.WriteLine("loading font"); - fnt = GuiUtil.GetFonts(this.Mpq)[3]; + fnt = GuiUtility.GetFonts(this.Mpq)[3]; Console.WriteLine("loading markup"); LoadMarkup(); Modified: trunk/scsharp/src/SCSharpLib/UI/Painter.cs =================================================================== --- trunk/scsharp/src/SCSharpLib/UI/Painter.cs 2007-05-23 17:45:10 UTC (rev 1391) +++ trunk/scsharp/src/SCSharpLib/UI/Painter.cs 2007-05-24 18:54:29 UTC (rev 1392) @@ -146,14 +146,14 @@ /// <summary> /// /// </summary> - /// <param name="fullscreen"></param> + /// <param name="fullScreen"></param> /// <param name="millis"></param> - public Painter(bool fullscreen, int millis) + public Painter(bool fullScreen, int millis) { this.millis = millis; - this.fullScreen = fullscreen; - FullScreen = fullscreen; + this.fullScreen = fullScreen; + FullScreen = fullScreen; /* init our list of painter delegates */ layers = new List<PainterCallback>[(int)Layer.Count]; Modified: trunk/scsharp/src/SCSharpLib/UI/PlayCustomScreen.cs =================================================================== --- trunk/scsharp/src/SCSharpLib/UI/PlayCustomScreen.cs 2007-05-23 17:45:10 UTC (rev 1391) +++ trunk/scsharp/src/SCSharpLib/UI/PlayCustomScreen.cs 2007-05-24 18:54:29 UTC (rev 1392) @@ -294,7 +294,7 @@ (selectedChk == null ? "" : String.Format("{0}", - selectedChk.NumHumanSlots))); + selectedChk.NumberOfHumanSlots))); Elements[MAPPLAYERS1_ELEMENT_INDEX].Text = slotString; Elements[MAPPLAYERS1_ELEMENT_INDEX].Visible = true; @@ -305,7 +305,7 @@ (selectedChk == null ? "" : String.Format("{0}", - selectedChk.NumComputerSlots))); + selectedChk.NumberOfComputerSlots))); Elements[MAPPLAYERS2_ELEMENT_INDEX].Text = slotString; Elements[MAPPLAYERS2_ELEMENT_INDEX].Visible = true; @@ -319,7 +319,7 @@ (selectedChk == null ? "" : String.Format("{0}", - selectedChk.NumPlayers))); + selectedChk.NumberOfPlayers))); Elements[MAPPLAYERS1_ELEMENT_INDEX].Text = numPlayersString; Elements[MAPPLAYERS1_ELEMENT_INDEX].Visible = true; @@ -333,11 +333,11 @@ { if (selectedGot.UseMapSettings) { - if (i >= selectedChk.NumComputerSlots + 1) break; + if (i >= selectedChk.NumberOfComputerSlots + 1) break; } else { - if (i >= selectedChk.NumPlayers) break; + if (i >= selectedChk.NumberOfPlayers) break; } if (i > 0) @@ -399,7 +399,7 @@ (selectedChk == null ? "" : String.Format("{0}", - selectedChk.Tileset))); + selectedChk.TileSet))); Elements[MAPSIZE_ELEMENT_INDEX].Text = mapSizeString; Elements[MAPTILESET_ELEMENT_INDEX].Text = tileSetString; Modified: trunk/scsharp/src/SCSharpLib/UI/ReadyRoomScreen.cs =================================================================== --- trunk/scsharp/src/SCSharpLib/UI/ReadyRoomScreen.cs 2007-05-23 17:45:10 UTC (rev 1391) +++ trunk/scsharp/src... [truncated message content] |