titlemap - support for map camera object

allows a camera thing to be placed for alternate camera placement besides player and DM starts
This commit is contained in:
yellowtd 2017-04-20 17:15:57 -04:00
parent b68d1ebdb3
commit f70b89b22a
3 changed files with 49 additions and 3 deletions

View File

@ -8595,6 +8595,12 @@ static inline int lib_getenum(lua_State *L)
} else if (fastcmp(word,"paused")) { } else if (fastcmp(word,"paused")) {
lua_pushboolean(L, paused); lua_pushboolean(L, paused);
return 1; return 1;
} else if (fastcmp(word,"titlemap")) {
lua_pushinteger(L, titlemap);
return 1;
} else if (fastcmp(word,"titlemapinaction")) {
lua_pushboolean(L, titlemapinaction);
return 1;
} else if (fastcmp(word,"gametype")) { } else if (fastcmp(word,"gametype")) {
lua_pushinteger(L, gametype); lua_pushinteger(L, gametype);
return 1; return 1;

View File

@ -1576,10 +1576,46 @@ void F_TitleScreenTicker(boolean run)
if (gameaction != ga_nothing || gamestate != GS_TITLESCREEN) if (gameaction != ga_nothing || gamestate != GS_TITLESCREEN)
return; return;
// Do a lil' camera spin if a title map is loaded. thinker_t *th;
mobj_t *mo2;
mobj_t *cameraref = NULL;
// Execute the titlemap camera settings
if (titlemapinaction) { if (titlemapinaction) {
// Default behavior
camera.angle += titlescrollspeed; for (th = thinkercap.next; th != &thinkercap; th = th->next)
{
if (th->function.acp1 != (actionf_p1)P_MobjThinker) // Not a mobj thinker
continue;
mo2 = (mobj_t *)th;
if (mo2->type != MT_ALTVIEWMAN)
continue;
if (mo2)
{
cameraref = mo2;
break;
}
else
break;
}
if (cameraref)
{
camera.x = cameraref->x;
camera.y = cameraref->y;
camera.z = cameraref->z;
camera.angle = cameraref->angle;
camera.aiming = cameraref->cusval;
}
else
{
// Default behavior: Do a lil' camera spin if a title map is loaded;
// TODO: titlescrollspeed scrolls slow here because it is not an angle
//camera.angle += titlescrollspeed;
}
} }
// no demos to play? or, are they disabled? // no demos to play? or, are they disabled?

View File

@ -34,6 +34,7 @@
#ifdef ESLOPE #ifdef ESLOPE
#include "p_slopes.h" #include "p_slopes.h"
#endif #endif
#include "f_finale.h"
// protos. // protos.
static CV_PossibleValue_t viewheight_cons_t[] = {{16, "MIN"}, {56, "MAX"}, {0, NULL}}; static CV_PossibleValue_t viewheight_cons_t[] = {{16, "MIN"}, {56, "MAX"}, {0, NULL}};
@ -8423,6 +8424,9 @@ mobj_t *P_SpawnMobj(fixed_t x, fixed_t y, fixed_t z, mobjtype_t type)
#endif #endif
switch (mobj->type) switch (mobj->type)
{ {
case MT_ALTVIEWMAN:
if (titlemapinaction) mobj->flags &= ~MF_NOTHINK;
break;
case MT_CYBRAKDEMON_NAPALM_BOMB_LARGE: case MT_CYBRAKDEMON_NAPALM_BOMB_LARGE:
mobj->fuse = mobj->info->mass; mobj->fuse = mobj->info->mass;
break; break;