FindAllFilesSize Looks in the current directory and returns the number of bytes of memory that will be needed for a buffer of filenames (see FindAllFiles()). pattern = wildcard pattern to match filecount = will be filled in with the number of files it finds
| 2288 | // pattern = wildcard pattern to match |
| 2289 | // filecount = will be filled in with the number of files it finds |
| 2290 | int FindAllFilesSize(const char *pattern, int *filecount) { |
| 2291 | if (!pattern) { |
| 2292 | *filecount = 0; |
| 2293 | return 0; |
| 2294 | } |
| 2295 | |
| 2296 | char filename[_MAX_PATH]; |
| 2297 | int size = 0; |
| 2298 | int count = 0; |
| 2299 | |
| 2300 | if (ddio_FindFileStart(pattern, filename)) { |
| 2301 | count++; |
| 2302 | size += strlen(filename) + 1; |
| 2303 | while (ddio_FindNextFile(filename)) { |
| 2304 | count++; |
| 2305 | size += strlen(filename) + 1; |
| 2306 | } |
| 2307 | ddio_FindFileClose(); |
| 2308 | } |
| 2309 | *filecount = count; |
| 2310 | return size; |
| 2311 | } |
| 2312 | |
| 2313 | // returns the optimal distance to place the camera |
| 2314 | float getdist(angle ang, float height) { |
no test coverage detected