User Tag List

Page 2 of 3 FirstFirst 1 2 3 LastLast
Results 11 to 20 of 22

Thread: Enabling an extension to work in HWA?

  1. #11
    Clicker Fusion 2.5 DeveloperSWF Export ModuleUnicode Add-on
    Looki's Avatar
    Join Date
    Aug 2006
    Location
    Karlsruhe, Germany
    Posts
    3,739
    Mentioned
    4 Post(s)
    Tagged
    1 Thread(s)
    Good luck if this works out, I'll implement a way to access those render targets in Surface, allowing you to operate on them That'd be nice!

  2. #12
    Forum Moderator Fusion 2.5 DeveloperHTML5 Export Module
    Chaos's Avatar
    Join Date
    Aug 2006
    Location
    Burnsville, MN, USA
    Posts
    806
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Yes that would be fantastic! I look forward to seeing results of your attempt conceptgame!

    I plan on using this to pick up colors from the terrain, to indicate what terrain type it is, without having a ton of masks or sensors.

  3. #13
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleiOS Export Module
    conceptgame's Avatar
    Join Date
    Apr 2011
    Location
    Switzerland
    Posts
    740
    Mentioned
    12 Post(s)
    Tagged
    0 Thread(s)
    I managed to get it work for GetPixel thanks to Yves 2 days ago. But not in the way we want it with Looki. And I am still trying to make it work for SetPixel since it is also a part of this extension. If you only need GetPixel Chaos, I can give a special extension with only this Expression.

  4. #14
    Clicker Fusion 2.5 DeveloperSWF Export ModuleUnicode Add-on
    Looki's Avatar
    Join Date
    Aug 2006
    Location
    Karlsruhe, Germany
    Posts
    3,739
    Mentioned
    4 Post(s)
    Tagged
    1 Thread(s)
    Could you share your results, conceptgame? Knowing Yves is a busy man I don't wanna have to ask him myself as well

  5. #15
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleiOS Export Module
    conceptgame's Avatar
    Join Date
    Apr 2011
    Location
    Switzerland
    Posts
    740
    Mentioned
    12 Post(s)
    Tagged
    0 Thread(s)
    Yes of course. I tried as said above but I just got an empty surface. It did not crash, that was the good point.
    The trick is to use one of the HWA texture which is created in the video memory. You blit the application surface to this temp surface and used it as base to blit on a DIB surface.
    You can then call GetPixel.
    Code:
    COLORREF Extension::GetColor(int x, int y)
    {
        fprh rhPtr = rdPtr->rHo.hoAdRunHeader;
        LPSURFACE ps = WinGetSurface((int)rhPtr->rhIdEditWin);
        int w = ps->GetWidth();
        int h = ps->GetHeight();
        if(renderSurf != NULL)
        {
            delete renderSurf;
            renderSurf = NULL;
        }
        LPSURFACE pProto1 = NULL;
        if (GetSurfacePrototype(&pProto1, ps->GetDepth(), ST_MEMORY, SD_DIB) )
        {    
            renderSurf = new cSurface;
            renderSurf->Create(w,h,pProto1);
        }
        
        LPSURFACE pSrcSf = ps;
        cSurface rttSf;
        int nDrv = ps->GetDriver();
        if ( nDrv == SD_D3D9 || nDrv == SD_D3D8 )
        {
            LPSURFACE pProto;
            GetSurfacePrototype(&pProto, ps->GetDepth(), ST_HWA_ROUTEXTURE, nDrv);
            rttSf.Create(w,h, pProto);
            ps->Blit(rttSf, 0, 0, 0, 0, ps->GetWidth(),ps->GetHeight(), BMODE_OPAQUE);
            pSrcSf = &rttSf;
        }
        pSrcSf->Blit(*renderSurf);
        renderSurf->SaveImage("screen.png");
        pSrcSf->SaveImage("screen2.png");
        COLORREF color = renderSurf->GetPixelFast(x,y);
        return color;
    My main concern is that this surface is slow writing according to comments, so it cannot really be used for what I thought.
    Code:
    ST_HWA_ROUTEXTURE,            // HWA texture created in video memory, unmanaged (lost when device is lost). Slow writing, should be treated read-only
    Indeed, Yves is a busy man. I really need to to talk with him at the next convention to understand the whole surface topic. I hope he should come and have more time to explain.

  6. #16
    Clicker Fusion 2.5 DeveloperSWF Export ModuleUnicode Add-on
    Looki's Avatar
    Join Date
    Aug 2006
    Location
    Karlsruhe, Germany
    Posts
    3,739
    Mentioned
    4 Post(s)
    Tagged
    1 Thread(s)
    Ohh, sorry. I didn't know you use a software fallback. I didn't even think about that, but yes I guess it's a bit slow. Probably still good enough if you only blit each frame (60 times a sec) and not on every get pixel call

  7. #17
    Forum Moderator Fusion 2.5 DeveloperHTML5 Export Module
    Chaos's Avatar
    Join Date
    Aug 2006
    Location
    Burnsville, MN, USA
    Posts
    806
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    This extension would allow me to get a pixel color at a specific coordinate? I don't need to change any colors at all, just get the RGB value of it, preferably broken into individual colors. IE. GetRed, GetGreen, GetBlue

  8. #18
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleiOS Export Module
    conceptgame's Avatar
    Join Date
    Apr 2011
    Location
    Switzerland
    Posts
    740
    Mentioned
    12 Post(s)
    Tagged
    0 Thread(s)
    Yes, it would allow you to get pixel colors at specific coordinates in both Standard and HWA.

  9. #19
    Forum Moderator Fusion 2.5 DeveloperHTML5 Export Module
    Chaos's Avatar
    Join Date
    Aug 2006
    Location
    Burnsville, MN, USA
    Posts
    806
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Sounds fantastic!

  10. #20
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleiOS Export Module
    conceptgame's Avatar
    Join Date
    Apr 2011
    Location
    Switzerland
    Posts
    740
    Mentioned
    12 Post(s)
    Tagged
    0 Thread(s)
    Here it is: GetPixel.zip

    There is no example or help file. I think it is obvious how the expressions can be used.

Page 2 of 3 FirstFirst 1 2 3 LastLast

Similar Threads

  1. Enabling and Disabling Groups
    By Meshakhad in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 3rd August 2011, 05:57 PM
  2. Key not enabling NEXT button
    By AlanT in forum Install Creator and Patch Maker
    Replies: 12
    Last Post: 16th September 2008, 02:38 AM
  3. Enabling/Disabling all application sounds
    By Giovanni_Cardona in forum Multimedia Fusion 2 - Technical Support
    Replies: 5
    Last Post: 23rd June 2008, 08:12 PM
  4. Problems enabling/disabling groups
    By mobichan in forum Multimedia Fusion 2 - Technical Support
    Replies: 6
    Last Post: 3rd June 2008, 01:29 AM
  5. Replies: 0
    Last Post: 10th January 2008, 07:45 PM

Posting Permissions

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