please help test texpac and dmaz.pacimage

BlitzMax Forums/BlitzMax Programming/please help test texpac and dmaz.pacimage

Texpac is ready for people to start using it I think. it's free well actually donation-ware so if you need a nice speed up of Drawtext on all cards or drawimage on some cards, give it a test. there is documentation and examples on the site and in the mod.

please post any suggestions or bugs here or on the texpac forum.

thanks

http://www.ooeyug.com/texpac
here is a ref link.
http://www.blitzbasic.com/Community/posts.php?topic=72245#807389

Oh Yeah... feel free to use Texpac for any engines.

I'm not sure if this is the best way to handle this... I sort of do a little callback from the drawing routine for each character. it's works, I just haven't decide how elegant it is. :)

test app:
Download

here's the the test app code, the functions that do the work are Wave and Bounce which were passed as function pointers
' load the pac
Local pac:TPac = LoadPac("incbin::fontA.pac")

' point to the set that's named "font"
Local font:TPacImage = pac.GetImage("font")

Global i:Float = 40000

Local txt0:String = "Here's a neat little effect."
Local txt1:String = "I'm not sure of the interface for this yet...~nI don't know if a 'callback' like this is the best way.~nBut it seems to work well.~nPRESS SPACE"
While Not KeyHit(KEY_ESCAPE)
	Cls
	
	If KeyHit(KEY_SPACE) Then i = Rand(-50000,50000)

	SetScale 1,1

	SetHandle font.TextWidth(txt0,-6,True)/2,font.TextHeight()/2
	font.DrawText txt0,400,100,-6,True,False,Wave
	
	SetColor 255,255,255
	SetHandle font.TextWidth(txt1,0,False)/2,font.TextHeight()/2
	font.DrawText txt1,400,350,0,False,False,Bounce
	

	SetHandle 0,0
	SetScale .65,.65
	font.DrawText i,0,0
	Flip
Wend


Function Wave( x:Float Var, y:Float Var, pos:Int )
	SeedRnd pos
	SetColor Rand(255),Rand(255),Rand(255)
	Local d:Float = Float(MilliSecs())/5.0
	y = Sin(d+Float(pos)*35.0)*20.0
	SeedRnd MilliSecs()
End Function


Function Bounce( x:Float Var, y:Float Var, pos:Int )
	If Int(i) > 0 Then i:-1
	If Int(i) < 0 Then i:+1
	x = Cos(pos*10.0)*(i*.01)*Cos(Float( i )/500.0*pos)
	y = Sin(pos*10.0)*(i*.01)*Cos(Float( i )/500.0*pos)
End Function


Works great here. I do callbacks like that as well, since there is some overhead I always make duplicate routines so they can use the callback method or not. ;)

BTW I LOVE TexPac, and I was going to contact you about adding support for the file format to MGE. I've only had time to play around with the TexPac editor and not use anything in my code, but the time has come!

Is there some source that I can grab that let's me pull in all of the sprite/animation data for the texture? Thanks again for making TexPac, this is going to be a HUGE time saver! Your donation IS coming because I plan on using this extensively. Since it will be part of MGE (loading the TexPac data) I will make sure to credit you and push for donations as well. ;) Thanks!

Thanks...

Is there some source that I can grab that let's me pull in all of the sprite/animation data for the texture?

well, yeah but it's custom for pacimage.mod. I want to keep that close to the vest for now because I may be making some internal changes. but if you just want to see how I loaded the .pac file in then I can email you the function. Or, I can also modify TexPac to output what you want... I was actually planning on allowing the developer to create custom export files. Which of those works best for you.

hey, what happened to the blog...?

Thanks, I'm going to email you so you understand exactly what I'd like to do. Thanks! (re: Blog, I'm working on a new sig.) :) lol..

Dmaz - I'd like to learn how to read in the data so I can make use of the packed texture. Can you email me at:
info2 A T jgoware.com

I tried emailing you with no response at your yahoo address. Thanks!

just found it... it was in the spam filter.