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
1 registered members (TipmyPip), 18,619 guests, and 5 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
How to load a folder of images easily? #395912
02/29/12 05:22
02/29/12 05:22
Joined: Jan 2012
Posts: 39
B
BySharDe Offline OP
Newbie
BySharDe  Offline OP
Newbie
B

Joined: Jan 2012
Posts: 39
Hey,
I have to show a video clip with alpha channel(mov format).
It seems that acknex don't support *.mov. So I convert the clip into a list of images: *001.tga,*002.tga,....*500.tga.
Anyone can help with an easy way to load these images and play them like a video?
All I have will be using STRING POINTER ARRAY, and YOU?

Re: How to load a folder of images easily? [Re: BySharDe] #395913
02/29/12 06:38
02/29/12 06:38
Joined: Apr 2007
Posts: 3,751
Canada
WretchedSid Offline
Expert
WretchedSid  Offline
Expert

Joined: Apr 2007
Posts: 3,751
Canada
You could use txt_for_dir and then iterate through the folder contents, or, probably better, use the WinAPI to directly enumerate the folders content.
Here is an easy to pick up sample with links to everything you need to do it with the WinAPI


Shitlord by trade and passion. Graphics programmer at Laminar Research.
I write blog posts at feresignum.com
Re: How to load a folder of images easily? [Re: WretchedSid] #395919
02/29/12 09:43
02/29/12 09:43
Joined: Jan 2012
Posts: 39
B
BySharDe Offline OP
Newbie
BySharDe  Offline OP
Newbie
B

Joined: Jan 2012
Posts: 39
Thx to JustSid.
Yes, I used WIN32 API and got it.
------------------- Here they are-----
DWORD WINAPI FindFirstFile(char* lpFileName,WIN32_FIND_DATA* lpFindFileData);
BOOL WINAPI FindNextFile(DWORD hFindFile,WIN32_FIND_DATA* lpFindFileData);
BOOL WINAPI FindClose(DWORD hFindFile);
---------------------------------------

Re: How to load a folder of images easily? [Re: BySharDe] #395922
02/29/12 10:42
02/29/12 10:42
Joined: Mar 2011
Posts: 3,150
Budapest
sivan Offline
Expert
sivan  Offline
Expert

Joined: Mar 2011
Posts: 3,150
Budapest
or you can use EvilSOB's code txt_for_dir_plus shared recently. it enables using multiple extensions. really cool.
http://www.opserver.de/ubb7/ubbthreads.php?ubb=showflat&Number=394699#Post394699


Free world editor for 3D Gamestudio: MapBuilder Editor
Re: How to load a folder of images easily? [Re: BySharDe] #395971
02/29/12 20:22
02/29/12 20:22
Joined: Aug 2011
Posts: 58
Colombia/Bogotá
W
wdakfenixx Offline
Junior Member
wdakfenixx  Offline
Junior Member
W

Joined: Aug 2011
Posts: 58
Colombia/Bogotá
Try this

Code:
var _str_separator = ' ';STRING* _str_temp = "";var _strpos = 0;

//THIS FUNCTION (str_replace) WAS TAKEN FROM STRIO.C

STRING* str_replace(STRING* str, char* original, char* replacement)
{
 var start = str_stri(str,original);
 if (start)
 {
  str_cpy(_str_temp,str);	
  str_trunc(str,str_len(str)-start+1);
  str_clip(_str_temp,start+str_len(original)-1);
  str_cat(str,replacement);
  str_cat(str,_str_temp);
  return str;
 }
 return NULL;
}

function movie(STRING* FL, PANEL* P)
{
 var i;
 STRING* SPRITE_str[500];STRING* Num[500];
 for(i=0;i<500;i++)
 {
  Num[i]=str_create("");
  SPRITE_str[i]=str_create("&n&%fl%");
  str_for_num(Num[i],i);
  str_replace(SPRITE_str[i], "%fl%", Fl);
  str_replace(SPRITE_str[i], "&n&", Num[i]);
 }
 while(1)
 {
  for(i=0;i<500;i++)
  {
   P.bmap = bmap_create(SPRITE_str[i]);
   wait(1);
  }
  wait(1);
 }
}
PANEL X;
function main()
{
 X = pan_create("flags = SHOW;", 99);
 movie(.tga,X);
}



Last edited by wdakfenixx; 02/29/12 20:26.

CAUTION :The content above could blow your mind

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