Skip to content

Commit

Permalink
Merge branch 'master' of github.com:skyjake/Doomsday-Engine
Browse files Browse the repository at this point in the history
  • Loading branch information
danij-deng committed Apr 24, 2014
2 parents 7ce8fa6 + ee9e644 commit e195e48
Show file tree
Hide file tree
Showing 7 changed files with 88 additions and 54 deletions.
10 changes: 5 additions & 5 deletions doomsday/client/src/network/net_main.cpp
Expand Up @@ -809,19 +809,19 @@ de::String ServerInfo_AsStyledText(serverinfo_t const *sv)
#define TABBED(A, B) _E(Ta)_E(l) " " A _E(.) " " _E(\t) B "\n"
return de::String(_E(b) "%1" _E(.) "\n%2\n" _E(T`)
TABBED("Joinable:", "%5")
TABBED("Players:", "%3 / %4%13")
TABBED("Game:", "%9\n%10\n%12 %11")
TABBED("PWADs:", "%14")
TABBED("Players:", "%3 / %4%12")
TABBED("Game:", "%8\n%9\n%11 %10")
TABBED("PWADs:", "%13")
TABBED("Address:", "%6:%7")
TABBED("Ping:", "%8 ms (approx)"))
/*TABBED("Ping:", "%8 ms (approx)")*/)
.arg(sv->name)
.arg(sv->description)
.arg(sv->numPlayers)
.arg(sv->maxPlayers)
.arg(sv->canJoin? "Yes" : "No") // 5
.arg(sv->address)
.arg(sv->port)
.arg(sv->ping)
//.arg(sv->ping)
.arg(sv->plugin)
.arg(sv->gameIdentityKey) // 10
.arg(sv->gameConfig)
Expand Down
84 changes: 52 additions & 32 deletions doomsday/host/doomsday-host
Expand Up @@ -49,7 +49,17 @@ def getText(nodelist):

def getContent(node):
return str(getText(node.childNodes))



def getConfigValue(cfg, name, defaultValue=None):
try:
v = getContent(cfg.getElementsByTagName(name)[0])
#print name + ':', v
return v
except Exception, x:
if defaultValue is None: raise x
return defaultValue


def parseRebuildTimes(rebuilds):
times = []
Expand Down Expand Up @@ -104,10 +114,14 @@ def parseConfig(fn):
parseRebuildTimes(cfg.getElementsByTagName('rebuildTimes')[0])

doomsdayBinary = getContent(cfg.getElementsByTagName('doomsday')[0])
mainLogFileName = getContent(cfg.getElementsByTagName('logFile')[0])
branch = getContent(cfg.getElementsByTagName('branch')[0])
buildDir = getContent(cfg.getElementsByTagName('buildDir')[0])
qmakeCommand = getContent(cfg.getElementsByTagName('qmakeCommand')[0])
try:
# Specifying a log file is optional.
mainLogFileName = getConfigValue(cfg, 'logFile')
except:
pass
branch = getConfigValue(cfg, 'branch', 'master')
buildDir = getConfigValue(cfg, 'buildDir', '')
qmakeCommand = getConfigValue(cfg, 'qmakeCommand', '')

servers = \
parseServers(cfg.getElementsByTagName('servers')[0].
Expand Down Expand Up @@ -320,37 +334,43 @@ def endInstance():
def main():
startInstance()

cfg = parseConfig(homeFile('.doomsdayhostrc'))

# Is there a saved state?
stateFn = homeFile('.doomsdayhoststate.bin')
if os.path.exists(stateFn):
state = pickle.load(file(stateFn, 'rb'))
else:
state = State()

# Kill instances that no longer have a configuration.
state.killObsolete()

# Is it time to rebuild from source?
if state.isTimeForRebuild():
state.killAll()
if rebuildAndInstall():
# Success! Update the timestamp.
try:
cfg = parseConfig(homeFile('.doomsdayhostrc'))

# Is there a saved state?
stateFn = homeFile('.doomsdayhoststate.bin')
if os.path.exists(stateFn):
state = pickle.load(file(stateFn, 'rb'))
else:
state = State()

# Kill instances that no longer have a configuration.
state.killObsolete()

# Is it time to rebuild from source?
if state.isTimeForRebuild():
state.killAll()
if rebuildAndInstall():
# Success! Update the timestamp.
state.updateTime()
else:
state.updateTime()
else:
state.updateTime()

# Are all the servers up and running?
for sv in servers:
if not state.isRunning(sv):
state.start(sv)
# Are all the servers up and running?
for sv in servers:
if not state.isRunning(sv):
state.start(sv)

# Save the state.
pickle.dump(state, file(stateFn, 'wb'))
# Save the state.
pickle.dump(state, file(stateFn, 'wb'))

# Archive old log files.
logCleanup()

# Archive old log files.
logCleanup()
except Exception, x:
print x
#import traceback
#traceback.print_exc()

# We're done.
endInstance()
Expand Down
4 changes: 4 additions & 0 deletions doomsday/plugins/common/src/g_game.cpp
Expand Up @@ -1870,6 +1870,10 @@ void G_PlayerLeaveMap(int player)
p->update |= PSF_POWERS;
de::zap(p->powers);

#if __JDOOM__
G_UpdateSpecialFilterWithTimeDelta(player, 0 /* instantly */);
#endif

#if __JHEXEN__
if(!newHub && !COMMON_GAMESESSION->rules().deathmatch)
{
Expand Down
2 changes: 2 additions & 0 deletions doomsday/plugins/doom/include/d_refresh.h
Expand Up @@ -42,6 +42,8 @@ void G_InitSpecialFilter(void);
*/
void G_UpdateSpecialFilter(int player);

void G_UpdateSpecialFilterWithTimeDelta(int player, float delta);

void D_DrawWindow(Size2Raw const *windowSize);

void D_EndFrame(void);
Expand Down
13 changes: 9 additions & 4 deletions doomsday/plugins/doom/src/d_refresh.cpp
Expand Up @@ -50,7 +50,7 @@ void G_InitSpecialFilter()
}
}

void G_UpdateSpecialFilter(int player)
void G_UpdateSpecialFilterWithTimeDelta(int player, float delta)
{
// In HacX a simple blue shift is used instead.
if(gameMode == doom2_hacx) return;
Expand All @@ -63,7 +63,7 @@ void G_UpdateSpecialFilter(int player)
// Clear the filter.
if(appliedFilter[player] > 0)
{
DD_Executef(true, "postfx %i opacity 1; postfx %i none 0.3", player, player);
DD_Executef(true, "postfx %i opacity 1; postfx %i none %f", player, player, delta);
appliedFilter[player] = -1;
}
return;
Expand All @@ -72,13 +72,13 @@ void G_UpdateSpecialFilter(int player)
float str = 1; // Full inversion.
if(filter < 4 * 32 && !(filter & 8))
{
str = 0; //.7f;
str = 0;
}

// Activate the filter.
if(appliedFilter[player] < 0)
{
DD_Executef(true, "postfx %i monochrome.inverted 0.3", player);
DD_Executef(true, "postfx %i monochrome.inverted %f", player, delta);
}

// Update filter opacity.
Expand All @@ -90,6 +90,11 @@ void G_UpdateSpecialFilter(int player)
appliedFilter[player] = str;
}

void G_UpdateSpecialFilter(int player)
{
G_UpdateSpecialFilterWithTimeDelta(player, .3f);
}

dd_bool R_ViewFilterColor(float rgba[4], int filter)
{
if(!rgba) return false;
Expand Down
29 changes: 16 additions & 13 deletions doomsday/plugins/doom/src/m_cheat.cpp
Expand Up @@ -443,19 +443,22 @@ D_CMD(CheatGive)
App_Log(DE2_SCR_NOTE, "Usage:\n give (stuff)\n give (stuff) (plr)");
App_Log(DE2_LOG_SCR, "Stuff consists of one or more of (type:id). "
"If no id; give all of type:");
App_Log(DE2_LOG_SCR, " a - ammo");
App_Log(DE2_LOG_SCR, " b - berserk");
App_Log(DE2_LOG_SCR, " f - the power of flight");
App_Log(DE2_LOG_SCR, " g - light amplification visor");
App_Log(DE2_LOG_SCR, " h - health");
App_Log(DE2_LOG_SCR, " i - invulnerability");
App_Log(DE2_LOG_SCR, " k - key cards/skulls");
App_Log(DE2_LOG_SCR, " m - computer area map");
App_Log(DE2_LOG_SCR, " p - backpack full of ammo");
App_Log(DE2_LOG_SCR, " r - armor");
App_Log(DE2_LOG_SCR, " s - radiation shielding suit");
App_Log(DE2_LOG_SCR, " v - invisibility");
App_Log(DE2_LOG_SCR, " w - weapons");
#define TABBED(A, B) DE2_ESC(Ta) " " A DE2_ESC(Tb) " - " B
App_Log(DE2_LOG_SCR,
TABBED("a", "ammo") "\n"
TABBED("b", "berserk") "\n"
TABBED("f", "the power of flight") "\n"
TABBED("g", "light amplification visor") "\n"
TABBED("h", "health") "\n"
TABBED("i", "invulnerability") "\n"
TABBED("k", "key cards/skulls") "\n"
TABBED("m", "computer area map") "\n"
TABBED("p", "backpack full of ammo") "\n"
TABBED("r", "armor") "\n"
TABBED("s", "radiation shielding suit") "\n"
TABBED("v", "invisibility") "\n"
TABBED("w", "weapons"));
#undef TABBED
App_Log(DE2_LOG_SCR, "Example: 'give arw' corresponds the cheat IDFA.");
App_Log(DE2_LOG_SCR, "Example: 'give w2k1' gives weapon two and key one.");
return true;
Expand Down
Binary file modified snowberry/graphics/snowberry.ico
Binary file not shown.

0 comments on commit e195e48

Please sign in to comment.