Skip to content

Commit f995676

Browse files
author
WinterPu
committed
bugfix: tmp solution for inheritance problem && return type array size && FVector type conversion
1 parent 3b3e71a commit f995676

File tree

6 files changed

+55
-15
lines changed

6 files changed

+55
-15
lines changed

cppfiles_not-terra-gened/UtilityUABTTypeHelper.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ namespace agora {
182182
}
183183

184184

185-
static inline FVector FromFloatArray(float* farray) {
185+
static inline FVector FromFloatArray(const float* farray) {
186186
if(farray == nullptr){
187187
return FVector::ZeroVector;
188188
}
@@ -406,7 +406,7 @@ namespace agora {
406406

407407

408408

409-
static inline void SetFloatArray (float* & farray, const FVector & vec)
409+
static inline void SetFloatArray (float farray[3], const FVector & vec)
410410
{
411411
farray[0] = vec.X;
412412
farray[1] = vec.Y;

docs/src/BlueprintGeneration/BPGen-TypeConversion.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,13 @@
1515

1616

1717
## 数组 - TArray 的问题
18+
19+
20+
## 怎么解决继承问题 IAudioFrameObserver 继承自 IAudioFrameObserverBase
21+
但是node 只有 新增的method
22+
23+
24+
## 怎么解决:Custom Header 带来的函数不匹配的问题
25+
其他的框架是:
26+
手写的 extends 生成的
27+
会有手写的method override 生成的method

parsers/config/blueprint/remove_node_list.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,4 +173,11 @@ module.exports = [
173173
// no default constructor: so currently FUABT_ generation failed
174174
'agora::rtc::MixedAudioFrame',
175175
'agora::rtc::IRtcEngine.setMixedAudioFrameParameters',
176+
177+
// TBD(WinterPu)
178+
// for inheritance problem:
179+
// cannot inherit from the abstract class
180+
// IAudioFrameObserver : public IAudioFrameObserverBase
181+
'agora::media::IAudioFrameObserver',
182+
'agora::rtc::IMediaPlayerSourceObserver',
176183
];

renders/utility/blueprint_special/bp_helper.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -519,14 +519,18 @@ function genContext_BPMethodReturnVal(
519519
const convWayType = bpType.bpConv_BPFromCpp.convFuncType;
520520

521521
// [Part - Decl]
522+
// TBD(WinterPu)
523+
// for some return val: Ex. EnumerateVideoDevices
524+
// TArray<FUABT_VideoDeviceInfo> ReturnVal; UABT::SetBPDataArray<agora::rtc::ext::VideoDeviceInfo, FUABT_VideoDeviceInfo>(ReturnVal, ret, );
525+
// for now, we set 1 as the default size count
522526
const str_decl = genContextBasedOnConversionWayType(
523527
EBPContextGenType.DeclType_Decl,
524528
undefined,
525529
bpType,
526530
convWayType,
527531
false,
528-
'',
529-
'',
532+
'1',
533+
'1',
530534
AGORA_MUSTACHE_DATA.RETURN_VAL,
531535
AGORA_MUSTACHE_DATA.RETURN_VAL_DECL
532536
);

renders/utility/blueprint_special/bptype_data_conv.ts

Lines changed: 28 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ export const map_decltype_special_rule = new Map<
208208
// free: none
209209
CppFromBP: {
210210
funcDecl: (decl_var, param) =>
211-
`float[3] ${decl_var}; UABT::SetFloatArray(${param}, ${decl_var});`,
211+
`float ${decl_var}[3]; UABT::SetFloatArray(${decl_var}, ${param});`,
212212

213213
funcUsage: (decl_var) => `${decl_var}`,
214214

@@ -476,6 +476,24 @@ const defaultTmpl_TrackID: UEBPTypeConvData = {
476476
},
477477
};
478478

479+
const defaultTmpl_FVector: UEBPTypeConvData = {
480+
...defaultTmpl_BasicType_NoConv,
481+
bpTypeName: 'FVector',
482+
defaultValue: 'FVector(0.0, 0.0, 0.0)',
483+
parseArrayIsInBlackList: true,
484+
convFromCpp: {
485+
convFuncType: ConversionWayType.BasicConvFunc,
486+
convFunc: 'UABT::FromFloatArray',
487+
convFuncAdditional01: '',
488+
},
489+
convToCpp: {
490+
convFuncType: ConversionWayType.SetArrayData,
491+
convFunc: 'UABT::SetFloatArray',
492+
convFuncAdditional01: '',
493+
},
494+
declTypeSPRule: DeclTypeSPRule.SP_FVector,
495+
};
496+
479497
// =============== Type 2 Type Conversion ===============
480498
// also use type source as key
481499
// but when the type is not on the map: we would use type.name to see if the base type is on the map
@@ -617,14 +635,6 @@ export const map_bptype_conv_data: { [type_source: string]: UEBPTypeConvData } =
617635
defaultValue: '0',
618636
},
619637

620-
// FVector Related
621-
'float const[3]': {
622-
...defaultTmpl_BasicType_NoConv,
623-
bpTypeName: 'FVector',
624-
defaultValue: 'FVector(0.0, 0.0, 0.0)',
625-
parseArrayIsInBlackList: true,
626-
},
627-
628638
// FString Related
629639
'const char*': {
630640
...defaultTmpl_FString_Const,
@@ -695,6 +705,15 @@ export const map_bptype_conv_data: { [type_source: string]: UEBPTypeConvData } =
695705
cppDesignedDeclType: 'char**',
696706
},
697707

708+
// FVector Related
709+
'float const[3]': {
710+
...defaultTmpl_FVector,
711+
},
712+
713+
'float[3]': {
714+
...defaultTmpl_FVector,
715+
},
716+
698717
// Array Related
699718

700719
'float*': {

renders/utility/blueprint_special/bptype_data_makeup.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,9 @@ export const map_class_initialization: {
6060
6161
}
6262
63-
InsAudioDeviceManager->PlaybackDeviceCollection = NewObject<UAudioDeviceCollection>();
63+
//InsAudioDeviceManager->PlaybackDeviceCollection = NewObject<UAudioDeviceCollection>();
6464
65-
InsAudioDeviceManager->RecordDeviceCollection = NewObject<UAudioDeviceCollection>();
65+
//InsAudioDeviceManager->RecordDeviceCollection = NewObject<UAudioDeviceCollection>();
6666
}
6767
return InsAudioDeviceManager;
6868
}

0 commit comments

Comments
 (0)