From 3192ca6ade37b571ee170d5793bfe3b44d1cff46 Mon Sep 17 00:00:00 2001 From: Rob Pearce Date: Thu, 25 Dec 2008 02:48:11 +0000 Subject: [PATCH] - Fixed crash in editor - Slight level modification based on new trampoline behaviour --- data/levels/level107.dat | 10 +++++----- edit.c | 9 +++++++++ 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/data/levels/level107.dat b/data/levels/level107.dat index 8abcee5..f13f2bc 100644 --- a/data/levels/level107.dat +++ b/data/levels/level107.dat @@ -45,7 +45,7 @@ monsters endmonsters exitdir 1 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4, -4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4, +4,19,0,0,0,0,0,0,0,0,0,0,18,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,19,0,0,0,0,0,18,4, 4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4, 4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4, 4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4, @@ -54,11 +54,11 @@ exitdir 1 4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4, 4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,41,0,0,0,0,0,0,0,0,41,0,0,0,0,41,0,0,0,0,41,0,0,0,4, 4,1,20,20,20,20,20,20,20,20,20,34,0,0,0,0,42,1,1,1,1,1,1,1,1,43,0,0,0,0,42,1,1,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,1,1,4,4,4,4,4,0,0,0,4,4,4,4,4,0,0,0,4,4,4,4,4,4,4,4,4,0,0,0,0,4, 4,4,4,4,4,4,4,4,4,4,4,4,4,4,43,0,0,0,42,4,4,4,43,0,0,0,42,4,4,4,4,4,4,4,43,0,0,0,0,4, -4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4, +4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,18,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4, 4,12,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4, 4,13,41,0,0,0,0,0,0,0,0,0,0,0,0,11,11,11,0,0,0,0,0,11,11,11,0,0,0,0,0,0,0,0,0,0,0,0,0,4, 4,41,4,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,70,4, diff --git a/edit.c b/edit.c index 7e53ed3..88e1427 100644 --- a/edit.c +++ b/edit.c @@ -154,6 +154,15 @@ int main (int argc, char **argv) { screen = SDL_SetVideoMode(EDITORW,EDITORH,16,SDL_SWSURFACE|SDL_DOUBLEBUF|SDL_ANYFORMAT|vidargs); #endif + // set drawpixel function based on what depth we ended up with + if (screen->format->BitsPerPixel == 32) { + drawpixel = drawpixel32; + printf("32 bit mode in use.\n"); + } else { + drawpixel = drawpixel16; + printf("16 bit mode in use.\n"); + } + // set title bar sprintf(progname, "Rat Catcher Level Editor v0.%d", REV); SDL_WM_SetCaption(progname, progname);