gfx sdlgl verion slowly slowly..

master
steffen 13 years ago
parent e8570aced2
commit 4084e0475d

@ -127,6 +127,9 @@ help:
configandroid: clean configandroid: clean
cp -f Makefile.rules.android Makefile.rules cp -f Makefile.rules.android Makefile.rules
mkdir android/assets
cp -f data/*.ttf android/assets
cp -f data/*.png android/assets
for i in $(ANDROIDDIRS); do ln -s ../../$$i android/jni/ ; done for i in $(ANDROIDDIRS); do ln -s ../../$$i android/jni/ ; done
configwin: clean configwin: clean
@ -165,6 +168,7 @@ cleanall:
for i in $(WINCEDIRS); do make -C $$i clean; done for i in $(WINCEDIRS); do make -C $$i clean; done
for i in $(SDLGLDIRS); do make -C $$i clean; done for i in $(SDLGLDIRS); do make -C $$i clean; done
for i in $(ANDROIDDIRS); do rm -f android/jni/$$i; done for i in $(ANDROIDDIRS); do rm -f android/jni/$$i; done
rm -rf android/assets
cd android; make clean; cd .. cd android; make clean; cd ..
rm -rf sposmroute rm -rf sposmroute
rm -rf sposmroutegl rm -rf sposmroutegl

@ -54,7 +54,7 @@ void config_init () {
struct stat sb; struct stat sb;
strcpy (cfg.mappath, "map/"); strcpy (cfg.mappath, "map/");
strcpy (cfg.appdatapath, "android/assets"); strcpy (cfg.appdatapath, "data");
strcpy (cfg.cachepath, "cache/"); strcpy (cfg.cachepath, "cache/");
strcpy (cfg.configpath, ""); strcpy (cfg.configpath, "");
strcpy (cfg.logpath, "logs/"); strcpy (cfg.logpath, "logs/");
@ -66,6 +66,7 @@ void config_init () {
/* Android version will not need config and log path.. */ /* Android version will not need config and log path.. */
#if defined(ANDROID) #if defined(ANDROID)
strcpy (cfg.appdatapath, "android/assets");
if (engine.app->activity->internalDataPath == NULL) if (engine.app->activity->internalDataPath == NULL)
strncpy (cfg.configpath, "/data/data/de.gulpe.sposmroute/", LEN_FILENAME); strncpy (cfg.configpath, "/data/data/de.gulpe.sposmroute/", LEN_FILENAME);
else else

@ -156,7 +156,6 @@ void draw_gui () {
tmplinestyle.c = tmplinestyle.borderc = color[COLOR_white][3]; tmplinestyle.c = tmplinestyle.borderc = color[COLOR_white][3];
draw_line (NULL, mousepos.x-5, mousepos.y-5, mousepos.x+5, mousepos.y+5, tmplinestyle); draw_line (NULL, mousepos.x-5, mousepos.y-5, mousepos.x+5, mousepos.y+5, tmplinestyle);
draw_line (NULL, mousepos.x+5, mousepos.y-5, mousepos.x-5, mousepos.y+5, tmplinestyle); draw_line (NULL, mousepos.x+5, mousepos.y-5, mousepos.x-5, mousepos.y+5, tmplinestyle);
gfx_draw_text (NULL, mousepos.x, mousepos.y, "nur ein test.", &color[COLOR_yellow][2]);
/* /*
* draw selected position * draw selected position

@ -55,7 +55,7 @@ struct font* font_load(char *name) {
exit (1);; exit (1);;
} }
FT_Set_Pixel_Sizes(f->face, 0, 16); FT_Set_Pixel_Sizes(f->face, 0, 12);
d_printf ("font loaded (size:%d).", f->buffersize); d_printf ("font loaded (size:%d).", f->buffersize);
return f; return f;

@ -39,7 +39,7 @@
iPoint gfx_screensize = {0, 0}; iPoint gfx_screensize = {0, 0};
int gfx_last_alloc_img = 0; int gfx_last_alloc_img = 0;
int gfx_last_img_fbo = 0; int gfx_last_img_fbo = 0;
struct font *font = NULL;
void gfx_fbo_switch (struct image *img); void gfx_fbo_switch (struct image *img);
/*****************************************************************************/ /*****************************************************************************/
@ -64,6 +64,7 @@ void gfx_init (int width, int height) {
gfx_screensize.x = width; gfx_screensize.x = width;
gfx_screensize.y = height; gfx_screensize.y = height;
gfx_resize (width, height); gfx_resize (width, height);
font = font_load ("FreeSans.ttf");
}; };
@ -175,6 +176,8 @@ void gfx_draw_polygon (struct image *dimg, iPoint *p, int pcnt, struct line_styl
*/ */
void gfx_draw_text (struct image *dimg, int x, int y, char *text, struct color *c) { void gfx_draw_text (struct image *dimg, int x, int y, char *text, struct color *c) {
gfx_fbo_switch (dimg); gfx_fbo_switch (dimg);
glColor4f (c->c.r, c->c.g, c->c.b, 1.0f);
font_draw (font, text, x, y+12.0, 1.0, 1.0);
}; };

@ -61,7 +61,7 @@ void test_draw () {
} }
if (_tmpx > img->width-TEST_WIDTH) _tmpdx = -1; if (_tmpx > img->width-TEST_WIDTH) _tmpdx = -1;
if (_tmpx < 0) _tmpdx = 1; if (_tmpx < 0) _tmpdx = 1;
if (_delay % 20 == 0) _tmpx += _tmpdx; if (_delay % 1 == 0) _tmpx += _tmpdx;
if (_tmpy > img->height-TEST_WIDTH) _tmpdy = -1; if (_tmpy > img->height-TEST_WIDTH) _tmpdy = -1;
if (_tmpy < 0) _tmpdy = 1; if (_tmpy < 0) _tmpdy = 1;
@ -130,8 +130,8 @@ int msdl_eventloop () {
exit (2); exit (2);
} }
gfx_resize (event.resize.w, event.resize.h); gfx_resize (event.resize.w, event.resize.h);
// draw (); draw ();
test_draw (); // test_draw ();
} }
break; break;
case SDL_MOUSEMOTION: case SDL_MOUSEMOTION:
@ -139,9 +139,9 @@ int msdl_eventloop () {
gevent.mousepos.y = event.motion.y; gevent.mousepos.y = event.motion.y;
gevent.mousebtn = 0; gevent.mousebtn = 0;
gevent.event = EGUI_MOUSEMOVE; gevent.event = EGUI_MOUSEMOVE;
// gui_event (gevent); gui_event (gevent);
// draw_mousemove (event.motion.x, event.motion.y, -1); draw_mousemove (event.motion.x, event.motion.y, -1);
test_draw(); // test_draw();
break; break;
case SDL_MOUSEBUTTONDOWN: case SDL_MOUSEBUTTONDOWN:
@ -179,14 +179,15 @@ int main (int argc, char **argv) {
} }
app_init (argc, argv); app_init (argc, argv);
font_init ();
gfx_init (RESOLUTION_X, RESOLUTION_Y); gfx_init (RESOLUTION_X, RESOLUTION_Y);
test_draw (); // test_draw ();
// draw (); draw ();
while (app.status != APPSTATUS_quit) { while (app.status != APPSTATUS_quit) {
msdl_eventloop (); while (msdl_eventloop ());
test_draw (); // test_draw ();
// draw (); draw ();
} }
SDL_Quit (); SDL_Quit ();

Loading…
Cancel
Save