Gamestudio Links
Zorro Links
Newest Posts
No connection to MT4
by Martin_HH. 11/23/26 06:38
MinMax function on History t6 file
by LucasJoshua. 11/21/26 14:28
What are you working on?
by rayp. 11/20/26 18:10
FXCM => AVA Trade Plugin???
by Martin_HH. 11/17/26 17:02
contractUpdate() is filtering if >2 rows
by mistery. 11/09/26 12:06
New Zorro version 3.15
by jcl. 11/09/26 09:24
Removing outliers from files
by jcl. 11/04/26 10:30
AUM Magazine
Latest Screens
Dorifto samurai
Shadow 2
Rocker`s Revenge
Stug 3 Stormartillery
Who's Online Now
0 registered members (), 29,302 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
EvanTJ, rht, MaliceTheMaker, Haitao_Ren, JimSimons
19250 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