Gamestudio Links
Zorro Links
Newest Posts
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
0 registered members (), 1,173 guests, and 0 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Retina Burn/Flash Bang #63637
02/11/06 18:37
02/11/06 18:37
Joined: Mar 2003
Posts: 1,524
Canada
Stansmedia Offline OP
Serious User
Stansmedia  Offline OP
Serious User

Joined: Mar 2003
Posts: 1,524
Canada
Code:

// A white pcx, probably 1280x960 so its big enough for any screensize
bmap white_flash = <white.pcx>;

bmap screen_shot_map = <emptypanel.pcx>;// A 640x480 empty PCX
bmap screen_shot_map2 = <emptypanel2.pcx>;// A 800x600 empty PCX
bmap screen_shot_map3 = <emptypanel3.pcx>;// A 1024x768 empty PCX
bmap screen_shot_map4 = <emptypanel4.pcx>;// A 1280x960 empty PCX

panel respawn_flash
{
bmap = white_flash; // compass_map as panel background
pos_X = 0; pos_y = 0;
layer = 4; // we want the flash in front of the burn image
flags = VISIBLE,TRANSPARENT;
}

// copies the screen into a bitmap
function grab_screen() {
if(video_mode == 6) // 640x480
{
bmap_for_screen (screen_shot_map, 1, 0);
}
if(video_mode == 7) // 800x600
{
bmap_for_screen (screen_shot_map2, 1, 0);
}
if(video_mode == 8) // 1024x768
{
bmap_for_screen (screen_shot_map3, 1, 0);
}
if(video_mode == 9) // 1280x960
{
bmap_for_screen (screen_shot_map4, 1, 0);
}
wait (1); // wait 1 frame until the bitmap can be saved
}

panel respawn_burn
{
bmap = screen_shot_map;
pos_X = 0; pos_y = 0;
layer = 3; // we want the burn behind the flash
flags = VISIBLE,TRANSPARENT;
}

function flash()
{
if(video_mode == 6) // 640x480
{
respawn_burn.bmap = screen_shot_map;
}
if(video_mode == 7) // 800x600
{
respawn_burn.bmap = screen_shot_map2;
}
if(video_mode == 8) // 1024x768
{
respawn_burn.bmap = screen_shot_map3;
}
if(video_mode == 9) // 1280x960
{
respawn_burn.bmap = screen_shot_map4;
}
respawn_burn.alpha = 100;
respawn_flash.alpha = 100;
}

starter respawn_panel_control
{
while(1)
{
if(respawn_burn.alpha > 0)
{
respawn_burn.alpha -= time*2;
}
if(respawn_flash.alpha > 0)
{
respawn_flash.alpha -= time*3;
}
wait(1);
}
}



Put this at the top of your code, and when you want the magic to happen, just call the function:
Code:
 
grab_screen();
flash();


in your code. Make sure you dont have it in a loop, and you create the images i mentioned in comments.

The bigger the screen size, the longer it takes to capture the screen.. Theirs a small delay for me on 640x480 and 800x600 but after that it gets pretty laggy.

Last edited by bloodred; 02/11/06 20:46.

Decessus - 80% done. 100% abandoned.
GET MY ANDROID GAME! https://play.google.com/store/apps/details?id=com.lasertrain.zspinballfree&hl=en
Re: Retina Burn/Flash Bang [Re: Stansmedia] #63638
02/11/06 19:05
02/11/06 19:05
Joined: Mar 2001
Posts: 3,298
Beverly, Massachusetts
Rhuarc Offline
Expert
Rhuarc  Offline
Expert

Joined: Mar 2001
Posts: 3,298
Beverly, Massachusetts
This would be easy to do in a DLL by grabbing the back buffer..... and avoid that lag.

Might throw something together for it...

-Rhuarc


I no longer post on these forums, keep in touch with me via:
Linkedin.com
My MSDN blog
Re: Retina Burn/Flash Bang [Re: Stansmedia] #63639
02/11/06 20:57
02/11/06 20:57
Joined: Jun 2005
Posts: 656
G
Grafton Offline
User
Grafton  Offline
User
G

Joined: Jun 2005
Posts: 656
Very cool BloodRed! The only problem is how long it takes to grab the screen.
You can scale the panels instead of using all the different sizes. Heres how I
implemented your idea;
Code:
 
bmap white_flash = <white.pcx>; //64x64 white pcx
bmap screen_shot_map = <emptypnl.pcx>;// A 640x480 empty PCX

panel respawn_flash
{
bmap = white_flash;
pos_X = 0; pos_y = 0;
layer = 4;
flags = transparent;
}

panel respawn_burn
{
bmap = screen_shot_map;
pos_X = 0; pos_y = 0;
layer = 3;
flags = transparent;
}

