Nikolay

Results 14 comments of Nikolay

Source code is added in mentioned topic.

Yes, _al_load_voc_pf() (to be correct) in Allegro4. It is loads only 1st block of VOC file (only first 2 of total 12 seconds). The _al_load_voc_f() from original Allegro5 do the...

enum is supported by C, but not a bool type. I done it! Just need to test if it is works.

[patch.zip](https://github.com/msikma/allegro-4.2.2-xc/files/8900783/patch.zip) You need **Allegro4.C\allegro4_patch.c** file. You can compare it with my CPP version **Tested Allegro4 C++ with UFILE\al_voc.cpp** and original Allegro 5 file.

And useful function: ``` inline float get_sample_instance_time(const struct SAMPLE *spl) { if (!spl) return 0.0; return (float)(spl->len) / (float)spl->freq; } ```

I have no Allegro 4.2.2 source code, and no experience with git-specific actions (what is the PR-?). 1. You need to find, in which *.c file function **load_voc_pf()** with body...

And the last, this file (https://disk.yandex.ru/d/9TUjxRu5Ovjpzw) loads incorrectly (only 1st block)

I am not very strong in programming (in git-specific things I almost zero), so I can only advise. To fix bug with memory leak just remove allocation from _al_load_voc_f() body:...

With this line: ``` buffer = al_realloc(buffer, sizeof(buffer) + bytestoread); ``` It is incorrect - **sizeof(buffer)** - as **buffer** is not fixed-size (stack) variable (looks like copy-paste from elsewhere), so...

About 3d error (see my VOC example link in previous message), I found this specification: https://fabiensanglard.net/reverse_engineering_strike_commander/docs/Creative%20Voice%20(VOC)%20file%20format.txt As I understand, voc can consist of multiple blocks of sound (but not only)...