From: <che...@us...> - 2010-02-02 22:46:42
|
Revision: 3411 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=3411&view=rev Author: chemelli_sf Date: 2010-02-02 22:46:35 +0000 (Tue, 02 Feb 2010) Log Message: ----------- - Fixed bitmap loading - Updated version to 0.9.4.1 Modified Paths: -------------- trunk/plugins/WorldMap/Properties/AssemblyInfo.cs trunk/plugins/WorldMap/WorldMap.cs Modified: trunk/plugins/WorldMap/Properties/AssemblyInfo.cs =================================================================== --- trunk/plugins/WorldMap/Properties/AssemblyInfo.cs 2010-02-01 22:47:35 UTC (rev 3410) +++ trunk/plugins/WorldMap/Properties/AssemblyInfo.cs 2010-02-02 22:46:35 UTC (rev 3411) @@ -34,5 +34,5 @@ // Sie können alle Werte angeben oder die standardmäßigen Revisions- und Buildnummern // übernehmen, indem Sie "*" eingeben: -[assembly: AssemblyVersion("0.9.4.0")] -[assembly: AssemblyFileVersion("0.9.4.0")] \ No newline at end of file +[assembly: AssemblyVersion("0.9.4.1")] +[assembly: AssemblyFileVersion("0.9.4.1")] \ No newline at end of file Modified: trunk/plugins/WorldMap/WorldMap.cs =================================================================== --- trunk/plugins/WorldMap/WorldMap.cs 2010-02-01 22:47:35 UTC (rev 3410) +++ trunk/plugins/WorldMap/WorldMap.cs 2010-02-02 22:46:35 UTC (rev 3411) @@ -90,7 +90,7 @@ private void mapTiles_CombinedImageChangedEvent(object sender, ImageChangedEventArgs e) { - lock (typeof (bool)) + lock (typeof(bool)) { VisibleImageChanged = true; } @@ -104,45 +104,45 @@ Menu = new WorldmapMenu(); Menu.Init(); - if (GUIWindowManager.GetWindow((int) WorldmapWindowIDs.Menu) == null) + if (GUIWindowManager.GetWindow((int)WorldmapWindowIDs.Menu) == null) { - var win = (GUIWindow) Menu; + var win = (GUIWindow)Menu; GUIWindowManager.Add(ref win); Log.Debug("[Worldmap]: Window with the ID {0} has been added to the windowmanager!", win.GetID); } else { - Log.Error("[Worldmap]: A window with the ID {0} does already exist!", (int) WorldmapWindowIDs.Menu); + Log.Error("[Worldmap]: A window with the ID {0} does already exist!", (int)WorldmapWindowIDs.Menu); } Log.Debug("[Worldmap]: Initialize Worldmap search"); Search = new WorldmapSearch(); Search.Init(); - if (GUIWindowManager.GetWindow((int) WorldmapWindowIDs.Search) == null) + if (GUIWindowManager.GetWindow((int)WorldmapWindowIDs.Search) == null) { - var win = (GUIWindow) Search; + var win = (GUIWindow)Search; GUIWindowManager.Add(ref win); Log.Debug("[Worldmap]: Window with the ID {0} has been added to the windowmanager!", win.GetID); } else { - Log.Error("[Worldmap]: A window with the ID {0} does already exist!", (int) WorldmapWindowIDs.Search); + Log.Error("[Worldmap]: A window with the ID {0} does already exist!", (int)WorldmapWindowIDs.Search); } Log.Debug("[Worldmap]: Initialize Worldmap searchresult"); SearchResults = new WorldMapSearchResults(); SearchResults.Init(); - if (GUIWindowManager.GetWindow((int) WorldmapWindowIDs.SearchResults) == null) + if (GUIWindowManager.GetWindow((int)WorldmapWindowIDs.SearchResults) == null) { - var win = (GUIWindow) SearchResults; + var win = (GUIWindow)SearchResults; GUIWindowManager.Add(ref win); Log.Debug("[Worldmap]: Window with the ID {0} has been added to the windowmanager!", win.GetID); } else { - Log.Error("[Worldmap]: A window with the ID {0} does already exist!", (int) WorldmapWindowIDs.SearchResults); + Log.Error("[Worldmap]: A window with the ID {0} does already exist!", (int)WorldmapWindowIDs.SearchResults); } @@ -207,16 +207,16 @@ string tmpSkinFolder = Config.GetSubFolder(Config.Dir.Skin, GUIGraphicsContext.Skin); string[] media = { - "WMprogressBarActive.png", - "WMprogressBarQueued.png", - "WMTileNotAvailable.jpeg", - "WMTilePlaceholder.jpeg", - "WMIPBlocked.jpeg" + Path.Combine(tmpSkinFolder, "WMprogressBarActive.png"), + Path.Combine(tmpSkinFolder, "WMprogressBarQueued.png"), + Path.Combine(tmpSkinFolder, "WMTileNotAvailable.jpeg"), + Path.Combine(tmpSkinFolder, "WMTilePlaceholder.jpeg"), + Path.Combine(tmpSkinFolder, "WMIPBlocked.jpeg") }; foreach (string s in media) { - if (!File.Exists(Path.Combine(tmpSkinFolder, s))) + if (!File.Exists(s)) { Log.Error("[Worldmap]: Cannot find skin file {1}", s); } @@ -248,8 +248,8 @@ (LastGraphicContextHeigth != GUIGraphicsContext.Height)) // has the size of the render window changed? { mapTiles = null; - mapTiles = new MapTiles((int) (GUIGraphicsContext.Width/currentZoomFactor), - (int) (GUIGraphicsContext.Height/currentZoomFactor), mapConfig); + mapTiles = new MapTiles((int)(GUIGraphicsContext.Width / currentZoomFactor), + (int)(GUIGraphicsContext.Height / currentZoomFactor), mapConfig); mapTiles.CombinedImageChangedEvent += mapTiles_CombinedImageChangedEvent; RefreshImageTiles(); } @@ -258,8 +258,8 @@ public void FillMapTileRessources() { - mapTiles = new MapTiles((int) (GUIGraphicsContext.Width/currentZoomFactor), - (int) (GUIGraphicsContext.Height/currentZoomFactor), mapConfig); + mapTiles = new MapTiles((int)(GUIGraphicsContext.Width / currentZoomFactor), + (int)(GUIGraphicsContext.Height / currentZoomFactor), mapConfig); mapTiles.CombinedImageChangedEvent += mapTiles_CombinedImageChangedEvent; } @@ -274,10 +274,10 @@ public bool IsNotWorldmapWindow(int new_windowId) { - if (new_windowId != (int) WorldmapWindowIDs.MainWindow - && new_windowId != (int) WorldmapWindowIDs.Menu - && new_windowId != (int) WorldmapWindowIDs.Search - && new_windowId != (int) WorldmapWindowIDs.SearchResults) return true; + if (new_windowId != (int)WorldmapWindowIDs.MainWindow + && new_windowId != (int)WorldmapWindowIDs.Menu + && new_windowId != (int)WorldmapWindowIDs.Search + && new_windowId != (int)WorldmapWindowIDs.SearchResults) return true; else return false; } @@ -327,8 +327,8 @@ if (action.wID == settings.ActionMoveRight) { - MapTile tmpTile = mapTiles.Tiles[mapTiles.TileCountX/2][mapTiles.TileCountY/2]; - currentLongitude += (tmpTile.TileWidthDegree/4); + MapTile tmpTile = mapTiles.Tiles[mapTiles.TileCountX / 2][mapTiles.TileCountY / 2]; + currentLongitude += (tmpTile.TileWidthDegree / 4); if (currentLongitude > 180) currentLongitude = 180; RefreshImageTiles(); @@ -336,8 +336,8 @@ } if (action.wID == settings.ActionMoveLeft) { - MapTile tmpTile = mapTiles.Tiles[mapTiles.TileCountX/2][mapTiles.TileCountY/2]; - currentLongitude -= (tmpTile.TileWidthDegree/4); + MapTile tmpTile = mapTiles.Tiles[mapTiles.TileCountX / 2][mapTiles.TileCountY / 2]; + currentLongitude -= (tmpTile.TileWidthDegree / 4); if (currentLongitude < -180) currentLongitude = -180; RefreshImageTiles(); @@ -345,8 +345,8 @@ } if (action.wID == settings.ActionMoveUp) { - MapTile tmpTile = mapTiles.Tiles[mapTiles.TileCountX/2][mapTiles.TileCountY/2]; - currentLatitude += (tmpTile.TileHeightDegree/4); + MapTile tmpTile = mapTiles.Tiles[mapTiles.TileCountX / 2][mapTiles.TileCountY / 2]; + currentLatitude += (tmpTile.TileHeightDegree / 4); if (currentLatitude > 90) currentLatitude = 90; RefreshImageTiles(); @@ -354,8 +354,8 @@ } if (action.wID == settings.ActionMoveDown) { - MapTile tmpTile = mapTiles.Tiles[mapTiles.TileCountX/2][mapTiles.TileCountY/2]; - currentLatitude -= (tmpTile.TileHeightDegree/4); + MapTile tmpTile = mapTiles.Tiles[mapTiles.TileCountX / 2][mapTiles.TileCountY / 2]; + currentLatitude -= (tmpTile.TileHeightDegree / 4); if (currentLatitude < -90) currentLatitude = -90; RefreshImageTiles(); @@ -373,8 +373,8 @@ currentZoomFactor -= 0.25f; if (currentZoomFactor < 1f) currentZoomFactor = 1f; mapTiles = null; - mapTiles = new MapTiles((int) (GUIGraphicsContext.Width/currentZoomFactor), - (int) (GUIGraphicsContext.Height/currentZoomFactor), mapConfig); + mapTiles = new MapTiles((int)(GUIGraphicsContext.Width / currentZoomFactor), + (int)(GUIGraphicsContext.Height / currentZoomFactor), mapConfig); mapTiles.CombinedImageChangedEvent += mapTiles_CombinedImageChangedEvent; } RefreshImageTiles(); @@ -391,8 +391,8 @@ { currentZoomFactor += 0.25f; mapTiles = null; - mapTiles = new MapTiles((int) (GUIGraphicsContext.Width/currentZoomFactor), - (int) (GUIGraphicsContext.Height/currentZoomFactor), mapConfig); + mapTiles = new MapTiles((int)(GUIGraphicsContext.Width / currentZoomFactor), + (int)(GUIGraphicsContext.Height / currentZoomFactor), mapConfig); mapTiles.CombinedImageChangedEvent += mapTiles_CombinedImageChangedEvent; } RefreshImageTiles(); @@ -506,7 +506,7 @@ currentLongitude = 0; currentLatitude = 35; - var tmpMapTiles = (int) Math.Round((double) GUIGraphicsContext.Width/(int) Math.Round(256*currentZoomFactor)); + var tmpMapTiles = (int)Math.Round((double)GUIGraphicsContext.Width / (int)Math.Round(256 * currentZoomFactor)); int tmpZoomLevel = 0; while (Math.Pow(2, tmpZoomLevel) < tmpMapTiles) { @@ -530,16 +530,16 @@ if (MapTypeMenuShown) return; MapTypeMenuShown = true; - var Menu = (GUIDialogMenu) GUIWindowManager.GetWindow((int) Window.WINDOW_DIALOG_MENU); + var Menu = (GUIDialogMenu)GUIWindowManager.GetWindow((int)Window.WINDOW_DIALOG_MENU); Menu.Reset(); Menu.SetHeading(GUILocalizeStrings.Get(36)); - Array tmpMapTypes = Enum.GetValues(typeof (MapFunctions.MapType)); + Array tmpMapTypes = Enum.GetValues(typeof(MapFunctions.MapType)); for (int i = 0; i < tmpMapTypes.Length; i++) { - var tmpMapType = (MapFunctions.MapType) (Enum.ToObject(typeof (MapFunctions.MapType), i)); + var tmpMapType = (MapFunctions.MapType)(Enum.ToObject(typeof(MapFunctions.MapType), i)); switch (tmpMapType) { case MapFunctions.MapType.GMRoad: @@ -578,7 +578,7 @@ //tmpMainWindow.currentMapType = (MapFunctions.MapType)(Enum.ToObject(typeof(MapFunctions.MapType), Menu.SelectedLabel)); //tmpMainWindow.RefreshImageTiles(); - currentMapType = (MapFunctions.MapType) (Enum.ToObject(typeof (MapFunctions.MapType), Menu.SelectedLabel)); + currentMapType = (MapFunctions.MapType)(Enum.ToObject(typeof(MapFunctions.MapType), Menu.SelectedLabel)); RefreshImageTiles(); } @@ -658,20 +658,20 @@ public void BuildProgressImageOverlay(int RunningThreads, int QueuedImages) { - var StartPosX = (int) imgProgressPlaceholder.Location.X; - var StartPosY = (int) imgProgressPlaceholder.Location.Y; + var StartPosX = (int)imgProgressPlaceholder.Location.X; + var StartPosY = (int)imgProgressPlaceholder.Location.Y; for (int x = 0; x < RunningThreads; x++) { - Picture.RenderImage(ProgressBarActiveTexture.texture, StartPosX + (x*(ProgressBarActiveTexture.width)), + Picture.RenderImage(ProgressBarActiveTexture.texture, StartPosX + (x * (ProgressBarActiveTexture.width)), StartPosY, ProgressBarActiveTexture.width, ProgressBarActiveTexture.height, ProgressBarActiveTexture.width, ProgressBarActiveTexture.height, 0, 0, true); } for (int x = 0; x < QueuedImages; x++) { Picture.RenderImage(ProgressBarQueuedTexture.texture, - StartPosX + (RunningThreads*ProgressBarActiveTexture.width) + - (x*(ProgressBarQueuedTexture.width)), StartPosY, ProgressBarQueuedTexture.width, + StartPosX + (RunningThreads * ProgressBarActiveTexture.width) + + (x * (ProgressBarQueuedTexture.width)), StartPosY, ProgressBarQueuedTexture.width, ProgressBarQueuedTexture.height, ProgressBarQueuedTexture.width, ProgressBarQueuedTexture.height, 0, 0, true); } @@ -681,15 +681,15 @@ { var tmpAction = new Action(null, Action.ActionType.ACTION_PREVIOUS_MENU, 0, 0); - if (GUIWindowManager.ActiveWindow == (int) WorldmapWindowIDs.SearchResults) + if (GUIWindowManager.ActiveWindow == (int)WorldmapWindowIDs.SearchResults) { SearchResults.OnAction(tmpAction); } - if (GUIWindowManager.ActiveWindow == (int) WorldmapWindowIDs.Search) + if (GUIWindowManager.ActiveWindow == (int)WorldmapWindowIDs.Search) { Search.OnAction(tmpAction); } - if (GUIWindowManager.ActiveWindow == (int) WorldmapWindowIDs.Menu) + if (GUIWindowManager.ActiveWindow == (int)WorldmapWindowIDs.Menu) { Menu.OnAction(tmpAction); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |