Author Topic: animated textures  (Read 5357 times)

0 Members and 1 Guest are viewing this topic.

Offline Bobboau

  • Just a MODern kinda guy
    Just MODerately cool
    And MODest too
  • 213
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
(if you don't want to mess with the TBP stuff just extract the exe)
« Last Edit: October 15, 2002, 04:06:01 am by 57 »
Bobboau, bringing you products that work... in theory
learn to use PCS
creator of the ProXimus Procedural Texture and Effect Generator
My latest build of PCS2, get it while it's hot!
PCS 2.0.3


DEUTERONOMY 22:11
Thou shalt not wear a garment of diverse sorts, [as] of woollen and linen together

 

Offline Bobboau

  • Just a MODern kinda guy
    Just MODerately cool
    And MODest too
  • 213
just tested it in game, and it seems to work,
yup
Bobboau, bringing you products that work... in theory
learn to use PCS
creator of the ProXimus Procedural Texture and Effect Generator
My latest build of PCS2, get it while it's hot!
PCS 2.0.3


DEUTERONOMY 22:11
Thou shalt not wear a garment of diverse sorts, [as] of woollen and linen together

 

Offline Nico

  • Venom
    Parlez-vous Model Magician?
  • 212
oooooooooooooooooooooooooooooooooooooooooooh!
Damn, i'm not even at home for two more weeks, can't try that :mad:
SCREW CANON!

 

Offline Zarax

  • 210
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?
The Best is Yet to Come

 

Offline Bobboau

  • Just a MODern kinda guy
    Just MODerately cool
    And MODest too
  • 213
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
Bobboau, bringing you products that work... in theory
learn to use PCS
creator of the ProXimus Procedural Texture and Effect Generator
My latest build of PCS2, get it while it's hot!
PCS 2.0.3


DEUTERONOMY 22:11
Thou shalt not wear a garment of diverse sorts, [as] of woollen and linen together

 

Offline Zarax

  • 210
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...
The Best is Yet to Come

 

Offline Nico

  • Venom
    Parlez-vous Model Magician?
  • 212
btw, can we have some piccies? map a manticore with the thruster ani for exemple :)
SCREW CANON!

 

Offline RandomTiger

  • Senior Member
  • 211
Bob, cvs is seriously easy.
Did you get my e-mail about it?

 

Offline Bobboau

  • Just a MODern kinda guy
    Just MODerately cool
    And MODest too
  • 213
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
Bobboau, bringing you products that work... in theory
learn to use PCS
creator of the ProXimus Procedural Texture and Effect Generator
My latest build of PCS2, get it while it's hot!
PCS 2.0.3


DEUTERONOMY 22:11
Thou shalt not wear a garment of diverse sorts, [as] of woollen and linen together

 

Offline Nico

  • Venom
    Parlez-vous Model Magician?
  • 212
pics please...
SCREW CANON!

 

Offline KARMA

  • Darth Hutt
  • 211
    • http://members.fortunecity.com/aranbanjo
well this really seems to be a greate thing:)

 

Offline Inquisitor

We have a dedicated IRC server.

irc.maxgaming.net:6667 #fs2source

look for EdGardner-MGT (me)
No signature.

 

Offline Bobboau

  • Just a MODern kinda guy
    Just MODerately cool
    And MODest too
  • 213
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...
Bobboau, bringing you products that work... in theory
learn to use PCS
creator of the ProXimus Procedural Texture and Effect Generator
My latest build of PCS2, get it while it's hot!
PCS 2.0.3


DEUTERONOMY 22:11
Thou shalt not wear a garment of diverse sorts, [as] of woollen and linen together

 

Offline Inquisitor

k, lemme know, I am (almost) always on that server.
No signature.

 

Offline Nico

  • Venom
    Parlez-vous Model Magician?
  • 212
alright, I give up.
SCREW CANON!

 

Offline Bobboau

  • Just a MODern kinda guy
    Just MODerately cool
    And MODest too
  • 213
well you can't realy take a still image of an animated texture, it sort of looses something in the translation
Bobboau, bringing you products that work... in theory
learn to use PCS
creator of the ProXimus Procedural Texture and Effect Generator
My latest build of PCS2, get it while it's hot!
PCS 2.0.3


DEUTERONOMY 22:11
Thou shalt not wear a garment of diverse sorts, [as] of woollen and linen together

 

Offline Nico

  • Venom
    Parlez-vous Model Magician?
  • 212
still I can get an idea of it. never mind anyway.
SCREW CANON!

 

Offline phreak

  • Gun Phreak
  • 211
  • -1
take 2 and show us the difference
Offically approved by Ebola Virus Man :wtf:
phreakscp - gtalk
phreak317#7583 - discord

 

Offline Rampage

  • Son Of Rampage
  • 211
  • Urogynaecologist
Hmm... I see...  Has this been integrated into the source code?

 

Offline Bobboau

  • Just a MODern kinda guy
    Just MODerately cool
    And MODest too
  • 213
yup, though nobody ever tested it for me,
hint hint
Bobboau, bringing you products that work... in theory
learn to use PCS
creator of the ProXimus Procedural Texture and Effect Generator
My latest build of PCS2, get it while it's hot!
PCS 2.0.3


DEUTERONOMY 22:11
Thou shalt not wear a garment of diverse sorts, [as] of woollen and linen together