fix: fix BMap export function implementation bug
This commit is contained in:
5
Assets/BMapBindings/BMapSharp/.gitignore
vendored
5
Assets/BMapBindings/BMapSharp/.gitignore
vendored
@@ -1,3 +1,8 @@
|
||||
## ======== Personal ========
|
||||
# Remove I set environment variables for personal testing.
|
||||
launchSettings.json
|
||||
|
||||
## ======== Visual Studio ========
|
||||
## Ignore Visual Studio temporary files, build results, and
|
||||
## files generated by popular Visual Studio add-ons.
|
||||
##
|
||||
|
||||
@@ -10,16 +10,16 @@ namespace BMapSharpTest.TestSuits {
|
||||
public static void Test(BMFileReader reader) {
|
||||
Console.WriteLine("===== Groups =====");
|
||||
TestGroup(reader);
|
||||
//Console.WriteLine("===== 3dObjects =====");
|
||||
//Test3dObject(reader);
|
||||
//Console.WriteLine("===== Meshes =====");
|
||||
//TestMesh(reader);
|
||||
//Console.WriteLine("===== Materials =====");
|
||||
//TestMaterial(reader);
|
||||
//Console.WriteLine("===== Textures =====");
|
||||
//TestTexture(reader);
|
||||
//Console.WriteLine("===== Target Lights =====");
|
||||
//TestTargetLight(reader);
|
||||
Console.WriteLine("===== 3dObjects =====");
|
||||
Test3dObject(reader);
|
||||
Console.WriteLine("===== Meshes =====");
|
||||
TestMesh(reader);
|
||||
Console.WriteLine("===== Materials =====");
|
||||
TestMaterial(reader);
|
||||
Console.WriteLine("===== Textures =====");
|
||||
TestTexture(reader);
|
||||
Console.WriteLine("===== Target Lights =====");
|
||||
TestTargetLight(reader);
|
||||
Console.WriteLine("===== Target Cameras =====");
|
||||
TestTargetCamera(reader);
|
||||
Console.WriteLine("===== END =====");
|
||||
@@ -134,7 +134,7 @@ namespace BMapSharpTest.TestSuits {
|
||||
Console.WriteLine($"Fov: {cam.GetFov()}");
|
||||
|
||||
cam.GetAspectRatio(out var width, out var height);
|
||||
Console.WriteLine($"Aspect Ratio: {width} x {height}");
|
||||
Console.WriteLine($"Aspect Ratio: {width}:{height}");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1107,7 +1107,7 @@ bool BMCamera_SetFrontPlane(BMPARAM_OBJECT_DECL(bmfile, objid), BMPARAM_IN(LibCm
|
||||
bool BMCamera_GetBackPlane(BMPARAM_OBJECT_DECL(bmfile, objid), BMPARAM_OUT(LibCmo::CKFLOAT, out_val)) {
|
||||
auto obj = CheckCKCamera(bmfile, objid);
|
||||
if (obj == nullptr) return false;
|
||||
BMPARAM_OUT_ASSIGN(out_val, obj->GetFrontPlane());
|
||||
BMPARAM_OUT_ASSIGN(out_val, obj->GetBackPlane());
|
||||
return true;
|
||||
}
|
||||
bool BMCamera_SetBackPlane(BMPARAM_OBJECT_DECL(bmfile, objid), BMPARAM_IN(LibCmo::CKFLOAT, val)) {
|
||||
@@ -1119,7 +1119,7 @@ bool BMCamera_SetBackPlane(BMPARAM_OBJECT_DECL(bmfile, objid), BMPARAM_IN(LibCmo
|
||||
bool BMCamera_GetFov(BMPARAM_OBJECT_DECL(bmfile, objid), BMPARAM_OUT(LibCmo::CKFLOAT, out_val)) {
|
||||
auto obj = CheckCKCamera(bmfile, objid);
|
||||
if (obj == nullptr) return false;
|
||||
BMPARAM_OUT_ASSIGN(out_val, obj->GetFrontPlane());
|
||||
BMPARAM_OUT_ASSIGN(out_val, obj->GetFov());
|
||||
return true;
|
||||
}
|
||||
bool BMCamera_SetFov(BMPARAM_OBJECT_DECL(bmfile, objid), BMPARAM_IN(LibCmo::CKFLOAT, val)) {
|
||||
|
||||
@@ -178,13 +178,15 @@ namespace BMap {
|
||||
// BMFile only provide limited type visiting, we must make sure it provided ID also is existed in out stored list.
|
||||
// so we check its type here. if type is not matched, we reset it to nullptr.
|
||||
if (obj != nullptr) {
|
||||
using LibCmo::CK2::CK_CLASSID;
|
||||
switch (obj->GetClassID()) {
|
||||
case LibCmo::CK2::CK_CLASSID::CKCID_GROUP:
|
||||
case LibCmo::CK2::CK_CLASSID::CKCID_3DOBJECT:
|
||||
case LibCmo::CK2::CK_CLASSID::CKCID_MESH:
|
||||
case LibCmo::CK2::CK_CLASSID::CKCID_MATERIAL:
|
||||
case LibCmo::CK2::CK_CLASSID::CKCID_TEXTURE:
|
||||
case LibCmo::CK2::CK_CLASSID::CKCID_TARGETLIGHT:
|
||||
case CK_CLASSID::CKCID_GROUP:
|
||||
case CK_CLASSID::CKCID_3DOBJECT:
|
||||
case CK_CLASSID::CKCID_MESH:
|
||||
case CK_CLASSID::CKCID_MATERIAL:
|
||||
case CK_CLASSID::CKCID_TEXTURE:
|
||||
case CK_CLASSID::CKCID_TARGETLIGHT:
|
||||
case CK_CLASSID::CKCID_TARGETCAMERA:
|
||||
break; // okey. do nothing
|
||||
default:
|
||||
// this object should not be exposed to outside, reset it to nullptr
|
||||
|
||||
Reference in New Issue
Block a user