mirror of
https://github.com/ClassiCube/ClassiCube.git
synced 2025-09-08 06:47:23 -04:00
Fix not compiling with android studio, see #864 (Thanks codingwatching)
This commit is contained in:
parent
2b32ea1812
commit
b5bbd35727
@ -48,7 +48,7 @@ add_library(classicube SHARED
|
||||
../../src/Protocol.c
|
||||
../../src/World.c
|
||||
../../src/PickedPosRenderer.c
|
||||
../../src/Platform.c
|
||||
../../src/Platform_Posix.c
|
||||
../../src/LScreens.c
|
||||
../../src/_truetype.c
|
||||
../../src/_ftglyph.c
|
||||
@ -96,6 +96,7 @@ add_library(classicube SHARED
|
||||
../../src/SelectionBox.c
|
||||
../../src/EnvRenderer.c
|
||||
../../src/Animations.c
|
||||
../../src/LBackend.c
|
||||
)
|
||||
|
||||
# add lib dependencies
|
||||
|
@ -10,38 +10,6 @@
|
||||
#include "Server.h"
|
||||
#include "Options.h"
|
||||
|
||||
/*#define CC_TEST_VORBIS*/
|
||||
#ifdef CC_TEST_VORBIS
|
||||
#include "ExtMath.h"
|
||||
#include "Vorbis.h"
|
||||
|
||||
#define VORBIS_N 1024
|
||||
#define VORBIS_N2 (VORBIS_N / 2)
|
||||
int main_imdct() {
|
||||
float in[VORBIS_N2], out[VORBIS_N], out2[VORBIS_N];
|
||||
double delta[VORBIS_N];
|
||||
|
||||
RngState rng;
|
||||
Random_Seed(&rng, 2342334);
|
||||
struct imdct_state imdct;
|
||||
imdct_init(&imdct, VORBIS_N);
|
||||
|
||||
for (int ii = 0; ii < VORBIS_N2; ii++) {
|
||||
in[ii] = Random_Float(&rng);
|
||||
}
|
||||
|
||||
imdct_slow(in, out, VORBIS_N2);
|
||||
imdct_calc(in, out2, &imdct);
|
||||
|
||||
double sum = 0;
|
||||
for (int ii = 0; ii < VORBIS_N; ii++) {
|
||||
delta[ii] = out2[ii] - out[ii];
|
||||
sum += delta[ii];
|
||||
}
|
||||
int fff = 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
static void RunGame(void) {
|
||||
cc_string title; char titleBuffer[STRING_SIZE];
|
||||
int width = Options_GetInt(OPT_WINDOW_WIDTH, 0, DisplayInfo.Width, 0);
|
||||
@ -150,9 +118,6 @@ int main(int argc, char** argv) {
|
||||
|
||||
res = Platform_SetDefaultCurrentDirectory(argc, argv);
|
||||
if (res) Logger_SysWarn(res, "setting current directory");
|
||||
#ifdef CC_TEST_VORBIS
|
||||
main_imdct();
|
||||
#endif
|
||||
Platform_LogConst("Starting " GAME_APP_NAME " ..");
|
||||
String_InitArray(Server.Address, ipBuffer);
|
||||
Options_Load();
|
||||
|
13
src/Vorbis.c
13
src/Vorbis.c
@ -973,19 +973,6 @@ static cc_result Mapping_DecodeSetup(struct VorbisState* ctx, struct Mapping* m)
|
||||
*------------------------------------------------------imdct impl---------------------------------------------------------*
|
||||
*#########################################################################################################################*/
|
||||
#define PI MATH_PI
|
||||
void imdct_slow(float* in, float* out, int N) {
|
||||
double sum;
|
||||
int i, k;
|
||||
|
||||
for (i = 0; i < 2 * N; i++) {
|
||||
sum = 0;
|
||||
for (k = 0; k < N; k++) {
|
||||
sum += in[k] * Math_Cos((PI / N) * (i + 0.5 + N * 0.5) * (k + 0.5));
|
||||
}
|
||||
out[i] = sum;
|
||||
}
|
||||
}
|
||||
|
||||
static cc_uint32 Vorbis_ReverseBits(cc_uint32 v) {
|
||||
v = ((v >> 1) & 0x55555555) | ((v & 0x55555555) << 1);
|
||||
v = ((v >> 2) & 0x33333333) | ((v & 0x33333333) << 2);
|
||||
|
Loading…
x
Reference in New Issue
Block a user