Gamestudio Links
Zorro Links
Newest Posts
Zorro FIX plugin - Experimental
by flink. 04/21/24 07:12
Data from CSV not parsed correctly
by EternallyCurious. 04/20/24 21:39
M1 Oversampling
by 11honza11. 04/20/24 20:57
Scripts not found
by juergen_wue. 04/20/24 18:51
zorro 64bit command line support
by 7th_zorro. 04/20/24 10:06
StartWeek not working as it should
by jcl. 04/20/24 08:38
folder management functions
by VoroneTZ. 04/17/24 06:52
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (AndrewAMD, rki), 390 guests, and 0 spiders.
Key: Admin, Global Mod, Mod
Newest Members
EternallyCurious, howardR, 11honza11, ccorrea, sakolin
19047 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 4 of 5 1 2 3 4 5
Re: save hmp file dll [Re: Wjbender] #450469
04/15/15 09:02
04/15/15 09:02
Joined: Mar 2011
Posts: 3,150
Budapest
sivan Offline
Expert
sivan  Offline
Expert

Joined: Mar 2011
Posts: 3,150
Budapest
it does not work too


Free world editor for 3D Gamestudio: MapBuilder Editor
Re: save hmp file dll [Re: sivan] #450474
04/15/15 11:51
04/15/15 11:51
Joined: Mar 2012
Posts: 927
cyberspace
W
Wjbender Offline OP
User
Wjbender  Offline OP
User
W

Joined: Mar 2012
Posts: 927
cyberspace
mm I must have missed a line of original width & height code likely.

just to be clear , how are you resizing the images ?

and are you using skip_original_pixels set to 1 or 0


Compulsive compiler
Re: save hmp file dll [Re: Wjbender] #450491
04/15/15 20:57
04/15/15 20:57
Joined: Mar 2012
Posts: 927
cyberspace
W
Wjbender Offline OP
User
Wjbender  Offline OP
User
W

Joined: Mar 2012
Posts: 927
cyberspace
as stated above I found one I missed , and corrected it . if it doesn't save correct now , I would need more details in the methods involved .


Compulsive compiler
Re: save hmp file dll [Re: Wjbender] #450492
04/15/15 20:57
04/15/15 20:57
Joined: Mar 2012
Posts: 927
cyberspace
W
Wjbender Offline OP
User
Wjbender  Offline OP
User
W

Joined: Mar 2012
Posts: 927
cyberspace
as stated above I found one I missed , and corrected it . if it doesn't save correct now , I would need more details in the methods involved .


Compulsive compiler
Re: save hmp file dll [Re: Wjbender] #450510
04/16/15 07:29
04/16/15 07:29
Joined: Mar 2011
Posts: 3,150
Budapest
sivan Offline
Expert
sivan  Offline
Expert

Joined: Mar 2011
Posts: 3,150
Budapest
hi, no success, only square skins are saved well, here is the colouring code I used for testing:

Code:
void		TerEdit_Tx_SetColor()
{
	wait(3);
	
	int skin_int = teredit_tx_selected+1+(teredit_tx_set-1)*max_teredit_tx_items;
	
	if (skin_int > teredit_tx_count)	return;																// protection
	
	if (!ent_getskin(terrain_entity, skin_int))											
		{
			return;
		}
	
	TerEdit_Tx_Color( bmap_for_entity(terrain_entity , skin_int) , vector(teredit_tx_blue,teredit_tx_green,teredit_tx_red) );
	wait_for(TerEdit_Tx_Color);
}


void		TerEdit_Tx_Color(BMAP* bmap_pointer, COLOR* to_color)				
{
	if (bmap_pointer == NULL)
		{
			return;
		}
	
	var pixel_format  = bmap_lock(bmap_pointer,0);														// lock and get format
	if (pixel_format >= 565) 
		{
			var pixel;
			COLOR pixel_color;
			var pixel_alpha;
			int i,j;
			for(i=0;i<bmap_width(bmap_pointer);i++)
				{
					for(j=0;j<bmap_height(bmap_pointer);j++)
						{
							pixel = pixel_for_bmap( bmap_pointer , i , j );								// get pixel
							pixel_to_vec( pixel_color , pixel_alpha , pixel_format , pixel );		// get color and alpha
							pixel = pixel_for_vec( to_color , pixel_alpha , pixel_format );		// set alpha
							pixel_to_bmap( bmap_pointer , i , j , pixel );								// set pixel
						}
				}
		}	
	bmap_unlock(bmap_pointer);	
	bmap_to_mipmap(bmap_pointer);	// @@@ update mipmaps after unlocking, to avoid the original skin to appear from big distance		
	wait(1);
	
	TerEdit_Tx_UpdateSets32();      // uses bmap_blit to copy skin texture to thumbnail
	TerrHmp_Tx_UpdateMaterialSkins();    // sets material skins to entity skins due to shader requirements
	wait(1);
}



