![]() |
Optimizing Graphic Input? (Completed) - Printable Version +- Mirage Source (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: General (https://mirage-engine.uk/forums/forumdisplay.php?fid=17) +---- Thread: Optimizing Graphic Input? (Completed) (/showthread.php?tid=356) |
Optimizing Graphic Input? (Completed) - William - 10-10-2006 So, I believe this has been discussed before, if I remember correctly. But I just want to know one thing. Currently the map is being blited with information from the GameLoop. With call bltMask etc.. So it most go from x=0 to max_mapx. But instead of doing that. Can't you make it so it simply only draws the area around the char. For example: Code: For x = GetPlayerX(index) - 2 to GetPlayerX(index) + 2 Would that work, Im in school now so I don't know the correct name for call bltMask and such. - Spodi - 10-10-2006 Wouldn't this be "Optimizing Graphic Output"? :wink: Anyways, that is probably there to draw objects larger then 32x32. Though, you wouldn't have to check to the right or down, since (I am guessing) the tile specified, in a say 64x64 image, is the top-left corner of the image. Actually now that I mention it, can MS even draw > 32x32 or just one size? ![]() You can just add in an extra rectangular check, Image vs Screen, to see if the drawing is even needed, before drawing. - William - 10-10-2006 Yeah, Ill look into it ![]() - William - 11-10-2006 So here I have some work I've done. It's not yet complete so Ill submit the finish code later. So you guys can decide if it has been optimized: Completed! Replace this: Code: For y = 0 To MAX_MAPY Code: ' Blit out tiles layers ground/anim1/anim2 Also add this at the top of the Sub: Code: Dim xChange1 As Byte, xChange2 As Byte, yChange1 As Byte, yChange2 As Byte Also this has to be done for the fringe too.. And also a system that blts over the text area. I can do all those, I just need to know if this will speed anything up first. - Matt - 11-10-2006 I don't get what it does.. Care to explain a bit? - William - 11-10-2006 Sure. The old system blits everything through the GameLoop. So even on the places that hasnt changed, still blits. For example, when only one player is on a map, with no enemy. The map is being reblited all the time. But with this system, it will only blit the tiles around the character, since those are the only onse that changes. It's pretty meaningless to blt everything all the time, therefor I made this code that will blt up to 2 tiles around the character. Instead of all tiles on the whole map. This results in a smaller For loop, and also less use of FastBlt(). So it will make some difference after all. Even so, a lot of things needs to be added for this to work. You can see those things in the Tutorial section. I will complete the tutorial tomorrow i think. So you can test it then. - Matt - 11-10-2006 Okay. Thanks for explaining. Sounds like a good idea. - William - 11-10-2006 Yeah, Obsidian did some explaining in the other topic. There are better ways to do it, but this is the only way I know, therefor I'll make this tutorial. So if Verrigan releases a better one later on. You can simply just change it to his instead ![]() - William - 11-10-2006 If people used this, and if someone created a tutorial to remove the fps cap and still have charcters move as they should.. This could be a very powerful thing. |