diff --git a/HaCreator/MapSimulator/MapSimulator.cs b/HaCreator/MapSimulator/MapSimulator.cs index 22aef1ec..580cddd4 100644 --- a/HaCreator/MapSimulator/MapSimulator.cs +++ b/HaCreator/MapSimulator/MapSimulator.cs @@ -129,7 +129,7 @@ public MapSimulator(Board mapBoard, string titleName) PreferredBackBufferWidth = Math.Max(RenderWidth, 1), PreferredBackBufferHeight = Math.Max(RenderHeight, 1), PreferredBackBufferFormat = SurfaceFormat.Color, - PreferredDepthStencilFormat = DepthFormat.Depth24Stencil8, + PreferredDepthStencilFormat = DepthFormat.Depth24Stencil8, }; _DxDeviceManager.ApplyChanges(); diff --git a/HaCreator/MapSimulator/MapSimulatorLoader.cs b/HaCreator/MapSimulator/MapSimulatorLoader.cs index ecd7f643..f2fd13a4 100644 --- a/HaCreator/MapSimulator/MapSimulatorLoader.cs +++ b/HaCreator/MapSimulator/MapSimulatorLoader.cs @@ -536,6 +536,8 @@ public static MinimapItem CreateMinimapFromProperty(WzSubProperty minimapFramePr // Constants const float TOOLTIP_FONTSIZE = 10f; + const int MAPMARK_IMAGE_ALIGN_LEFT = 7; // the number of pixels from the left to draw the map mark image + const int MAP_IMAGE_ALIGN_LEFT = 2; // the number of pixels from the left to draw the minimap image System.Drawing.Color color_bgFill = System.Drawing.Color.Transparent; System.Drawing.Color color_foreGround = System.Drawing.Color.White; @@ -555,10 +557,11 @@ public static MinimapItem CreateMinimapFromProperty(WzSubProperty minimapFramePr effective_width = Math.Max((int)tooltipSize.Width + nw.Width, effective_width); // set new width - System.Drawing.Bitmap miniMapUIImage = new System.Drawing.Bitmap(effective_width, effective_height); - - int mapDrawPositionX = (effective_width / 2) - nw.Width; // map is on the center. The position relative to the UI + int miniMapAlignXFromLeft = MAP_IMAGE_ALIGN_LEFT; + if (effective_width > miniMapImage.Width) // if minimap is smaller in size than the (text + frame), minimap will be aligned to the center instead + miniMapAlignXFromLeft = (effective_width - miniMapImage.Width) / 2/* - miniMapAlignXFromLeft*/; + System.Drawing.Bitmap miniMapUIImage = new System.Drawing.Bitmap(effective_width, effective_height); using (System.Drawing.Graphics graphics = System.Drawing.Graphics.FromImage(miniMapUIImage)) { // Frames and background @@ -572,12 +575,12 @@ public static MinimapItem CreateMinimapFromProperty(WzSubProperty minimapFramePr if (Program.InfoManager.MapMarks.ContainsKey(mapBoard.MapInfo.mapMark)) { System.Drawing.Bitmap mapMark = Program.InfoManager.MapMarks[mapBoard.MapInfo.mapMark]; - graphics.DrawImage(mapMark.ToImage(), 7, 17); + graphics.DrawImage(mapMark.ToImage(), MAPMARK_IMAGE_ALIGN_LEFT, 17); } // Map image graphics.DrawImage(miniMapImage, - mapDrawPositionX, // map is on the center + miniMapAlignXFromLeft, // map is on the center n.Height); graphics.Flush(); @@ -594,7 +597,7 @@ public static MinimapItem CreateMinimapFromProperty(WzSubProperty minimapFramePr BaseDXDrawableItem item_pixelDot = new BaseDXDrawableItem(dxObj_miniMapPixel, false) { Position = new Point( - mapDrawPositionX, // map is on the center + miniMapAlignXFromLeft, // map is on the center 0) }; diff --git a/HaSharedLibrary/Render/BaseDXDrawableItem.cs b/HaSharedLibrary/Render/BaseDXDrawableItem.cs index 563cfe4b..3b473ddc 100644 --- a/HaSharedLibrary/Render/BaseDXDrawableItem.cs +++ b/HaSharedLibrary/Render/BaseDXDrawableItem.cs @@ -84,6 +84,7 @@ public BaseDXDrawableItem(IDXObject frame0, bool flip) this._Position = new Point(0, 0); } + [MethodImpl(MethodImplOptions.AggressiveInlining)] protected IDXObject GetCurrFrame(int TickCount) { if (notAnimated)