diff options
Diffstat (limited to 'textscreen')
-rw-r--r-- | textscreen/Makefile.am | 2 | ||||
-rw-r--r-- | textscreen/examples/Makefile.am | 2 | ||||
-rw-r--r-- | textscreen/txt_sdl.c | 14 |
3 files changed, 11 insertions, 7 deletions
diff --git a/textscreen/Makefile.am b/textscreen/Makefile.am index b8904520..51b3af13 100644 --- a/textscreen/Makefile.am +++ b/textscreen/Makefile.am @@ -1,5 +1,5 @@ -AM_CFLAGS = -I../src +AM_CFLAGS = -I$(top_builddir)/src CTAGS_ARGS=-I TXT_UNCAST_ARG+ diff --git a/textscreen/examples/Makefile.am b/textscreen/examples/Makefile.am index e314e7e8..efd17072 100644 --- a/textscreen/examples/Makefile.am +++ b/textscreen/examples/Makefile.am @@ -1,5 +1,5 @@ -AM_CFLAGS = -I.. -I../../src +AM_CFLAGS = -I.. -I$(top_builddir)/src noinst_PROGRAMS=guitest calculator diff --git a/textscreen/txt_sdl.c b/textscreen/txt_sdl.c index 0df9fc93..71736720 100644 --- a/textscreen/txt_sdl.c +++ b/textscreen/txt_sdl.c @@ -169,15 +169,19 @@ static void ChooseFont(void) int TXT_Init(void) { + int flags; + if (SDL_InitSubSystem(SDL_INIT_VIDEO) < 0) { return 0; } + flags = SDL_SWSURFACE | SDL_HWPALETTE | SDL_DOUBLEBUF; + ChooseFont(); screen = SDL_SetVideoMode(TXT_SCREEN_W * font->w, - TXT_SCREEN_H * font->h, 8, 0); + TXT_SCREEN_H * font->h, 8, flags); if (screen == NULL) return 0; @@ -285,10 +289,10 @@ void TXT_UpdateScreenArea(int x, int y, int w, int h) int x_end; int y_end; - x_end = LimitToRange(x + w, 0, TXT_SCREEN_W); - y_end = LimitToRange(y + h, 0, TXT_SCREEN_H); - x = LimitToRange(x, 0, TXT_SCREEN_W); - y = LimitToRange(y, 0, TXT_SCREEN_H); + x_end = LimitToRange(x + w, 0, TXT_SCREEN_W - 1); + y_end = LimitToRange(y + h, 0, TXT_SCREEN_H - 1); + x = LimitToRange(x, 0, TXT_SCREEN_W - 1); + y = LimitToRange(y, 0, TXT_SCREEN_H - 1); for (y1=y; y1<y_end; ++y1) { |