diff --git a/project/jni/application/ballfield/ballfield.cpp b/project/jni/application/ballfield/ballfield.cpp index b60836aac..fc867723a 100644 --- a/project/jni/application/ballfield/ballfield.cpp +++ b/project/jni/application/ballfield/ballfield.cpp @@ -54,7 +54,7 @@ SDL_Surface *clean_alpha(SDL_Surface *s) } SDL_LockSurface(work); - pixels = work->pixels; + pixels = (Uint32 *)work->pixels; pp = work->pitch / sizeof(Uint32); for(y = 0; y < work->h; ++y) for(x = 0; x < work->w; ++x) @@ -179,7 +179,7 @@ void print_num(SDL_Surface *dst, SDL_Surface *font, int x, int y, float value) ballfield_t *ballfield_init(void) { int i; - ballfield_t *bf = calloc(sizeof(ballfield_t), 1); + ballfield_t *bf = (ballfield_t *)calloc(sizeof(ballfield_t), 1); if(!bf) return NULL; for(i = 0; i < BALLS; ++i) @@ -210,7 +210,7 @@ static int ballfield_init_frames(ballfield_t *bf) /* * Set up source rects for all frames */ - bf->frames = calloc(sizeof(SDL_Rect), bf->gfx[0]->w); + bf->frames = (SDL_Rect *)calloc(sizeof(SDL_Rect), bf->gfx[0]->w); if(!bf->frames) { fprintf(stderr, "No memory for frame rects!\n"); diff --git a/project/jni/application/ballfield/test.cpp b/project/jni/application/ballfield/test.cpp new file mode 100644 index 000000000..accdef05a --- /dev/null +++ b/project/jni/application/ballfield/test.cpp @@ -0,0 +1,18 @@ +#include +#include "test.h" + +int test::initCount = 0; +int test::initCount2 = 12345; + +test::test() +{ + initCount++; + __android_log_print(ANDROID_LOG_INFO, "==TEST==", "test::test(): initCount %d initCount2 %d", initCount, initCount2); +} + +test::~test() +{ + initCount--; + __android_log_print(ANDROID_LOG_INFO, "==TEST==", "test::~test(): initCount %d initCount2 %d", initCount, initCount2); +} + diff --git a/project/jni/application/ballfield/test.h b/project/jni/application/ballfield/test.h new file mode 100644 index 000000000..8bb51f646 --- /dev/null +++ b/project/jni/application/ballfield/test.h @@ -0,0 +1,15 @@ +#include +#include + +class test +{ + public: + test(); + ~test(); + + public: + static int initCount; + static int initCount2; +}; + + diff --git a/project/jni/application/ballfield/test2.cpp b/project/jni/application/ballfield/test2.cpp new file mode 100644 index 000000000..1ee3e8fba --- /dev/null +++ b/project/jni/application/ballfield/test2.cpp @@ -0,0 +1,7 @@ +#include +#include "test.h" + + +test t; + + diff --git a/project/jni/application/src b/project/jni/application/src index 59d41f41e..104f796a6 120000 --- a/project/jni/application/src +++ b/project/jni/application/src @@ -1 +1 @@ -fheroes2 \ No newline at end of file +ballfield \ No newline at end of file