Skip to content

Commit

Permalink
Merge branch 'master' of ssh://deng.git.sourceforge.net/gitroot/deng/…
Browse files Browse the repository at this point in the history
…deng
  • Loading branch information
skyjake committed May 1, 2012
2 parents 141ce3b + 35ae543 commit 7c70c90
Show file tree
Hide file tree
Showing 10 changed files with 83 additions and 16 deletions.
10 changes: 10 additions & 0 deletions distrib/win32/setup.iss.template
Expand Up @@ -99,8 +99,18 @@ Source: "data\graphics\background.pcx"; DestDir: "{app}\data\graphics"; Componen
Source: "data\graphics\loading1.png"; DestDir: "{app}\data\graphics"; Components: Engine
Source: "data\graphics\loading2.png"; DestDir: "{app}\data\graphics"; Components: Engine
Source: "data\graphics\logo.png"; DestDir: "{app}\data\graphics"; Components: Engine
Source: "data\fonts\console11.dfn"; DestDir: "{app}\data\fonts"; Components: Engine
Source: "data\fonts\console14.dfn"; DestDir: "{app}\data\fonts"; Components: Engine
Source: "data\fonts\console18.dfn"; DestDir: "{app}\data\fonts"; Components: Engine
Source: "data\fonts\normal12.dfn"; DestDir: "{app}\data\fonts"; Components: Engine
Source: "data\fonts\normal18.dfn"; DestDir: "{app}\data\fonts"; Components: Engine
Source: "data\fonts\normal24.dfn"; DestDir: "{app}\data\fonts"; Components: Engine
Source: "data\fonts\normalbold12.dfn"; DestDir: "{app}\data\fonts"; Components: Engine
Source: "data\fonts\normalbold18.dfn"; DestDir: "{app}\data\fonts"; Components: Engine
Source: "data\fonts\normalbold24.dfn"; DestDir: "{app}\data\fonts"; Components: Engine
Source: "data\fonts\normallight12.dfn"; DestDir: "{app}\data\fonts"; Components: Engine
Source: "data\fonts\normallight18.dfn"; DestDir: "{app}\data\fonts"; Components: Engine
Source: "data\fonts\normallight24.dfn"; DestDir: "{app}\data\fonts"; Components: Engine
Source: "data\jdoom\jdoom.pk3"; DestDir: "{app}\data\jdoom"; Components: Engine\jDoom
Source: "data\jheretic\jheretic.pk3"; DestDir: "{app}\data\jheretic"; Components: Engine\jHeretic
Source: "data\jhexen\jhexen.pk3"; DestDir: "{app}\data\jhexen"; Components: Engine\jHexen
Expand Down
6 changes: 6 additions & 0 deletions doomsday/engine/portable/include/b_main.h
Expand Up @@ -32,6 +32,7 @@
#define DEFAULT_BINDING_CONTEXT_NAME "game"
#define CONSOLE_BINDING_CONTEXT_NAME "console"
#define UI_BINDING_CONTEXT_NAME "deui"
#define GLOBAL_BINDING_CONTEXT_NAME "global"

void B_Register(void);
void B_Init(void);
Expand All @@ -40,6 +41,11 @@ boolean B_Delete(int bid);
boolean B_Responder(ddevent_t* ev);
void B_WriteToFile(FILE* file);

/**
* Enable the contexts for the initial state.
*/
void B_InitialContextActivations(void);

void B_BindDefaults(void);
void B_BindGameDefaults(void);

Expand Down
30 changes: 29 additions & 1 deletion doomsday/engine/portable/src/b_main.c
Expand Up @@ -215,6 +215,13 @@ void B_Init(void)

// UI doesn't let anything past it.
B_AcquireAll(B_NewContext(UI_BINDING_CONTEXT_NAME), true);

// Top-level context that is always active and overrides every other context.
// To be used only for system-level functionality.
bc = B_NewContext(GLOBAL_BINDING_CONTEXT_NAME);
bc->flags |= BCF_PROTECTED;
B_ActivateContext(bc, true);

