21.05.2011, 08:26
(
Последний раз редактировалось 0x5A656578; 21.05.2011 в 09:19.
)
I believe this is possible but as ****** mentioned the one-at-a-time method may be better for your purpose as you don't know how many files there are in the specified directory in advance.
Anyway, there's a section in their Implementer's Guide document and here's what it states about the subject at page 61:
Anyway, there's a section in their Implementer's Guide document and here's what it states about the subject at page 61:
Quote:
Multi-dimensional arrays must be handled differently, though, as the memory lay-out differs between C/C++ and pawn. In comparison with C/C++, two- dimensional arrays in pawn are prefixed with a single-dimensional array that holds memory offsets to the start of each “row” in the two-dimensional array. This extra list allows each row to have a different column length. In C/C++, each column in a two-dimensional array must have the same size. If you are writing a wrapper function for an existing C function, as opposed to writing/adapting a native function specifically to exploit pawn’s features, you will not be concerned with variable column-length arrays —C/C++ does not support them, so your native function will not allow them. All that needs to be done, then, is to skip the prefixed “column offsets” list after getting the address from amx_GetAddr. For an example, I use the OpenGL function glMultMatrixf which multiplies a given 4 Ч 4 matrix with the current matrix. The prototype of the function is: Код:
void glMultMatrixf(const GLfloat *m); four cells to them. Код:
static cell n_glMultMatrixf(AMX *amx, const cell *params) { cell *cptr; assert(sizeof(cell) == sizeof(time_t)); amx_GetAddr(amx, params[1], &cptr); glMultMatrixf( (GLfloat*)(cptr + 4) ); return 0; } |