Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit1c3399c

Browse files
committed
Fix others GetResourceInfo
1 parent50dd81d commit1c3399c

File tree

1 file changed

+29
-4
lines changed

1 file changed

+29
-4
lines changed

‎bindings/storage/Resources.cpp‎

Lines changed: 29 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,17 +58,42 @@ py::class_<BResources>(m, "BResources")
5858
constchar * nameFound;
5959
size_t lengthFound;
6060
bool result = self.GetResourceInfo(byIndex, &typeFound, &idFound, &nameFound, &lengthFound);
61-
62-
// Utilizza py::bytes per rappresentare la sequenza di byte
61+
6362
py::bytesbyteSequence(nameFound, lengthFound);
6463

6564
returnpy::make_tuple(result,static_cast<int>(typeFound), idFound, byteSequence, lengthFound);
6665
},"",py::arg("byIndex"))
6766

6867
//.def("GetResourceInfo", py::overload_cast<type_code, int32, int32*, const char * *, size_t *>(&BResources::GetResourceInfo), "", py::arg("byType"), py::arg("andIndex"), py::arg("idFound"), py::arg("nameFound"), py::arg("lengthFound"))
68+
.def("GetResourceInfo", [](BResources& self, type_code byType, int32 andIndex){
69+
int32 idFound;
70+
constchar * nameFound;
71+
size_t lengthFound;
72+
bool result = self.GetResourceInfo(byType, andIndex, &idFound, &nameFound, &lengthFound);
73+
74+
py::bytesbyteSequence(nameFound, lengthFound);
75+
76+
returnpy::make_tuple(result, idFound, byteSequence, lengthFound);
77+
},"",py::arg("byType"),py::arg("andIndex"))
6978
//.def("GetResourceInfo", py::overload_cast<type_code, int32, const char * *, size_t *>(&BResources::GetResourceInfo), "", py::arg("byType"), py::arg("andID"), py::arg("nameFound"), py::arg("lengthFound"))
70-
.def("GetResourceInfo", py::overload_cast<type_code,constchar *, int32*,size_t *>(&BResources::GetResourceInfo),"",py::arg("byType"),py::arg("andName"),py::arg("idFound"),py::arg("lengthFound"))
71-
//.def("GetResourceInfo", py::overload_cast<const void *, type_code *, int32*, size_t *, const char * *>(&BResources::GetResourceInfo), "", py::arg("byPointer"), py::arg("typeFound"), py::arg("idFound"), py::arg("lengthFound"), py::arg("nameFound"))
79+
.def("GetResourceInfo", [](BResources& self, type_code byType, int32 andID){
80+
constchar * nameFound;
81+
size_t lengthFound;
82+
bool result = self.GetResourceInfo(byType, andID, &nameFound, &lengthFound);
83+
84+
py::bytesbyteSequence(nameFound, lengthFound);
85+
86+
returnpy::make_tuple(result, byteSequence, lengthFound);
87+
},"",py::arg("byType"),py::arg("andID"))
88+
//.def("GetResourceInfo", py::overload_cast<type_code, const char *, int32*, size_t *>(&BResources::GetResourceInfo), "", py::arg("byType"), py::arg("andName"), py::arg("idFound"), py::arg("lengthFound"))// <- TODO!!
89+
.def("GetResourceInfo", [](BResources& self, type_code byType,constchar* andName){
90+
int32 idFound;
91+
size_t lengthFound;
92+
bool result = self.GetResourceInfo(byType, andName, &idFound, &lengthFound);
93+
94+
returnpy::make_tuple(result, idFound, lengthFound);
95+
},"",py::arg("byType"),py::arg("andID"))
96+
//.def("GetResourceInfo", py::overload_cast<const void *, type_code *, int32*, size_t *, const char * *>(&BResources::GetResourceInfo), "", py::arg("byPointer"), py::arg("typeFound"), py::arg("idFound"), py::arg("lengthFound"), py::arg("nameFound")) //<- There's no pointer in Python
7297
.def("RemoveResource", py::overload_cast<constvoid *>(&BResources::RemoveResource),"",py::arg("resource"))
7398
.def("RemoveResource", py::overload_cast<type_code, int32>(&BResources::RemoveResource),"",py::arg("type"),py::arg("id"))
7499
.def("WriteResource", &BResources::WriteResource,"",py::arg("type"),py::arg("id"),py::arg("data"),py::arg("offset"),py::arg("length"))

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp