From 5fa8be9e4cd2567c5cc235c17d5c58d17484823b Mon Sep 17 00:00:00 2001 From: "Christian A. Weber" Date: Sat, 13 Jun 2020 16:59:45 +0000 Subject: add support to load a bob file when run from CLI or Workbench --- Bobi.c | 29 ++++++++++++++++++++++++++++- Bobi_rev.h | 12 ++++++------ 2 files changed, 34 insertions(+), 7 deletions(-) diff --git a/Bobi.c b/Bobi.c index a898c45..63732be 100644 --- a/Bobi.c +++ b/Bobi.c @@ -1,5 +1,5 @@ /* -** $Id$ +** Bobi - The Ultimate Amiga Bob Manipulator ** ** Bobi.c - Hautprogramm ** @@ -44,6 +44,7 @@ ** 02-Nov-93 CHW V3.0 Compiliert mit sc6, ASL-Filerequester ** 13-Jun-20 CHW V3.1 Kann beim Startup Bob-File laden (CLI+WB) */ + #include #include #include @@ -293,6 +294,9 @@ LONG Main(LONG arglen, char *argline) struct WBStartup *startup = (struct WBStartup *)argline; char filename[200] = "\0"; /* File beim Start laden? */ + LONG mainidcmpflags = MainNW.IDCMPFlags; + LONG toolidcmpflags = ToolNW.IDCMPFlags; + ToolNW.TopEdge=10000; /* ToolWindow ganz unten */ if(!(GfxBase = (struct GfxBase *)OpenLibrary("graphics.library",0L))) @@ -325,6 +329,29 @@ LONG Main(LONG arglen, char *argline) OpenMain(); + /* + ** Wenn ein Argument angegben wurde, Bobs laden + */ + if (arglen > 0) /* Start vom CLI */ + { + strncpy(filename, argline, arglen); + filename[arglen-1] = '\0'; + } + else if (startup->sm_NumArgs > 1) /* Started with some arguments */ + { + struct WBArg *arg = startup->sm_ArgList+1; + + if (arg->wa_Lock) + CurrentDir(arg->wa_Lock); + + if (arg->wa_Name && *arg->wa_Name) + strcpy(filename, arg->wa_Name); + } + + if (*filename) + LoadBobs(filename); + + /* ** Tada! Die Hauptschleife */ diff --git a/Bobi_rev.h b/Bobi_rev.h index cf15dc2..21137d0 100644 --- a/Bobi_rev.h +++ b/Bobi_rev.h @@ -1,8 +1,8 @@ -/* $VER: 3.0 - File 'Bobi_rev.h' */ +/* $VER: 3.1 - File 'Bobi_rev.h' */ #define VERSION 3 -#define REVISION 0 -#define DATE "2.11.93" -#define VERS "Bobi 3.0" -#define VSTRING "Bobi 3.0 (2.11.93)\n\r" -#define VERSTAG "\0$VER: Bobi 3.0 (2.11.93)" +#define REVISION 1 +#define DATE "13.6.20" +#define VERS "Bobi 3.1" +#define VSTRING "Bobi 3.1 (13.6.20)\n\r" +#define VERSTAG "\0$VER: Bobi 3.1 (13.6.20)" /* Bumper 37.116 (12.7.91) was here */ -- cgit v1.2.3