User Tag List

Results 1 to 8 of 8

Thread: Screen scaling extension questions

  1. #1
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export Module
    UltimateWalrus's Avatar
    Join Date
    Jul 2006
    Posts
    824
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Screen scaling extension questions

    Hello,

    I want to create an extension that ideally would augment the way the game viewport is upscaled when "Resize display to fill window size" is checked. I'm assuming this would involve calling WinGetSurface, processing the pixel values myself, and then... well... I'm not really sure.

    Let's assume my game is 640x480. I call WinGetSurface and process the pixel values, creating a 1280x960 cSurface. How can I get MMF to display this surface, considering its main surface is still only 640x480? In my mind there are two options:

    1.) Somehow resize the cSurface attached to the main window, then blit the new stuff onto it. Except, I can't seem to find a function in the documentation that says it does this. Even if there was one, I wonder if it would do what I'd expect it to when the surface gets drawn.
    2.) Try and set up the window to draw the new surface myself. Except, wouldn't MMF be wasting processing power by still drawing the old surface underneath? How can I stop that from happening?

    If someone who knows about the MMF2 SDK could nudge me in the right direction, I'd be very grateful.

    Thanks,
    Sebastian

  2. #2
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleSWF Export ModuleUnicode Add-on
    Looki's Avatar
    Join Date
    Aug 2006
    Location
    Karlsruhe, Germany
    Posts
    3,741
    Mentioned
    5 Post(s)
    Tagged
    1 Thread(s)
    Hi,

    As we all know, the MMF runtime has come a long way and was never really meant to be tinkered with, so I can imagine this being virtually impossible from an extension! Anyway...
    1) To resize the main surface what you would try is calling ->Delete() and ->Create() on it (and make sure to look out for variables holding the size of that surface, knowing the runtime there probably are some.. besides cSurface::GetWidth/Height.) I think this might work because I doubt that MMF ever recreates the main surface on its own.. why would it? Doesn't make sense.
    2) I'm not sure if I get it. Do you want to implement a complete new rendering routine that draws all objects etc. to a Surface...? I think you might run into big issues with default objects like Actives there. You can't draw specific Active frames, for example...
    PS You can always write Yves a PM about this, I think he wrote most of this part of MMF. He's a busy man, and it might take him a few days to respond in the worst case, but he always gives very good answers if you ever have questions about the way MMF works. Plus, I'm really unsure if there's any way to turn off MMF's rendering at runtime (There is an option in MMF2 dev for this, per frame).

    Another question, though - what exactly is the point of this extension - by augment, do you mean that you want to extend the size of the canvas when the window is resized? Instead of zooming, get more pixels to work with? In that case, isn't that already possible without extensions? I've done things like that with the Window Control object and some application settings.

  3. #3
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export Module
    UltimateWalrus's Avatar
    Join Date
    Jul 2006
    Posts
    824
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi Looki,

    The intent of the extension is not to re-render the scene, but to take the pixels that have already been rendered to the main surface and upscaling them to a higher resolution using an image scaling algorithm.

    The method you described sounds like it could work though! I forgot I could PM Yves. Maybe I'll do a quick test of your method to see if I even need to bother him with it.

    Thanks!

  4. #4
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export Module
    UltimateWalrus's Avatar
    Join Date
    Jul 2006
    Posts
    824
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Took a lot of fiddling but I believe I got some rudimentary code working:

    Code:
    	//TEST: try to change MMF's surface size
    	LPRH  rhPtr = rdPtr->rHo.hoAdRunHeader;
            LPSURFACE ps = WinGetSurface((int)rhPtr->rhIdEditWin);
    
    	int oldwidth = ps->GetWidth();
    	int oldheight = ps->GetHeight();
    
    	cSurface prototype;
    	prototype.Clone( *ps, oldwidth*2, oldheight*2);
    
    	ps->Delete();
    	ps->Clone(prototype, oldwidth*2, oldheight*2);
    Thank you Looki!!

  5. #5
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export Module
    UltimateWalrus's Avatar
    Join Date
    Jul 2006
    Posts
    824
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    ...shoot. Doesn't look like it works in HWA (just get a blank screen). Guess I'll have to ask Yves after all.

  6. #6
    Clickteam Clickteam
    LB's Avatar
    Join Date
    Jun 2007
    Location
    Richardson, Texas, North America
    Posts
    8,937
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    I think HWA works completely differently from the standard runtime. Make sure the SDK you're using is up to date for HWA.
    Working as fast as I can on Fusion 3

  7. #7
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleSWF Export ModuleUnicode Add-on
    Looki's Avatar
    Join Date
    Aug 2006
    Location
    Karlsruhe, Germany
    Posts
    3,741
    Mentioned
    5 Post(s)
    Tagged
    1 Thread(s)
    Ahh, that sounds more reasonable to implement. I didn't know you wanted HWA compabibility, because as LB said, HWA works... differently. There's no HWA SDK, but the latest SDK version comes with some HWA enums, e.g. HWA surface types and buffer types.. but I don't know how that would help here, since you're creating the surface based on the prototype of the older surface anyway. I think PMing Yves here would be the best choice, however I think that implementing scaling algorithms on the CPU in HWA seems like a waste, you should just use shaders there - except HWA has problems with shader model 3.0+, so it might be hard implementing those.

  8. #8
    Clicker

    Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleUniversal Windows Platform Export ModuleSWF Export Module
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    Banduck's Avatar
    Join Date
    Aug 2013
    Posts
    211
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    any news on this? or is there any way to achieve a unity-like scaling?

Similar Threads

  1. Edit box -> screen scaling
    By Popcorn in forum Android Export Module Version 2.0
    Replies: 2
    Last Post: 1st May 2013, 04:28 PM
  2. Screen scaling extension development
    By UltimateWalrus in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 30th January 2013, 03:55 PM
  3. Is this possible: change screen orientation without scaling?
    By Pineapple in forum iOS Export Module Version 2.0
    Replies: 1
    Last Post: 28th February 2012, 08:43 PM
  4. Some questions about prepping for Xbox screen display
    By mobichan in forum XNA Export Module Version 2.0
    Replies: 1
    Last Post: 28th November 2011, 08:37 AM
  5. Zip file and screen size questions.
    By kjellm87 in forum Multimedia Fusion 2 - Technical Support
    Replies: 7
    Last Post: 25th August 2009, 06:31 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •