Commit MetaInfo

Révision1735f6a35598343464462e4dd12a273a0ae580cc (tree)
l'heure2013-03-08 00:56:24
AuteurFace
CommiterFace

Message de Log

Merged in fixes for issue #1

Change Summary

Modification

diff -r 6364245a8055 -r 1735f6a35598 Orbitersdk/samples/genericvessel/GenericVessel.cpp
--- a/Orbitersdk/samples/genericvessel/GenericVessel.cpp Thu Mar 07 16:09:59 2013 +0100
+++ b/Orbitersdk/samples/genericvessel/GenericVessel.cpp Thu Mar 07 16:56:24 2013 +0100
@@ -6,29 +6,11 @@
66 #pragma once
77 #define ORBITER_MODULE
88 #define _CRT_SECURE_NO_WARNINGS
9-#define _CRT_NONSTDC_NO_DEPRECATE
10-#define SPACECRAFTCLASS "spacecraft\\spacecraft"
11-#define SPACECRAFTINIPATH ".\\Config\\Spacecraft\\%s.ini"
12-#define CONFIGDIRTAG "ConfigDir"
13-#define MESHDIRTAG "MeshDir"
14-#define TEXTUREDIRTAG "TextureDir"
15-#define HIGHTEXDIRTAG "HightexDir"
16-#define SCENARIODIRTAG "ScenarioDir"
17-#define CONFIGDIRDEFAULT ".\\Config\\"
18-#define MESHDIRDEFAULT ".\\Meshes\\"
19-#define TEXTUREDIRDEFAULT ".\\Textures\\"
20-#define HIGHTEXDIRDEFAULT ".\\Textures2\\"
21-#define SCENARIODIRDEFAULT ".\\Scenarios\\"
22-#define CONFIGPATH "%s%s.cfg"
23-#define CONFIG2PATH "%sVessels\\%s.cfg"
24-#define ORBITERCONFIG "Orbiter.cfg"
25-#define CONFIGEXCEPTION "abort: neither vessel configuration \"%s%s.cfg\" nor \"%sVessels\\%s.cfg\" was found!"
9+#define _CRT_NONSTDC_NO_DEPRECATE
10+//############################################################################//
2611 #include <math.h>
2712 #include <stdio.h>
2813 #include "orbitersdk.h"
29-#ifndef NOPM
30-#include <PayloadManager.h>
31-#endif
3214 //############################################################################//
3315 #include "genericvessel.h"
3416
@@ -130,6 +112,10 @@
130112 //INI file at legacy location - fixed prefix here, because it is not clear if SC3 respected custom config paths
131113 iniFile=new char[strlen(name)+strlen(SPACECRAFTINIPATH)];
132114 sprintf(iniFile, SPACECRAFTINIPATH, name);
115+ }else if (strncmp(cn, SPACECRAFTCLASS2, strlen(SPACECRAFTCLASS2))==0){
116+ //INI file at legacy location - fixed prefix here, because it is not clear if SC3 respected custom config paths
117+ iniFile=new char[strlen(name)+strlen(SPACECRAFTINIPATH)];
118+ sprintf(iniFile, SPACECRAFTINIPATH, name);
133119 }else{
134120 //configuration file is also INI file, read orbiter.cfg first to get custom config paths
135121 FILEHANDLE f=oapiOpenFile(ORBITERCONFIG, FILE_IN);
@@ -315,6 +301,12 @@
315301 }
316302 }
317303
304+ //Initialize animations
305+ for(i=0;i<sc3.Config.anicnt;i++){
306+ ani[i].status=ANI_BACK_PAUSE;
307+ if(ani[i].repeat)ani[i].status=ANI_RUN;
308+ }
309+
318310 //Beacons
319311 for(i=0;i<sc3.Config.beaccnt;i++)AddBeacon(&sc3.Data.beac[i].bl);
320312
@@ -369,7 +361,7 @@
369361 if(PM_LoadState(line))continue;
370362 #endif
371363
372- //Animation states (not SC3 compatible)
364+ //Animation states
373365 if(!strnicmp(line,"SEQ",3)){
374366 sscanf(line+4,"%d",&i);
375367 if((i>=0)&&(i<sc3.Config.anicnt)){
@@ -377,10 +369,9 @@
377369 if(i>=10)n=1;
378370 if(i>=100)n=2;
379371 if(i>=1000)n=3;
380- sscanf(line+6+n,"%d",&ani[i].status);
381- sscanf(line+6+n+3,"%lf",&ani[i].proc);
372+ sscanf(line+6+n,"%d %lf",&ani[i].status,&ani[i].proc);
382373 SetAnimation(ani[i].id,ani[i].proc);
383- if(sc3.Config.tdp_anim==i)if(abs(ani[i].status)==2){
374+ if(sc3.Config.tdp_anim==i)if(abs(ani[i].status)==ANI_PAUSE){
384375 if(sc3.Config.tdcnt>=1)if(ani[i].proc==0.0)SetTouchdownPoints(sc3.Data.td[0].pta,sc3.Data.td[0].ptb,sc3.Data.td[0].ptc);
385376 if(sc3.Config.tdcnt>=2)if(ani[i].proc==1.0)SetTouchdownPoints(sc3.Data.td[1].pta,sc3.Data.td[1].ptb,sc3.Data.td[1].ptc);
386377 }
@@ -510,26 +501,46 @@
510501 case OAPI_KEY_A:att_on=!att_on;att_blank=1;break;
511502 }
512503 }
504+ //Payload jettisoning
513505 if(key==OAPI_KEY_J)sc3.Jettison();
506+
507+
514508 //Animation handling
515509 for(i=0;i<sc3.Config.anicnt;i++)if(ani[i].tp==0){
516510 DWORD mod=ani[i].trigkey >> 8;
517511 if(!mod | KEYDOWN(kstate, mod))if(key==(ani[i].trigkey & 0xFF)){
518- if(!ani[i].repeat){
519- switch(ani[i].status){
520- //Fix it short
521- case -2:ani[i].status=1;break;
522- case -1:ani[i].status=1;break;
523- case 1:ani[i].status=-1;break;
524- case 2:ani[i].status=-1;break;
525- default:ani[i].status=2;
526- }
527- }else{
528- switch(ani[i].status){
529- case 1:ani[i].status=0;break;
530- case 0:ani[i].status=1;break;
531- default:ani[i].status=0;
532- }
512+ if(ani[i].repeat!=0){
513+ switch(ani[i].status){
514+ case ANI_RUN:ani[i].status=ANI_PAUSE;break;
515+ case ANI_PAUSE:ani[i].status=ANI_RUN;break;
516+ default:ani[i].status=ANI_RUN;
517+ }
518+ }else if(ani[i].pause){
519+ if(KEYMOD_LCONTROL(kstate)){
520+ switch(ani[i].status){
521+ case ANI_RUN :ani[i].status=ANI_PAUSE;break;
522+ case ANI_BACK_RUN :ani[i].status=ANI_PAUSE;break;
523+ case ANI_BACK_PAUSE:ani[i].status=ANI_BACK_RUN;break;
524+ case ANI_PAUSE :ani[i].status=ANI_BACK_RUN;break;
525+ default:ani[i].status=ANI_PAUSE;
526+ }
527+ }else{
528+ switch(ani[i].status){
529+ case ANI_RUN :ani[i].status=ANI_PAUSE;break;
530+ case ANI_BACK_RUN :ani[i].status=ANI_PAUSE;break;
531+ case ANI_BACK_PAUSE:ani[i].status=ANI_RUN;break;
532+ case ANI_PAUSE :ani[i].status=ANI_RUN;break;
533+ default:ani[i].status=ANI_PAUSE;
534+ }
535+ }
536+ }else{
537+ switch(ani[i].status){
538+ case ANI_RUN :ani[i].status=ANI_BACK_RUN;break;
539+ case ANI_BACK_RUN :ani[i].status=ANI_RUN;break;
540+ case ANI_BACK_PAUSE:ani[i].status=ANI_RUN;break;
541+ case ANI_PAUSE :ani[i].status=ANI_BACK_RUN;break;
542+ default:ani[i].status=ANI_PAUSE;
543+ }
533544 }
534545 }
535546 }
@@ -569,28 +580,28 @@
569580 double pos;
570581
571582 //Animations
572- for(i=0;i<sc3.Config.anicnt;i++)if(abs(ani[i].status)==1){
583+ for(i=0;i<sc3.Config.anicnt;i++)if((ani[i].status==ANI_RUN)||(ani[i].status==ANI_BACK_RUN)){
573584 double da=simdt*ani[i].spd;
585+
574586 if(ani[i].repeat==1){
575587 ani[i].proc=fmod(ani[i].proc+da,1);
576588 }else if(ani[i].repeat==2){
577- if(ani[i].status==1){
578- if(ani[i].proc+da>1.0){ani[i].status=-1;ani[i].proc=(ani[i].proc+da)-1.0;}else ani[i].proc+=da;
579- }
580- if(ani[i].status==-1){
581- if(ani[i].proc-da<0.0){ani[i].status=1;ani[i].proc=-(ani[i].proc-da);}else ani[i].proc-=da;
589+ if(ani[i].status==ANI_RUN){
590+ if(ani[i].proc+da>1.0){ani[i].status=ANI_BACK_RUN;ani[i].proc=1.0;}else ani[i].proc+=da;
591+ }else if(ani[i].status==ANI_BACK_RUN){
592+ if(ani[i].proc-da<0.0){ani[i].status=ANI_RUN;ani[i].proc=0;}else ani[i].proc-=da;
582593 }
583594 }else{
584- if(ani[i].status==-1){
595+ if(ani[i].status==ANI_BACK_RUN){
585596 if(ani[i].proc>0.0)ani[i].proc=max(0.0,ani[i].proc-da);
586- else ani[i].status=-2;
597+ else ani[i].status=ANI_BACK_PAUSE;
587598 }else{
588599 if(ani[i].proc<1.0)ani[i].proc=min(1.0,ani[i].proc+da);
589- else ani[i].status=2;
600+ else ani[i].status=ANI_PAUSE;
590601 }
591602 }
592603 SetAnimation(ani[i].id,ani[i].proc);
593- if(sc3.Config.tdp_anim==i)if(abs(ani[i].status)==2){
604+ if(sc3.Config.tdp_anim==i)if(abs(ani[i].status)==ANI_PAUSE){
594605 if(sc3.Config.tdcnt>=1)if(ani[i].proc==0.0)SetTouchdownPoints(sc3.Data.td[0].pta,sc3.Data.td[0].ptb,sc3.Data.td[0].ptc);
595606 if(sc3.Config.tdcnt>=2)if(ani[i].proc==1.0)SetTouchdownPoints(sc3.Data.td[1].pta,sc3.Data.td[1].ptb,sc3.Data.td[1].ptc);
596607 }
diff -r 6364245a8055 -r 1735f6a35598 Orbitersdk/samples/genericvessel/GenericVessel.h
--- a/Orbitersdk/samples/genericvessel/GenericVessel.h Thu Mar 07 16:09:59 2013 +0100
+++ b/Orbitersdk/samples/genericvessel/GenericVessel.h Thu Mar 07 16:56:24 2013 +0100
@@ -6,7 +6,30 @@
66 #pragma once
77 #include "Orbitersdk.h"
88 #include "SC3Data.h"
9-#define CUSTOMDIRSLENGTH 1024
9+#define CUSTOMDIRSLENGTH 1024
10+//############################################################################//
11+#define SPACECRAFTCLASS "spacecraft\\spacecraft"
12+#define SPACECRAFTCLASS2 "spacecraft/spacecraft"
13+#define SPACECRAFTINIPATH ".\\Config\\Spacecraft\\%s.ini"
14+#define CONFIGDIRTAG "ConfigDir"
15+#define MESHDIRTAG "MeshDir"
16+#define TEXTUREDIRTAG "TextureDir"
17+#define HIGHTEXDIRTAG "HightexDir"
18+#define SCENARIODIRTAG "ScenarioDir"
19+#define CONFIGDIRDEFAULT ".\\Config\\"
20+#define MESHDIRDEFAULT ".\\Meshes\\"
21+#define TEXTUREDIRDEFAULT ".\\Textures\\"
22+#define HIGHTEXDIRDEFAULT ".\\Textures2\\"
23+#define SCENARIODIRDEFAULT ".\\Scenarios\\"
24+#define CONFIGPATH "%s%s.cfg"
25+#define CONFIG2PATH "%sVessels\\%s.cfg"
26+#define ORBITERCONFIG "Orbiter.cfg"
27+#define CONFIGEXCEPTION "abort: neither vessel configuration \"%s%s.cfg\" nor \"%sVessels\\%s.cfg\" was found!"
28+//############################################################################//
29+#define ANI_RUN 1
30+#define ANI_BACK_RUN -1
31+#define ANI_PAUSE 2
32+#define ANI_BACK_PAUSE -2
1033 //############################################################################//
1134 //Vessel class
1235 class GenericVessel:public VESSEL3{
diff -r 6364245a8055 -r 1735f6a35598 Orbitersdk/samples/genericvessel/xves.h
--- a/Orbitersdk/samples/genericvessel/xves.h Thu Mar 07 16:09:59 2013 +0100
+++ b/Orbitersdk/samples/genericvessel/xves.h Thu Mar 07 16:56:24 2013 +0100
@@ -86,7 +86,7 @@
8686 };
8787 struct genericvessel_animinfo{
8888 UINT id;
89- DWORD tp,repeat;
89+ DWORD tp,repeat,pause;
9090 DWORD trigkey;
9191 int status;
9292 double spd,proc,init;
@@ -156,7 +156,7 @@
156156 //############################################################################//
157157 //Crew info
158158 struct genericvessel_crewinfo{
159- VECTOR3 air_pos,eva_rot,air_siz; //Airlock position, rotation, ...
159+ VECTOR3 air_pos,air_siz,eva_pos,eva_rot; //Airlock position, rotation, ...
160160 int maxcrew;
161161 };
162162 //############################################################################//
diff -r 6364245a8055 -r 1735f6a35598 Orbitersdk/samples/xves/oapi.pas
--- a/Orbitersdk/samples/xves/oapi.pas Thu Mar 07 16:09:59 2013 +0100
+++ b/Orbitersdk/samples/xves/oapi.pas Thu Mar 07 16:56:24 2013 +0100
@@ -179,13 +179,8 @@
179179 begin
180180 result:=0;
181181 s:=lowercase(trim(s));
182- if s='s' then result:=OAPI_KEY_S;
183- if s='l' then result:=OAPI_KEY_L;
184182 if s='k' then result:=OAPI_KEY_K;
185183 if s='g' then result:=OAPI_KEY_G;
186- if s='j' then result:=OAPI_KEY_J;
187- if s='b' then result:=OAPI_KEY_b;
188- if s='a' then result:=OAPI_KEY_a;
189184 if s='0' then result:=(OAPI_KEY_LSHIFT shl 8) or OAPI_KEY_NUMPAD0;
190185 if s='1' then result:=(OAPI_KEY_LSHIFT shl 8) or OAPI_KEY_NUMPAD1;
191186 if s='2' then result:=(OAPI_KEY_LSHIFT shl 8) or OAPI_KEY_NUMPAD2;
diff -r 6364245a8055 -r 1735f6a35598 Orbitersdk/samples/xves/os_gen.pas
--- a/Orbitersdk/samples/xves/os_gen.pas Thu Mar 07 16:09:59 2013 +0100
+++ b/Orbitersdk/samples/xves/os_gen.pas Thu Mar 07 16:56:24 2013 +0100
@@ -108,6 +108,7 @@
108108 main_dat.crew[0].air_pos:=zvec;
109109 main_dat.crew[0].air_siz:=evec;
110110 main_dat.crew[0].eva_rot:=tvec(1,0,0);
111+ main_dat.crew[0].eva_pos:=zvec;
111112 end;
112113 //############################################################################//
113114 procedure os_makecleanvess;
@@ -125,7 +126,9 @@
125126 main_cfg.sorted_anims:=0;
126127 main_cfg.tdp_anim:=-1;
127128
128- main_cfg.pmi:=tvec(1,1,1);;main_cfg.cross:=zvec;main_cfg.rdrag:=zvec;
129+ main_cfg.pmi:=tvec(1,1,1);
130+ main_cfg.cross:=evec;
131+ main_cfg.rdrag:=evec;
129132 main_cfg.defcamera:=zvec;
130133
131134 main_cfg.frc1:=0.07;main_cfg.frc2:=0.3;main_cfg.cw1:=0.09;main_cfg.cw2:=0.09;
diff -r 6364245a8055 -r 1735f6a35598 Orbitersdk/samples/xves/os_sc3_reader.pas
--- a/Orbitersdk/samples/xves/os_sc3_reader.pas Thu Mar 07 16:09:59 2013 +0100
+++ b/Orbitersdk/samples/xves/os_sc3_reader.pas Thu Mar 07 16:56:24 2013 +0100
@@ -12,10 +12,12 @@
1212 //############################################################################//
1313 const SEC_COUNT=1000; //Max number of [] sections in an ini
1414 //############################################################################//
15+type astr=array of string;
1516 type parse_info_rec=record
1617 one_str:array[0..255]of char;
1718 spc:array[0..SEC_COUNT-1]of array[0..255]of char;
1819 spcs:array[0..SEC_COUNT-1]of integer;
20+ remains:string;
1921
2022 w0,w1:boolean;
2123
@@ -28,7 +30,8 @@
2830 hud_siz:double;
2931 hud_center:vec;
3032
31- off,dir:vec;
33+ off:array[0..4]of vec;
34+ dir:vec;
3235 ex_length,ex_width:double;
3336
3437 anim_seq_key:string;
@@ -49,12 +52,75 @@
4952 pparse_info_rec=^parse_info_rec;
5053 //############################################################################//
5154 function vali(par:string):integer;var n:integer;begin val(trim(par),result,n);end;
52-function vale(par:string):double; var n:integer;begin val(trim(par),result,n);end;
55+function vale(par:string):double; var n:integer;begin val(trim(par),result,n);end;
56+function strsinsym(s:string;c:char):string;
57+var i:integer;
58+b:boolean;
59+begin
60+ b:=false;
61+ result:='';
62+ for i:=1 to length(s) do if s[i]=c then begin
63+ if not b then begin
64+ result:=result+c;
65+ b:=true;
66+ end;
67+ end else begin
68+ b:=false;
69+ result:=result+s[i];
70+ end;
71+end;
72+function getfsymp(st:string;sb:char):integer;
73+var i:integer;
74+begin
75+ result:=0;
76+ if st<>'' then for i:=1 to length(st) do if (st[i]=sb)or((sb=' ')and(st[i]=#9)) then begin result:=i; exit; end;
77+end;
78+function getnsymp(st:string;sb:char;n:integer):integer;
79+var i:integer;
80+begin
81+ result:=0;
82+ if st<>'' then for i:=1 to length(st) do if (st[i]=sb)or((sb=' ')and(st[i]=#9)) then begin n:=n-1; if n=0 then begin result:=i; exit; end else continue; end;
83+end;
84+function valvec(st:string):vec;
85+var i,j:integer;
86+str1,str2,str3:string;
87+begin
88+ st:=strsinsym(st,' ');
89+ i:=getfsymp(st,',');
90+ j:=getnsymp(st,',',2);
91+ if i=0 then i:=getfsymp(st,' ');
92+ if j=0 then j:=getnsymp(st,' ',2);
93+ str1:=copy(st,1,i-1);
94+ str2:=copy(st,i+1,j-i-1);
95+ str3:=copy(st,j+1,length(st)-j);
96+ result.x:=vale(trim(str1));
97+ result.y:=vale(trim(str2));
98+ result.z:=vale(trim(str3));
99+end;
100+//############################################################################//
101+function break_str(s:string):astr;
102+var ss:string;
103+n,pr,c:integer;
104+begin
105+ c:=0;
106+ while c<10 do begin
107+ pr:=getnsymp(s,';',c);
108+ n:=getnsymp(s,';',c+1);
109+ if n<pr then n:=length(s)+1;
110+ ss:=copy(s,pr+1,n-pr-1);
111+ setlength(result,c+1);
112+ result[c]:=ss;
113+ c:=c+1;
114+ if n=length(s)+1 then break;
115+ end;
116+end;
53117 //############################################################################//
54118 //############################################################################//
55119 procedure applysec(sec:string;p:pparse_info_rec);
56120 var n:integer;
57-begin
121+a:astr;
122+begin
123+ a:=nil;
58124 if sec='config' then begin
59125 p.meshname:=trim(AnsiReplaceStr(AnsiReplaceStr(p.meshname,'''',' '),'"',' '));
60126 p.mn:=os_addmsh(p.meshname,(1-p.visible)*MESHVIS_EXTERNAL+p.visible*MESHVIS_ALWAYS,zvec);
@@ -75,9 +141,9 @@
75141 if p.mfd_l<>-1 then os_addvcmfd(n,MFD_LEFT,p.vcmn,p.mfd_l);
76142 if p.mfd_r<>-1 then os_addvcmfd(n,MFD_RIGHT,p.vcmn,p.mfd_r);
77143 end;
78- if copy(sec,1,8)='ex_main_' then if p.men<>-1 then os_addexhaust(p.men,p.ex_length,p.ex_width,p.off,p.dir);
79- if copy(sec,1,9)='ex_retro_' then if p.ren<>-1 then os_addexhaust(p.ren,p.ex_length,p.ex_width,p.off,p.dir);
80- if copy(sec,1,9)='ex_hover_' then if p.hen<>-1 then os_addexhaust(p.hen,p.ex_length,p.ex_width,p.off,p.dir);
144+ if copy(sec,1,8)='ex_main_' then if p.men<>-1 then os_addexhaust(p.men,p.ex_length,p.ex_width,p.off[0],p.dir);
145+ if copy(sec,1,9)='ex_retro_' then if p.ren<>-1 then os_addexhaust(p.ren,p.ex_length,p.ex_width,p.off[0],p.dir);
146+ if copy(sec,1,9)='ex_hover_' then if p.hen<>-1 then os_addexhaust(p.hen,p.ex_length,p.ex_width,p.off[0],p.dir);
81147 if copy(sec,1,7)='ex_att_' then if p.aen<>-1 then begin
82148 n:=-1;
83149 if p.rot_axis<>-1 then case p.rot_axis of
@@ -131,20 +197,16 @@
131197 1:n:=12;
132198 end;
133199 end;
134- if n<>-1 then os_addexhaust(p.aen+n,p.ex_length,p.ex_width,p.off,p.dir);
200+ if n<>-1 then os_addexhaust(p.aen+n,p.ex_length,p.ex_width,p.off[0],p.dir);
135201 end;
136202
137203 if copy(sec,1,9)='anim_seq_' then begin
138204 n:=vali(copy(sec,10,length(sec)-1));
139205 if n<>main_cfg.anicnt then exit;
140206 os_addanim(str2okey(p.anim_seq_key),0,1/max2(1,p.anim_seq_duration),p.anim_seq_init_pos);
141- //As stated in the SC3-PDF, the default status should be 2 for designed state
142- main_dat.anim[n].status:=2;
143- //Use the rept variable to also store the pause setting. According to SC3-PDF,
144- //pause is only valid for the normal repeat mode, so it can be interpreted as
145- //the 4th repeat mode
146- if (p.anim_seq_pause=1) and (p.anim_seq_repeat=0) then main_dat.anim[n].rept:=3
147- else main_dat.anim[n].rept:=p.anim_seq_repeat;
207+ main_dat.anim[n].pause:=p.anim_seq_pause;
208+ main_dat.anim[n].status:=1;
209+ main_dat.anim[n].rept:=p.anim_seq_repeat;
148210 end;
149211
150212 if copy(sec,1,10)='anim_comp_' then begin
@@ -163,7 +225,10 @@
163225 if copy(sec,1,8)='payload_' then begin
164226 if p.etc_meshname<>'' then begin
165227 p.etc_meshname:=trim(AnsiReplaceStr(AnsiReplaceStr(p.etc_meshname,'''',' '),'"',' '));
166- os_addmsh(p.etc_meshname,MESHVIS_ALWAYS,p.off);
228+ a:=break_str(p.etc_meshname);
229+ main_dat.pay[p.cur_pay].mesh:=os_addmsh(a[0],MESHVIS_ALWAYS,p.off[0]);
230+ for n:=1 to length(a)-1 do os_addmsh(a[n],MESHVIS_ALWAYS,p.off[n]);
231+ main_dat.pay[p.cur_pay].mesh_cnt:=length(a);
167232 end;
168233 end;
169234 end;
@@ -231,17 +296,27 @@
231296 procedure parse_ummu(p:pparse_info_rec;par:string);
232297 begin
233298 if par='maxseats' then main_dat.crew[0].maxcrew:=vali(p.spc[1]);
234- if par='airlock_position' then main_dat.crew[0].air_pos:=tvec(vale(p.spc[1]),vale(p.spc[2]),vale(p.spc[3]));
299+ if par='airlock_position' then begin
300+ main_dat.crew[0].air_pos:=tvec(vale(p.spc[1]),vale(p.spc[2]),vale(p.spc[3]));
301+ main_dat.crew[0].eva_pos:=main_dat.crew[0].air_pos;
302+ end;
235303 if par='airlock_size' then main_dat.crew[0].air_siz:=tvec(vale(p.spc[1]),vale(p.spc[2]),vale(p.spc[3]));
304+ if par='eva_pos' then main_dat.crew[0].eva_pos:=tvec(vale(p.spc[1]),vale(p.spc[2]),vale(p.spc[3]));
236305 if par='eva_rot' then main_dat.crew[0].eva_rot:=tvec(vale(p.spc[1]),vale(p.spc[2]),vale(p.spc[3]));
237306 end;
238307 //############################################################################//
239308 procedure parse_payload(p:pparse_info_rec;par:string);
240309 var ss:string;
241-j:integer;
310+a:astr;
311+j,i:integer;
242312 begin
243- if par='meshname' then p.etc_meshname:=p.spc[1];
244- if par='off' then p.off:=tvec(vale(p.spc[1]),vale(p.spc[2]),vale(p.spc[3]));
313+ a:=nil;
314+ if par='meshname' then p.etc_meshname:=p.remains;
315+ if par='off' then begin
316+ a:=break_str(p.remains);
317+ for i:=0 to length(a)-1 do
318+ p.off[i]:=valvec(copy(a[i],2,length(a[i])-2));
319+ end;
245320 if par='name' then begin
246321 ss:=trim(AnsiReplaceStr(AnsiReplaceStr(p.spc[1],'''',' '),'"',' '));
247322 for j:=0 to length(ss)-1 do main_dat.pay[p.cur_pay].name[j]:=ss[j+1];
@@ -307,7 +382,7 @@
307382 //############################################################################//
308383 procedure parse_exhaust(p:pparse_info_rec;par:string);
309384 begin
310- if par='off' then p.off:=tvec(vale(p.spc[1]),vale(p.spc[2]),vale(p.spc[3]));
385+ if par='off' then p.off[0]:=tvec(vale(p.spc[1]),vale(p.spc[2]),vale(p.spc[3]));
311386 if par='dir' then p.dir:=tvec(vale(p.spc[1]),vale(p.spc[2]),vale(p.spc[3]));
312387 if par='length' then p.ex_length:=vale(p.spc[1]);
313388 if par='width' then p.ex_width:=vale(p.spc[1]);
@@ -426,6 +501,7 @@
426501 //############################################################################//
427502 procedure start_section(p:pparse_info_rec;var sec:string);
428503 var s:string;
504+i:integer;
429505 begin
430506 s:=trim(p.one_str);
431507 s:=copy(s,2,length(s)-2);
@@ -446,7 +522,9 @@
446522
447523 p.visible:=0;p.mfd_l:=-1;p.mfd_r:=-1;p.hud:=-1;
448524 p.hud_siz:=0;
449- p.hud_center:=tvec(0,0,0);p.off:=tvec(0,0,0);p.dir:=tvec(0,0,0);
525+ p.hud_center:=tvec(0,0,0);
526+ for i:=0 to length(p.off)-1 do p.off[i]:=zvec;
527+ p.dir:=tvec(0,0,0);
450528 p.fuel_mass:=0;p.isp:=0;p.main_thrust:=0;p.retro_thrust:=0;p.hover_thrust:=0;p.att_thrust:=0;p.ex_width:=0;p.ex_length:=0;
451529 p.anim_seq_key:='';
452530 p.anim_seq_duration:=0;p.anim_seq_init_pos:=0;
@@ -491,6 +569,7 @@
491569 for j:=0 to cs-1 do begin
492570 c:=p.one_str[j];
493571 if(c='=')or(c=',')or(c=')')then begin
572+ if c='=' then p.remains:=copy(trim(p.one_str),j+2,1000);
494573 if not l then begin p.spc[k][p.spcs[k]]:=#0;k:=k+1;end;
495574 l:=true;
496575 continue;
diff -r 6364245a8055 -r 1735f6a35598 Orbitersdk/samples/xves/os_var.pas
--- a/Orbitersdk/samples/xves/os_var.pas Thu Mar 07 16:09:59 2013 +0100
+++ b/Orbitersdk/samples/xves/os_var.pas Thu Mar 07 16:56:24 2013 +0100
@@ -127,7 +127,7 @@
127127 aoshdll_animcompinfo=array[0..maxint div 100]of oshdll_animcompinfo;
128128 paoshdll_animcompinfo=^aoshdll_animcompinfo;
129129 oshdll_animinfo=packed record
130- id,tp,rept,trigkey:dword;
130+ id,tp,rept,pause,trigkey:dword;
131131 status:integer;
132132 spd,proc,init:double;
133133 grpcnt,compcnt:integer;
@@ -206,7 +206,7 @@
206206 paoshdll_payinfo=^aoshdll_payinfo;
207207
208208 oshdll_crewinfo=packed record
209- air_pos,eva_rot,air_siz:vec;
209+ air_pos,air_siz,eva_pos,eva_rot:vec;
210210 maxcrew:integer;
211211 end;
212212 aoshdll_crewinfo=array[0..10000]of oshdll_crewinfo;
Afficher sur ancien navigateur de dépôt.