From 8fa00afb7cb347170cea810b4525b5ba8b8a8c22 Mon Sep 17 00:00:00 2001 From: hendricks266 Date: Sun, 12 Jan 2014 14:03:00 +0000 Subject: [PATCH] Mapster32: Add EVENT_LOADMAP, EVENT_SAVEMAP, EVENT_PRELOADMAP, and EVENT_PRESAVEMAP. Some are more useful than others. git-svn-id: https://svn.eduke32.com/eduke32@4244 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/eduke32/build/include/m32script.h | 4 ++++ polymer/eduke32/source/astub.c | 7 +++++++ polymer/eduke32/source/m32def.c | 4 ++++ 3 files changed, 15 insertions(+) diff --git a/polymer/eduke32/build/include/m32script.h b/polymer/eduke32/build/include/m32script.h index 3b2c1a87a..f95b17748 100644 --- a/polymer/eduke32/build/include/m32script.h +++ b/polymer/eduke32/build/include/m32script.h @@ -94,6 +94,10 @@ enum GameEvent_t { EVENT_LINKTAGS, EVENT_KEYPRESS, EVENT_PREDRAW3DSCREEN, + EVENT_LOADMAP, + EVENT_SAVEMAP, + EVENT_PRELOADMAP, + EVENT_PRESAVEMAP, MAXEVENTS }; diff --git a/polymer/eduke32/source/astub.c b/polymer/eduke32/source/astub.c index 0f21531ca..fd29d590a 100644 --- a/polymer/eduke32/source/astub.c +++ b/polymer/eduke32/source/astub.c @@ -731,12 +731,16 @@ void ExtLoadMap(const char *mapname) #if M32_UNDO map_undoredo_free(); #endif + + VM_OnEvent(EVENT_LOADMAP, -1); } void ExtSaveMap(const char *mapname) { UNREFERENCED_PARAMETER(mapname); saveboard("backup.map", &pos, ang, cursectnum); + + VM_OnEvent(EVENT_SAVEMAP, -1); } @@ -8393,6 +8397,8 @@ int32_t ExtPreSaveMap(void) { int32_t numfixedsprites; + VM_OnEvent(EVENT_PRESAVEMAP, -1); + numfixedsprites = fixspritesectors(); //Do this before saving! updatesectorz(startpos.x,startpos.y,startpos.z,&startsectnum); if (startsectnum < 0) @@ -10281,6 +10287,7 @@ static int32_t loadconsounds(const char *fn) void ExtPreLoadMap(void) { + VM_OnEvent(EVENT_PRELOADMAP, -1); } /// ^^^ diff --git a/polymer/eduke32/source/m32def.c b/polymer/eduke32/source/m32def.c index 1471e6be3..e5ad48279 100644 --- a/polymer/eduke32/source/m32def.c +++ b/polymer/eduke32/source/m32def.c @@ -3515,6 +3515,10 @@ static void C_AddDefaultDefinitions(void) C_AddDefinition("EVENT_LINKTAGS", EVENT_LINKTAGS, LABEL_EVENT); C_AddDefinition("EVENT_KEYPRESS", EVENT_KEYPRESS, LABEL_EVENT); C_AddDefinition("EVENT_PREDRAW3DSCREEN", EVENT_PREDRAW3DSCREEN, LABEL_EVENT); + C_AddDefinition("EVENT_LOADMAP", EVENT_LOADMAP, LABEL_EVENT); + C_AddDefinition("EVENT_SAVEMAP", EVENT_SAVEMAP, LABEL_EVENT); + C_AddDefinition("EVENT_PRELOADMAP", EVENT_PRELOADMAP, LABEL_EVENT); + C_AddDefinition("EVENT_PRESAVEMAP", EVENT_PRESAVEMAP, LABEL_EVENT); C_AddDefinition("CLIPMASK0", CLIPMASK0, LABEL_DEFINE); C_AddDefinition("CLIPMASK1", CLIPMASK1, LABEL_DEFINE);