Free world editor for 3D Gamestudio: MapBuilder Editor
Re: save hmp file dll [Re: sivan] #450512
04/16/15 07:40
04/16/15 07:40
Joined: Mar 2012
Posts: 927
cyberspace
W
Wjbender Offline OP
User
Wjbender  Offline OP
User
W

Joined: Mar 2012
Posts: 927
cyberspace
okay I wil look at the code , could it be possible that its a limitation ? I remember reading something about width and height being able to support non square values but the engine keeps it a power of 2 , I may be confusing this with something else but if I find it I wil tel you


Compulsive compiler
Re: save hmp file dll [Re: Wjbender] #450516
04/16/15 09:41
04/16/15 09:41
Joined: Mar 2011
Posts: 3,150
Budapest
sivan Offline
Expert
sivan  Offline
Expert

Joined: Mar 2011
Posts: 3,150
Budapest
I don't know whether GED supports it or not. if yes, GED's source could help. it was shared a while ago in the forum by jcl. I can upload if you need - if I can find it.


Free world editor for 3D Gamestudio: MapBuilder Editor
Re: save hmp file dll [Re: sivan] #450519
04/16/15 10:22
04/16/15 10:22
Joined: Mar 2012
Posts: 927
cyberspace
W
Wjbender Offline OP
User
Wjbender  Offline OP
User
W

Joined: Mar 2012
Posts: 927
cyberspace
in the manual , I found this :

If the texture had no mipmaps before, modified texture content gets lost when creating the mipmap chain the first time. Thus, create the mipmaps before modifying the texture, and call bmap_to_mipmap afterwards a second time for updating the modified content to the other mipmaps.
This function can not be applied to compressed (DDS), cubic, normal, tangent, rendertarget, or other special bitmaps. If required, create the mipmaps before converting the bitmap to a special format (for instance bmap_to_cubemap(bmap_to_mipmap(skymap)). Creating mipmaps afterwards will otherwise render the special bitmap unusable.

there's a problem with your code there(if you didn't have mipmaps before ) and I do not save mipmaps out to file yet.

I tested by doing pixel operations , followed by bmap_to_mipmap , which destroyed the modifications and results in behaviour you would not want ,if you were planning on keeping the pixel alterations ..

but still , how are you resizing the bmaps to be non square ? I mean what function ?


Compulsive compiler
Re: save hmp file dll [Re: Wjbender] #450529
04/16/15 19:58
04/16/15 19:58
Joined: Mar 2011
Posts: 3,150
Budapest
sivan Offline
Expert
sivan  Offline
Expert

Joined: Mar 2011
Posts: 3,150
Budapest
ahh thanks! a missed info. I can do that mipmap generation on texture editor initialization.

they are pre-made textures, 4 textures are combined into one, to easily access 8 textures from the terrain shader as 4 entity and 4 material skins (global color map, global normal map, rgba blendmap1, rgba blendmap2, 1st 1x4 color map, 1st 1x4 optional normal map, 2nd 1x4 color map, 2nd 1x4 optional normal map), but I could make 2x2 arrangement instead of 1x4, but with Gimp it is easier to create 1x4.


Free world editor for 3D Gamestudio: MapBuilder Editor
Re: save hmp file dll [Re: sivan] #450533
04/16/15 20:35
04/16/15 20:35
Joined: Mar 2012
Posts: 927
cyberspace
W
Wjbender Offline OP
User
Wjbender  Offline OP
User
W

Joined: Mar 2012
Posts: 927
cyberspace
okay so you made texture atlases ,I understand .

how do you feed the texture parts from the atlas, as new bmap skins , before you save ?

and what format are those bmaps ?


Compulsive compiler
Page 4 of 5 1 2 3 4 5

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

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