Skip to content

Commit

Permalink
Fixed|DED|libdoomsday: Sky height/horizon offset interpretation
Browse files Browse the repository at this point in the history
Presently the "custom" status of a contained file is not inherited
from the container. For now, check for this in DED_Read()
  • Loading branch information
danij-deng committed Nov 19, 2014
1 parent 6924a80 commit 83a8871
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 6 deletions.
3 changes: 1 addition & 2 deletions doomsday/client/include/world/sky.h
Expand Up @@ -32,8 +32,7 @@
#include "Material"
#include "ModelDef"

#define DEFAULT_SKY_HORIZON_OFFSET ( 0 )
#define DEFAULT_SKY_SPHERE_MATERIAL ( "Textures:SKY1" )
#define DEFAULT_SKY_SPHERE_MATERIAL ( "Textures:SKY1" )

/**
* Behavior logic for a sky in the world system.
Expand Down
1 change: 1 addition & 0 deletions doomsday/libdoomsday/include/doomsday/defs/sky.h
Expand Up @@ -32,6 +32,7 @@ namespace defn {
#define SLF_MASK 0x2 ///< @c true= mask the layer.

#define DEFAULT_SKY_HEIGHT ( .666667f )
#define DEFAULT_SKY_HORIZON_OFFSET ( -0.105f )
#define DEFAULT_SKY_SPHERE_XOFFSET ( 0 )
#define DEFAULT_SKY_SPHERE_FADEOUT_LIMIT ( .3f )

Expand Down
8 changes: 6 additions & 2 deletions doomsday/libdoomsday/src/defs/dedfile.cpp
Expand Up @@ -115,10 +115,14 @@ int DED_Read(ded_t *ded, String path)
hndl->rewind();
char *bufferedDef = (char *) M_Calloc(bufferedDefSize + 1);

File1 &file = hndl->file();
/// @todo Custom status for contained files is not inherited from the container?
bool const isCustom = (file.isContained()? file.container().hasCustom() : file.hasCustom());

// Copy the file into the local buffer and parse definitions.
hndl->read((uint8_t *)bufferedDef, bufferedDefSize);
int result = DED_ReadData(ded, bufferedDef, path, hndl->file().hasCustom());
App_FileSystem().releaseFile(hndl->file());
int result = DED_ReadData(ded, bufferedDef, path, isCustom);
App_FileSystem().releaseFile(file);

// Done. Release temporary storage and return the result.
M_Free(bufferedDef);
Expand Down
2 changes: 1 addition & 1 deletion doomsday/libdoomsday/src/defs/dedparser.cpp
Expand Up @@ -1997,7 +1997,7 @@ DENG2_PIMPL(DEDParser)

if(testCustom)
{
if(mi->getb("custom") != negate)
if(mi->getb("custom") != !negate)
{
mi = nullptr; // skip
}
Expand Down
2 changes: 1 addition & 1 deletion doomsday/libdoomsday/src/defs/sky.cpp
Expand Up @@ -34,7 +34,7 @@ void Sky::resetToDefaults()
def().addText ("id", "");
def().addNumber("flags", 0);
def().addNumber("height", DEFAULT_SKY_HEIGHT);
def().addNumber("horizonOffset", 0);
def().addNumber("horizonOffset", DEFAULT_SKY_HORIZON_OFFSET);
def().addArray ("color", new ArrayValue(Vector3f()));
def().addArray ("layer", new ArrayValue);
def().addArray ("model", new ArrayValue);
Expand Down

0 comments on commit 83a8871

Please sign in to comment.