function flash()
{
bmap_for_screen (screen_shot_map, 1, 0);
wait (1); // wait 1 frame until the bitmap can be saved
respawn_burn.bmap = screen_shot_map;

respawn_burn.scale_x = screen_size.x / bmap_width(screen_shot_map);
respawn_burn.scale_y = screen_size.y / bmap_height(screen_shot_map);
respawn_burn.visible = on;
respawn_burn.alpha = 100;

respawn_flash.scale_x = screen_size.x / bmap_width(white_flash);
respawn_flash.scale_y = screen_size.y / bmap_height(white_flash);
respawn_flash.visible = on;
respawn_flash.alpha = 100;

while(respawn_burn.alpha > 0 || respawn_flash.alpha > 0)
{
if(respawn_burn.alpha > 0){respawn_burn.alpha -= time*2;}
if(respawn_flash.alpha > 0){respawn_flash.alpha -= time*3;}
wait(1);
}
respawn_burn.alpha = 0;
respawn_burn.visible = off;
respawn_flash.alpha = 0;
respawn_flash.visible = off;
}

on_f flash;




Scaling the panels this way seems to work fine!
Rhuarc, a backbuffer.dll would be nice! could be used for all sorts of things,
I hope you can find the time to follow up on it!

Thanks again for sharing your idea and code BloodRed, very cool effect!


Not two, not one.
Re: Retina Burn/Flash Bang [Re: Grafton] #63640
02/11/06 21:55
02/11/06 21:55
Joined: Jun 2001
Posts: 385
Eastern Washington State
Z
Zio Offline
Senior Member
Zio  Offline
Senior Member
Z

Joined: Jun 2001
Posts: 385
Eastern Washington State
I'm not sure where it is but didn't Matt write a dll that did that a while back? Shouldn't be hard to dig up.

Re: Retina Burn/Flash Bang [Re: Zio] #63641
02/11/06 23:06
02/11/06 23:06
Joined: Jun 2005
Posts: 656
G
Grafton Offline
User
Grafton  Offline
User
G

Joined: Jun 2005
Posts: 656
Yes, I found it. Its called render_view.dll. From the included readme:

"This is a simple Dll plugin that grabs the backbuffer render target and blits
it to an entity skin"

I am not sure how or even if we could use it to put the backbuffer to a panel
though.


Not two, not one.
Re: Retina Burn/Flash Bang [Re: Grafton] #63642
02/11/06 23:22
02/11/06 23:22
Joined: Mar 2003
Posts: 1,524
Canada
Stansmedia Offline OP
Serious User
Stansmedia  Offline OP
Serious User

Joined: Mar 2003
Posts: 1,524
Canada
Perhaps you could apply it to the skin of an model thats an entity on the screen. That might be a little weird tho.


Decessus - 80% done. 100% abandoned.
GET MY ANDROID GAME! https://play.google.com/store/apps/details?id=com.lasertrain.zspinballfree&hl=en
Re: Retina Burn/Flash Bang [Re: Stansmedia] #63643
02/12/06 06:33
02/12/06 06:33
Joined: Jul 2003
Posts: 893
Melbourne, Australia
Matt_Coles Offline

User
Matt_Coles  Offline

User

Joined: Jul 2003
Posts: 893
Melbourne, Australia
very nice effect! It would be interesting to see it combined with renderview.dll

Re: Retina Burn/Flash Bang [Re: Matt_Coles] #63644
02/12/06 07:34
02/12/06 07:34
Joined: Oct 2003
Posts: 4,131
M
Matt_Aufderheide Offline
Expert
Matt_Aufderheide  Offline
Expert
M

Joined: Oct 2003
Posts: 4,131
PLEASE!! dont use my renderview.dll .. it is really slow..too slow to be used in a game i think. The main problem, for nayone who is interested, is that there is no easy way to transfer texturs genereated in the dll to the A6 interface.. so i have to use some slow D3DX function.. this is extremely slow...even if you use a very tiny texture.

The better way would be to write the rendering routine in the dll itself. Just take my source and modfiy it.. if you have my orginal dll source, someone can do this with some basic D3D knowledge. Just take the backbuffer, and instead of sing D3DXLoadSurfaceFromSurface, define a screen alinged quad and render this with a shader.


Sphere Engine--the premier A6 graphics plugin.
Re: Retina Burn/Flash Bang [Re: Matt_Aufderheide] #63645
02/13/06 13:21
02/13/06 13:21
Joined: Mar 2001
Posts: 3,298
Beverly, Massachusetts
Rhuarc Offline
Expert
Rhuarc  Offline
Expert

Joined: Mar 2001
Posts: 3,298
Beverly, Massachusetts
Quote:

PLEASE!! dont use my renderview.dll .. it is really slow..too slow to be used in a game i think. The main problem, for nayone who is interested, is that there is no easy way to transfer texturs genereated in the dll to the A6 interface.. so i have to use some slow D3DX function.. this is extremely slow...even if you use a very tiny texture.



Amen to that.

The better way would be to write the rendering routine in the dll itself. Just take my source and modfiy it.. if you have my orginal dll source, someone can do this with some basic D3D knowledge. Just take the backbuffer, and instead of sing D3DXLoadSurfaceFromSurface, define a screen alinged quad and render this with a shader.



This is how I would do it... just render a quad with the texture....


I no longer post on these forums, keep in touch with me via:
Linkedin.com
My MSDN blog

Moderated by  adoado, checkbutton, mk_1, Perro 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1