Hard Light Productions Forums

Modding, Mission Design, and Coding => FS2 Open Coding - The Source Code Project (SCP) => Topic started by: Bobboau on October 15, 2002, 02:24:48 am

Title: animated textures
Post by: Bobboau on October 15, 2002, 02:24:48 am
add
Code: [Select]

int numframes[MAX_MODEL_TEXTURES]; // number o frames-Bobboau
int fps[MAX_MODEL_TEXTURES]; // frames per second-Bobboau
int is_ani[MAX_MODEL_TEXTURES]; // flag for weather this texture is an ani-Bobboau

to the polymodel structure in model.h

in the case ID_TXTR of read_model_file
replace (the bold part is what is replaced)
Code: [Select]

if ( strstr(tmp_name, "thruster") || strstr(tmp_name, "invisible") || strstr(tmp_name, "warpmap") ) { //added warp map for subspace rift rendering-Bobboau
// Don't load textures for thruster animations or invisible textures
pm->textures[i] = -1;
[b]} else {
pm->textures[i] = bm_load( tmp_name );
}[/b]

with
Code: [Select]

} else {
pm->textures[i] = bm_load( tmp_name );

if (pm->textures[i]<0) { //if I couldn't find the PCX see if there is an ani-Bobboau

nprintf(("couldn't find %s.pcx",tmp_name));

pm->is_ani[i] = 1; //this is an animated texture
pm->textures[i] = bm_load_animation(tmp_name,  &pm->numframes[i], &pm->fps[i], 1);

if(pm->textures[i]<0){
Warning( LOCATION, "Couldn't open texture '%s'\nreferenced by model '%s'\n", tmp_name, pm->filename );
pm->textures[i] = -1;
pm->is_ani[i] = 0; //this isn't an animated texture after all
nprintf((" or %s.ani\n",tmp_name));
}else{
mprintf(("but I did find %s.ani, ", tmp_name));
mprintf(("with %d frames, ", pm->numframes[i]));
mprintf(("and a rate of %d\n", pm->fps[i]));
}
}
}


and

were in model_interp_tmappoly it says
Code: [Select]

texture = pm->textures[w(p+40)];//here is were it picks the texture to render for ani-Bobboau


replace with
Code: [Select]

if (pm->is_ani[w(p+40)]){
texture = pm->textures[w(p+40)] + ((timestamp() / (int)(pm->fps[w(p+40)])) % pm->numframes[w(p+40)]);//here is were it picks the texture to render for ani-Bobboau
}else{
texture = pm->textures[w(p+40)];//here is were it picks the texture to render for normal-Bobboau
}

that was easier than it should have been, after I set my mind to it it took all of about fifteen minutes to get working (note I haven't tested this in game, only the tech room, I may need to page this in still)

and the exe is in my latest revision of TBP open (http://freespace.volitionwatch.com/blackwater/TBPopen.zip)
(if you don't want to mess with the TBP stuff just extract the exe)
Title: animated textures
Post by: Bobboau on October 15, 2002, 02:55:26 am
just tested it in game, and it seems to work,
yup
Title: animated textures
Post by: Nico on October 15, 2002, 03:04:40 am
oooooooooooooooooooooooooooooooooooooooooooh!
Damn, i'm not even at home for two more weeks, can't try that :mad:
Title: animated textures
Post by: Zarax on October 15, 2002, 03:59:23 am
Bobbau, can i assume that these new features will be integrated in the next fs2 open exe?
Or does TBP has it's own source code modifications?
Title: animated textures
Post by: Bobboau on October 15, 2002, 04:03:30 am
well this is my sorce code mod, untill I can get CVS, I'm just gona have to tell those who know how to use it what I did,
and TBP isn't even officaly suporting any of the stuff I'm doing, yet
Title: animated textures
Post by: Zarax on October 15, 2002, 04:06:19 am
Oh, ok...
Wish that someone makes something less eyecandy but at least of the same importance, like improving campaign management with mission variables import and true dynamic mission tree support...
Title: animated textures
Post by: Nico on October 15, 2002, 06:08:01 am
btw, can we have some piccies? map a manticore with the thruster ani for exemple :)
Title: animated textures
Post by: RandomTiger on October 15, 2002, 08:40:23 am
Bob, cvs is seriously easy.
Did you get my e-mail about it?
Title: animated textures
Post by: Bobboau on October 16, 2002, 08:17:44 pm
I got the E-mail, never got around to reading it though.. I think I'll do that tonight, anyone got a private IRC and knowleg on how to operate CVS

and anyone who downloaded the thing I pointed to and you can't seem to get it to work try it again, my FTP thing wasn't doing what it should have been doing
Title: animated textures
Post by: Nico on October 17, 2002, 04:59:57 am
pics please...
Title: animated textures
Post by: KARMA on October 17, 2002, 05:09:49 am
well this really seems to be a greate thing:)
Title: animated textures
Post by: Inquisitor on October 17, 2002, 07:23:09 am
We have a dedicated IRC server.

irc.maxgaming.net:6667 #fs2source

look for EdGardner-MGT (me)
Title: animated textures
Post by: Bobboau on October 17, 2002, 07:30:42 am
it's too early right now, ether tonight or tomaro, I'm only up becase my brother needs someone to watch him get on the bus... wich he just did, I'm going back to sleep...
Title: animated textures
Post by: Inquisitor on October 17, 2002, 08:58:01 am
k, lemme know, I am (almost) always on that server.
Title: animated textures
Post by: Nico on October 17, 2002, 02:29:51 pm
alright, I give up.
Title: animated textures
Post by: Bobboau on October 17, 2002, 09:52:19 pm
well you can't realy take a still image of an animated texture, it sort of looses something in the translation
Title: animated textures
Post by: Nico on October 18, 2002, 03:59:31 am
still I can get an idea of it. never mind anyway.
Title: animated textures
Post by: phreak on October 18, 2002, 02:48:18 pm
take 2 and show us the difference
Title: animated textures
Post by: Rampage on January 01, 2003, 05:55:15 pm
Hmm... I see...  Has this been integrated into the source code?
Title: animated textures
Post by: Bobboau on January 01, 2003, 11:26:38 pm
yup, though nobody ever tested it for me,
hint hint
Title: animated textures
Post by: ZylonBane on January 01, 2003, 11:36:04 pm
See, with this someone could model the advert-blimp from Blade Runner, complete with animated screens.

"A new life awaits in the off-world colonies..."  :D
Title: animated textures
Post by: Nuke on January 02, 2003, 02:55:57 pm
you could always capture a breif sample of the game, heres what you need.

-a video card that can support multiple screens, with eighter composit or svideo out
-a vcr
- a blank tape
-a video capture card
-some svideo or composite cable
-video editing software

hook your vcr to your video card (if your card only lets you run one output at a time, then go find a spare tv right now and hook it to your vcr) and set your video to output to your composit/svideo out.

load freespace with code tweaks

punch record

play game, shoot up tweaked manticore

exit game

wire your vcr to your video capture card and capture the part of the tape you want to show off, capture it to an avi (or directly to a gif if your software lets you) and convert it to gif.

put gif on web and show off cool burning manticore


**** im bored, work sucks!