![]() |
More Editor Optimization - Printable Version +- Mirage Engine (https://mirage-engine.uk/forums) +-- Forum: Mirage Source (Nostalgia) (https://mirage-engine.uk/forums/forumdisplay.php?fid=61) +--- Forum: Archive (2006-2011) (https://mirage-engine.uk/forums/forumdisplay.php?fid=18) +---- Forum: Resources (https://mirage-engine.uk/forums/forumdisplay.php?fid=49) +---- Thread: More Editor Optimization (/showthread.php?tid=76) |
More Editor Optimization - BigRed - 02-06-2006 Difficulty: 2/5 = Easy This is an extremely basic optimization. I meant to post this a long time ago, but never got around to it. BitBlt in Mirage is a completely useless function. There is absolutely no need for it, especially since when it is used, it loads pictures that are already loaded into memory, again. Useless and hogs memory. This was made for MSE Build 1, but will work on 3.0.x. All Client Side. Open frmItemEditor. Make the form a little longer and select and delete picItems. Select picPic, and set it's AutoRedraw property to 'True'. Resize the form back to the way it was (Height = 4695) Open frmMirage. Inside of picBack, in the upper left corner, select picBackSelect and delete it. Select picBack and change it's AutoRedraw property to 'True'. Select picSelect and set it's AutoRedraw property to 'True'. Goto Code View. Find: Code: Private Sub picBackSelect_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single) Code: Private Sub picBack_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single) Code: Private Sub picBackSelect_MouseMove(Button As Integer, Shift As Integer, x As Single, y As Single) Code: Private Sub picBack_MouseMove(Button As Integer, Shift As Integer, x As Single, y As Single) Open frmNPCEditor. Make the form a little longer and select and delete picSprites. Select picSprite, and set it's AutoRedraw property to 'True'. Resize the form back to the way it was (Height = 9375) Open modGameLogic. Find: Code: Public Sub EditorInit() Code: Public Sub EditorInit() Code: Public Sub EditorChooseTile(Button As Integer, Shift As Integer, x As Single, y As Single) Code: Public Sub EditorChooseTile(Button As Integer, Shift As Integer, x As Single, y As Single) Code: Public Sub EditorTileScroll() Code: Public Sub EditorTileScroll() Code: Public Sub ItemEditorBltItem() Code: Public Sub ItemEditorBltItem() '**************************************************************** '* WHEN WHO WHAT '* ---- --- ---- '* 07/12/2005 Shannara Added gfx constant. '**************************************************************** frmItemEditor.picItems.Picture = LoadPicture(App.Path & GFX_PATH & "items" & GFX_EXT) frmItemEditor.txtName.Text = Trim(Item(EditorIndex).Name) frmItemEditor.scrlPic.Value = Item(EditorIndex).Pic frmItemEditor.cmbType.ListIndex = Item(EditorIndex).Type If (frmItemEditor.cmbType.ListIndex >= ITEM_TYPE_WEAPON) And (frmItemEditor.cmbType.ListIndex = ITEM_TYPE_POTIONADDHP) And (frmItemEditor.cmbType.ListIndex = ITEM_TYPE_WEAPON) And (frmItemEditor.cmbType.ListIndex = ITEM_TYPE_POTIONADDHP) And (frmItemEditor.cmbType.ListIndex - grimsk8ter11 - 02-06-2006 nice stuff, always good to see optimizations optimized. - Bradyok - 04-06-2006 Thanks alot for posting this, it's pretty useful. Also, any idea if this will prevent the error "Cannot create auto redraw image" that some users get? - grimsk8ter11 - 04-06-2006 post the answer to this in bugs: What exactly do they do when it happens? - BigRed - 04-06-2006 To be honest. I don't use mirage at all. I just hang around to see if anything good comes up out of it. So, in answer to your question, I've never seen the bug before. - Doombringer - 07-06-2006 You forgot to get rid of the loading on "ItemEditorInit" Find the "Public Sub ItemEditorInit()" bit in modGameLogic, and remove the loading pic from the sub so it looks something like this: [code]Public Sub ItemEditorInit() frmItemEditor.txtName.Text = Trim(Item(EditorIndex).Name) frmItemEditor.scrlPic.Value = Item(EditorIndex).Pic frmItemEditor.cmbType.ListIndex = Item(EditorIndex).Type If (frmItemEditor.cmbType.ListIndex >= ITEM_TYPE_WEAPON) And (frmItemEditor.cmbType.ListIndex = ITEM_TYPE_POTIONADDHP) And (frmItemEditor.cmbType.ListIndex - BigRed - 07-06-2006 Opp, kept thinking I was leaving one out. Edited tutorial above.. - BigRed - 05-09-2006 Oop sorry about that. Somehow I screwed up on the copy & pasting. Anyway, there's only one small change you need to make. It's edited in the first post but here's the change: In EditorChooseTile: Find: Code: DD_TileSurf.BltToDC frmMirage.picBack.hdc, rec_pos, rec Code: DD_TileSurf.BltToDC frmMirage.picSelect.hdc, rec_pos, rec Btw, I also noticed, in the tutorial I defaulted to 32x32 tiles, I'm going to go through and change that for everyone as well. |