Skip to content

Commit 2b0e4c6

Browse files
committed
display messagebox, closes #3
1 parent 3da397a commit 2b0e4c6

File tree

2 files changed

+4
-41
lines changed

2 files changed

+4
-41
lines changed

rott/modexlib.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -123,8 +123,6 @@ void GraphicsMode( void ) {
123123
Error( "Could not initialize SDL!\nSDL: %s\n", SDL_GetError());
124124
}
125125

126-
SDL_SetRelativeMouseMode( true );
127-
128126
char windowTitle[32];
129127
snprintf( windowTitle, sizeof( windowTitle ), "hrotte %s (%s-%s)", GIT_COMMIT_COUNT, GIT_BRANCH, GIT_COMMIT_HASH );
130128

@@ -177,7 +175,7 @@ void GraphicsMode( void ) {
177175
Error( "Failed to create SDL texture!\nSDL: %s\n", SDL_GetError());
178176
}
179177

180-
SDL_SetWindowGrab( sdlWindow, true );
178+
SDL_SetRelativeMouseMode( true );
181179
}
182180

183181
/*

rott/rt_util.c

Lines changed: 3 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -284,55 +284,25 @@ void ClearBuffer( char * buf, int size ) {
284284
void Error( char * error, ... ) {
285285
char msgbuf[300];
286286
va_list argptr;
287-
char i;
288287
int size;
289288
char * sptr;
290-
char buf[30];
291-
int handle;
292-
int x, y;
293289
int level;
294290
static int inerror = 0;
295-
char filename[128];
296291

297292
inerror++;
298293
if ( inerror > 1 )
299294
abort();
300295

301296
SetTextMode();
302-
#ifdef DOS
303-
memcpy ((byte *)0xB8000, &ROTT_ERR, 160*7);
304-
#elif defined (ANSIESC)
305-
DisplayTextSplash (&ROTT_ERR, 7);
306-
#endif
307-
memset( msgbuf, 0, 300 );
308297

309-
#ifdef DOS
310-
px = ERRORVERSIONCOL-1;
311-
py = ERRORVERSIONROW;
312-
#if (SHAREWARE == 1)
313-
UL_printf ("S");
314-
#else
315-
UL_printf ("R");
316-
#endif
317-
318-
px = ERRORVERSIONCOL;
319-
py = ERRORVERSIONROW;
320-
#if (BETA == 1)
321-
UL_printf ("�");
322-
#else
323-
UL_printf (itoa(ROTTMAJORVERSION,&buf[0],10));
324-
#endif
325-
326-
// Skip the dot
327-
px++;
328-
329-
UL_printf (itoa(ROTTMINORVERSION,&buf[0],10));
330-
#endif
298+
memset( msgbuf, 0, sizeof( msgbuf ));
331299

332300
va_start ( argptr, error );
333301
vsprintf( &msgbuf[0], error, argptr );
334302
va_end ( argptr );
335303

304+
SDL_ShowSimpleMessageBox( SDL_MESSAGEBOX_ERROR, "Error", msgbuf, NULL);
305+
336306
scriptbuffer = &msgbuf[0];
337307
size = strlen( msgbuf );
338308

@@ -358,11 +328,6 @@ void Error( char * error, ... ) {
358328
GetToken( true );
359329
}
360330

361-
#ifdef ANSIESC
362-
for (i = 0; i < 8; i++)
363-
printf ("\n");
364-
#endif
365-
366331
if ( player != NULL) {
367332
printf( "Player X = %lx\n", ( long int ) player->x );
368333
printf( "Player Y = %lx\n", ( long int ) player->y );

0 commit comments

Comments
 (0)