Sound font reader TSf

This commit is contained in:
2022-07-05 20:24:12 +00:00
parent 9f2419a0bc
commit f979ef6a14
4 changed files with 2457 additions and 0 deletions

21
source/engine/util.c Normal file
View File

@@ -0,0 +1,21 @@
#include "util.h"
unsigned int powof2(unsigned int num)
{
if (num != 0) {
num--;
num |= (num >> 1);
num |= (num >> 2);
num |= (num >> 4);
num |= (num >> 8);
num |= (num >> 16);
num++;
}
return num;
}
int ispow2(int num)
{
return (num && !(num & (num - 1)));
}