X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Finit.c;h=3a0c54ed7bfcc69500e138dba69ba5046b8a1fed;hb=222cd4187e6632bd904a937f167a2f1c70b8f66d;hp=d48e713c51b629d2e2c7a4acb617728d7313cbac;hpb=da14f69fd95c7bd5a0d70cdf4935af06f1f20a04;p=rocksndiamonds.git diff --git a/src/init.c b/src/init.c index d48e713c..3a0c54ed 100644 --- a/src/init.c +++ b/src/init.c @@ -38,6 +38,7 @@ static void InitLevelInfo(void); static void InitNetworkServer(void); static void InitSound(void); static void InitSoundServer(void); +static void InitDisplay(void); static void InitGfx(void); static void InitGfxBackground(void); static void LoadGfx(int, struct PictureFileInfo *); @@ -73,7 +74,7 @@ void OpenAll(int argc, char *argv[]) signal(SIGINT, CloseAllAndExit); signal(SIGTERM, CloseAllAndExit); - InitBufferedDisplay(&backbuffer, &window); + InitDisplay(); InitEventFilter(FilterMouseMotionEvents); InitGfx(); @@ -307,6 +308,26 @@ void InitJoysticks() #endif /* !TARGET_SDL */ } +void InitDisplay() +{ + char *gfx_dir = getPath2(options.ro_base_directory, GRAPHICS_DIRECTORY); + char *x11_icon_filename = getPath2(gfx_dir, X11_ICON_FILENAME); + char *x11_iconmask_filename = getPath2(gfx_dir, X11_ICONMASK_FILENAME); + char *msdos_pointer_filename = getPath2(gfx_dir, MSDOS_POINTER_FILENAME); + + free(gfx_dir); + + InitProgramInfo(program_name, PROGRAM_TITLE_STRING, WINDOW_TITLE_STRING, + ICON_TITLE_STRING, x11_icon_filename, x11_iconmask_filename, + msdos_pointer_filename); + + InitScrollbufferSize(FXSIZE, FYSIZE); /* (only needed for MS-DOS code) */ + + InitVideoDisplay(); + InitVideoBuffer(&backbuffer, &window, WIN_XSIZE, WIN_YSIZE, DEFAULT_DEPTH, + setup.fullscreen); +} + void InitGfx() { int i, j; @@ -515,7 +536,7 @@ void InitGfxBackground() { int x, y; - drawto = backbuffer = pix[PIX_DB_BACK]; + drawto = backbuffer; fieldbuffer = pix[PIX_DB_FIELD]; SetDrawtoField(DRAW_BACKBUFFER);