Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
2 registered members (TipmyPip, 1 invisible), 18,731 guests, and 7 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 2 of 2 1 2
Re: set BMAP by function [Re: delinkx] #263368
04/29/09 09:18
04/29/09 09:18
Joined: Jun 2008
Posts: 151
Ukraine
XD1v0 Offline OP
Member
XD1v0  Offline OP
Member

Joined: Jun 2008
Posts: 151
Ukraine
Thanks guys for trying helping with this mess.
My mistake was that in function I trying set sturct BMAP, but this is wrong I must set pointer to BMAP not sturct.
there is working code
Code:
#include <acknex.h>
#include <default.c>

 
PANEL* cool_pan = 
{
	scale_x = 0.5; scale_y = 0.5;
	flags = SHOW;
}
function create_screen_bmap (BMAP** this,VECTOR* pos,VECTOR* aang)
{
	BMAP* fb = bmap_createblack(screen_size.x,screen_size.y,24); 
	vec_set(camera.x,pos);vec_set(camera.pan,aang);
	wait(2);// render screen in new position and angle
	bmap_for_screen(fb,0,1);
	*this = fb;
}

void main ()
{
	level_load(0);ent_create("sphere.mdl",nullvector,NULL);
	
	create_screen_bmap(cool_pan.bmap,vector(-50,0,0),nullvector);beep();
}


wink


A7 Commercial cool
Celeron 1700, GeForce 5500 FX 256mb, 1 Gb Ram
Re: set BMAP by function [Re: XD1v0] #263369
04/29/09 09:20
04/29/09 09:20
Joined: Jul 2008
Posts: 553
Singapore
delinkx Offline
User
delinkx  Offline
User

Joined: Jul 2008
Posts: 553
Singapore
yeps. this can be less complicated and non-ambiguous by keeping the BMAP global as mentioned in my code. but ur method also is fine.


A7 commercial Team / VC++ 2008 Pro
homepage | twitter | facebook
Re: set BMAP by function [Re: delinkx] #263411
04/29/09 13:14
04/29/09 13:14
Joined: Feb 2008
Posts: 3,232
Australia
EvilSOB Offline
Expert
EvilSOB  Offline
Expert

Joined: Feb 2008
Posts: 3,232
Australia
Ive discovered it may just be an issue with timing in the testing code.
This is working for me...
Code:
#include <acknex.h>
#include <default.c>

PANEL* cool_pan = 
{
	scale_x = 0.5; scale_y = 0.5;
	flags = SHOW;
}

BMAP* create_screen_bmap(VECTOR* pos, VECTOR* aang)
{
	BMAP* fb = bmap_createblack(screen_size.x,screen_size.y,24);
	vec_set(camera.x,pos);vec_set(camera.pan,aang);
	bmap_for_screen(fb,0,1);
	return(fb);
}

void main ()
{
	level_load(0);ent_create("level_export.mdl",nullvector,NULL);
	wait(5);   //<<make sure level load has completed before using bmap_for_screen
	//
	cool_pan.bmap = create_screen_bmap(vector(-50,0,0),nullvector);
	beep();
}



"There is no fate but what WE make." - CEO Cyberdyne Systems Corp.
A8.30.5 Commercial
Re: set BMAP by function [Re: EvilSOB] #263504
04/30/09 03:27
04/30/09 03:27
Joined: Jul 2008
Posts: 553
Singapore
delinkx Offline
User
delinkx  Offline
User

Joined: Jul 2008
Posts: 553
Singapore
ok. for many objects looks like we need to wait for the engine to update. cant this be taken care on the fly ? maybe should ask the developers that for every frame they do the update. maybe tat mite slow down the system.. i donno..


A7 commercial Team / VC++ 2008 Pro
homepage | twitter | facebook
Page 2 of 2 1 2

Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | 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