/*
B_BindCommand("joy-hat-angle3", "print {angle 3}");
B_BindCommand("joy-hat-center", "print center");
Expand Down Expand Up @@ -244,13 +251,34 @@ void B_Init(void)
// Bind all the defaults for the engine only.
B_BindDefaults();

// Enable the contexts for the initial state.
B_InitialContextActivations();
}

void B_InitialContextActivations(void)
{
int i;

// Disable all contexts.
for(i = 0; i < B_ContextCount(); ++i)
{
B_ActivateContext(B_ContextByPos(i), false);
}

// These are the contexts active by default.
B_ActivateContext(B_ContextByName(GLOBAL_BINDING_CONTEXT_NAME), true);
B_ActivateContext(B_ContextByName(DEFAULT_BINDING_CONTEXT_NAME), true);

if(Con_IsActive())
{
B_ActivateContext(B_ContextByName(CONSOLE_BINDING_CONTEXT_NAME), true);
}
}

void B_BindDefaults(void)
{
// Engine's highest priority context: opening control panel, opening the console.
B_BindCommand("global:key-f11-down + key-alt-down", "releasemouse");
B_BindCommand("global:key-f11-down", "togglefullscreen");

// Console bindings (when open).

Expand Down
11 changes: 10 additions & 1 deletion doomsday/engine/portable/src/con_main.c
Expand Up @@ -1561,7 +1561,16 @@ boolean Con_Responder(ddevent_t* ev)
if(!IS_KEY_PRESS(ev))
return false;

// In this case the console is active and operational.
// The console is active and operational.

// Temporary kludge: since bindings are not presently accessible when the
// console is open, use some hardcoded keys.
if(ev->toggle.id == DDKEY_F11)
{
DD_Execute(true, altDown? "releasemouse" : "togglefullscreen");
return true;
}

// Check the shutdown key.
if(!conInputLock)
{
Expand Down
12 changes: 8 additions & 4 deletions doomsday/engine/portable/src/dd_input.c
Expand Up @@ -1054,10 +1054,10 @@ static void dispatchEvents(eventqueue_t* q, timespan_t ticLength)
continue;
}

if(UI_Responder(ddev)) continue;
if(Con_Responder(ddev)) continue;
if(UI_Responder(ddev)) continue; /// @todo: use the bindings system (deui context fallback)
if(Con_Responder(ddev)) continue; /// @todo refactor: use the bindings system

if(callGameResponders)
if(callGameResponders) /// @todo refactor: use the bindings system (chat context fallback)
{
// The game's normal responder only returns true if the bindings can't
// be used (like when chatting).
Expand Down Expand Up @@ -1149,6 +1149,10 @@ byte DD_ModKey(byte key)
{
return '.';
}
else if(key == DDKEY_MULTIPLY)
{
return '*';
}

return key;
}
Expand Down Expand Up @@ -2001,7 +2005,7 @@ void Rend_AllInputDeviceStateVisuals(void)
static inputdev_layout_control_t keyGroup11[] = {
{ IDC_KEY, 144 }, // numlock
{ IDC_KEY, 172 }, // divide
{ IDC_KEY, 42 }, // multiply
{ IDC_KEY, DDKEY_MULTIPLY }, // multiply
{ IDC_KEY, 168 } // subtract
};
static inputdev_layout_control_t keyGroup12[] = {
Expand Down
2 changes: 2 additions & 0 deletions doomsday/engine/portable/src/dd_main.c
Expand Up @@ -1109,6 +1109,8 @@ boolean DD_ChangeGame2(Game* game, boolean allowReload)

P_ControlShutdown();
Con_Execute(CMDS_DDAY, "clearbindings", true, false);
B_BindDefaults();
B_InitialContextActivations();

for(i = 0; i < DDMAXPLAYERS; ++i)
{
Expand Down
18 changes: 11 additions & 7 deletions doomsday/engine/portable/src/materials.c
Expand Up @@ -1035,25 +1035,29 @@ static void pushVariantCacheQueue(material_t* mat, const materialvariantspecific
void Materials_Precache2(material_t* mat, const materialvariantspecification_t* spec,
boolean smooth, boolean cacheGroup)
{
variantcachequeue_node_t* node;
assert(mat && spec);

errorIfNotInited("Materials::Precache");

// Don't precache when playing demo.
if(isDedicated || playback)
if(!mat || ! spec)
{
DEBUG_Message(("Materials_Precache: Invalid arguments mat:%p, spec:%p, ignoring.\n", mat, spec));
return;
}

// Don't precache when playing demo.
if(isDedicated || playback) return;

// Already in the queue?
{ variantcachequeue_node_t* node;
for(node = variantCacheQueue; node; node = node->next)
{
if(mat == node->mat && spec == node->spec) return;
}
}}

pushVariantCacheQueue(mat, spec, smooth);

if(cacheGroup && Material_IsGroupAnimated(mat))
{ // Material belongs in one or more animgroups; precache the group.
{
// Material belongs in one or more animgroups; precache the group.
int i, k;
for(i = 0; i < numgroups; ++i)
{
Expand Down
2 changes: 1 addition & 1 deletion doomsday/engine/portable/src/rend_main.c
Expand Up @@ -2866,7 +2866,7 @@ static void Rend_RenderBspLeaf(BspLeaf* bspLeaf)
// Inverted.
texOffset[VY] = -texOffset[VY];

texScale[VX] = ((suf->flags & DDSUF_MATERIAL_FLIPH)? -1 : 1);
texScale[VX] = (((suf->flags & DDSUF_MATERIAL_FLIPH) || (texMode == 1 && (i == PLN_CEILING)))? -1 : 1);
texScale[VY] = ((suf->flags & DDSUF_MATERIAL_FLIPV)? -1 : 1);

Rend_RenderPlane(bspLeaf, plane->type, plane->visHeight, suf->tangent, suf->bitangent, suf->normal,
Expand Down
2 changes: 0 additions & 2 deletions doomsday/plugins/common/src/g_controls.c
Expand Up @@ -397,8 +397,6 @@ D_CMD(DefaultGameBinds)
"bindevent shortcut:key-f9 quickload",
"bindevent shortcut:key-f10 quit",
//"bindevent shortcut:key-f11 togglegamma",
"bindevent shortcut:key-f11+key-alt-down releasemouse",
"bindevent shortcut:key-f11 togglefullscreen",
"bindevent shortcut:key-print screenshot",
"bindevent shortcut:key-f12 screenshot",

Expand Down
6 changes: 6 additions & 0 deletions doomsday/plugins/jhexen/src/m_cheat.c
Expand Up @@ -374,6 +374,12 @@ int Cht_WarpFunc(const int* args, int player)
if(IS_NETGAME)
return false;

if(G_GameState() == GS_MAP && plr->playerState == PST_DEAD)
{
Con_Message("Cannot warp while dead.\n");
return false;
}

tens = args[0] - '0';
ones = args[1] - '0';
if(tens < 0 || tens > 9 || ones < 0 || ones > 9)
Expand Down

0 comments on commit 7c70c90

Please sign in to comment.