changeset 353:83e4af7835ce

Work towards editor.
author Matti Hamalainen <ccr@tnsp.org>
date Tue, 16 Oct 2012 01:33:26 +0300
parents 5eafdc396fa4
children ba284f5e7ea5
files Makefile.gen dmeditor.c
diffstat 2 files changed, 21 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/Makefile.gen	Tue Oct 16 01:24:00 2012 +0300
+++ b/Makefile.gen	Tue Oct 16 01:33:26 2012 +0300
@@ -371,7 +371,7 @@
 	@$(CC) $(CFLAGS) -c -o $@ $< $(DM_CFLAGS) $(GTK_CFLAGS)
 
 
-$(BINPATH)ed_$(DEMO_BIN)$(EXEEXT): $(OBJPATH)$(DEMO_BIN).o $(addprefix $(OBJPATH),$(EDITOR_OBJS)) $(addprefix $(OBJPATH),$(DEMO_OBJS)) $(DMLIB_A)
+$(BINPATH)ed_$(DEMO_BIN)$(EXEEXT): $(OBJPATH)$(DEMO_BIN).o $(addprefix $(OBJPATH),$(EDITOR_OBJS)) $(addprefix $(OBJPATH),$(filter-out dmsimple.o,$(DEMO_OBJS))) $(DMLIB_A)
 	@echo " LINK $+"
 	@$(CC) -o $@ $(filter %.o %.a,$+) $(DM_LDFLAGS) $(SDL_LDFLAGS) $(GTK_LDFLAGS)
 
--- a/dmeditor.c	Tue Oct 16 01:24:00 2012 +0300
+++ b/dmeditor.c	Tue Oct 16 01:33:26 2012 +0300
@@ -81,8 +81,10 @@
 */
         }
     }
+    return DMERR_OK;
 }
 
+
 int engineReloadResources()
 {
     int err;
@@ -99,6 +101,16 @@
 
 BOOL engineInitializeVideo()
 {
+    dmPrint(1, "Initializing SDL video %d x %d x %dbpp, flags=0x%08x\n",
+        engine.optScrWidth, engine.optScrHeight, engine.optBitDepth, engine.optVFlags);
+
+    engine.screen = SDL_CreateRGBSurface(SDL_SWSURFACE, engine.optScrWidth, engine.optScrHeight, engine.optBitDepth, 0, 0, 0, 0);
+    if (engine.screen == NULL)
+    {
+        dmError("Could not allocate video backbuffer surface.\n");
+        return FALSE;
+    }
+    
     return TRUE;
 }
 
@@ -110,6 +122,7 @@
 
     memset(&frame, 0, sizeof(frame));
     memset(&engine, 0, sizeof(engine));
+    dmVerbosity = 5;
 
     // Pre-initialization
     if ((err = demoPreInit()) != DMERR_OK)
@@ -217,12 +230,18 @@
         goto error_exit;
     }
 
+    dmPrint(1, "Initializing effects, etc.\n");
+
     // Final initializations
     if ((err = engine.demoInit()) != DMERR_OK)
+    {
+        dmError("Failure in demoInit(), %d: %s\n",
+            err, dmErrorStr(err));
         goto error_exit;
-
+    }
 
     // Initialize GUI
+    dmPrint(1, "Initializing Gtk+ editor GUI.\n");
     GtkWidget *window;
     GtkWidget *timeline;
     GtkWidget *fixed;