Skip to content

Commit

Permalink
Merge branch 'master' into mapdata-c++
Browse files Browse the repository at this point in the history
Conflicts:
doomsday/libdeng2/include/de/math.h
  • Loading branch information
danij-deng committed Apr 8, 2013
2 parents 0d4aa5c + c64fa1d commit 42e7e14
Show file tree
Hide file tree
Showing 12 changed files with 50 additions and 25 deletions.
2 changes: 1 addition & 1 deletion doomsday/api/api_audiod.h
Expand Up @@ -64,7 +64,7 @@ typedef struct audiodriver_s {
int (*Init) (void);
void (*Shutdown) (void);
void (*Event) (int type);
int (*Set) (int prop, const void* ptr);
int (*Set) (int prop, void const *ptr);
} audiodriver_t;

typedef struct audiointerface_base_s {
Expand Down
4 changes: 2 additions & 2 deletions doomsday/client/data/cphelp.txt
Expand Up @@ -308,8 +308,8 @@ desc = Set your name.
inf = Params: setname (name)\nFor example, 'setname "my name"'.

[setres]
desc = Change video mode resolution or window size.
inf = Params: setres (width) (height)\nFor example, 'setres 1024 768'.
desc = Change display mode resolution or window size.
inf = USAGE:\nsetres (width) (height)\nThe window retains its current mode, adjusting the display mode if in fullscreen and the window size if in a windowed mode.\nEXAMPLES:\nChange resolution to 1024 x 768: 'setres 1024 768'\nSEE ALSO:\n- 'listdisplaymodes'\n- 'setfullres'\n- 'setwinres'\n

[settics]
desc = Set number of game tics per second (default: 35).
Expand Down
2 changes: 1 addition & 1 deletion doomsday/client/include/audio/audiodriver_music.h
Expand Up @@ -36,7 +36,7 @@
extern "C" {
#endif

void AudioDriver_Music_Set(int property, void* ptr);
void AudioDriver_Music_Set(int property, void const *ptr);

int AudioDriver_Music_PlayNativeFile(const char* fileName, boolean looped);

Expand Down
4 changes: 2 additions & 2 deletions doomsday/client/src/audio/audiodriver_music.cpp
Expand Up @@ -40,7 +40,7 @@ static AutoStr *composeBufferedMusicFilename(int id, char const *ext)
return Str_Appendf(AutoStr_NewStd(), "%s%i", BUFFERED_MUSIC_FILE, id);
}

static void musicSet(audiointerface_music_t *iMusic, int property, void *ptr)
static void musicSet(audiointerface_music_t *iMusic, int property, void const *ptr)
{
audiodriver_t *d = AudioDriver_Interface(iMusic);
if(!d || !d->Set) return;
Expand Down Expand Up @@ -140,7 +140,7 @@ AutoStr *AudioDriver_Music_ComposeTempBufferFilename(char const *ext)
return composeBufferedMusicFilename(currentBufFile, ext);
}

void AudioDriver_Music_Set(int property, void *ptr)
void AudioDriver_Music_Set(int property, void const *ptr)
{
void *ifs[MAX_AUDIO_INTERFACES];
int i, count = AudioDriver_FindInterfaces(AUDIO_IMUSIC, ifs);
Expand Down
6 changes: 4 additions & 2 deletions doomsday/client/src/audio/s_mus.cpp
Expand Up @@ -109,7 +109,8 @@ boolean Mus_Init(void)
}

// Tell the audio driver about our soundfont config.
AudioDriver_Music_Set(AUDIOP_SOUNDFONT_FILENAME, soundFontPath);
AudioDriver_Music_Set(AUDIOP_SOUNDFONT_FILENAME,
de::NativePath(soundFontPath).expand().toString().toLatin1().constData());

musAvail = true;
return true;
Expand Down Expand Up @@ -447,7 +448,8 @@ int Mus_Start(ded_music_t* def, boolean looped)

static void Mus_UpdateSoundFont(void)
{
AudioDriver_Music_Set(AUDIOP_SOUNDFONT_FILENAME, (void*)Con_GetString("music-soundfont"));
AudioDriver_Music_Set(AUDIOP_SOUNDFONT_FILENAME,
de::NativePath(Con_GetString("music-soundfont")).expand().toString().toLatin1().constData());
}

/**
Expand Down
17 changes: 16 additions & 1 deletion doomsday/doc/engine/command/setres.ame
Expand Up @@ -2,5 +2,20 @@
Change video mode resolution or window size.
}
@description{
Params: setres (width) (height) @cbr For example, 'setres 1024 768'.
@usage
@ident{setres} @help_arg{width} @help_arg{height}

The window retains its current mode, adjusting the display mode if in
fullscreen and the window size if in a windowed mode.

@examples
Change resolution to 1024 x 768:
@code{setres 1024 768}

@seealso
@list{
@item @cmd{listdisplaymodes}
@item @cmd{setfullres}
@item @cmd{setwinres}
}
}
4 changes: 2 additions & 2 deletions doomsday/doc/readme/network.ame
Expand Up @@ -105,7 +105,7 @@ servers, check that your firewall isn't blocking these UDP ports on either end.

You can see information about the network subsystem status with the command:

@samp{@cmd{net info}}
@code{net info}

@subsec{Server}

Expand All @@ -124,5 +124,5 @@ client only needs to be able to reach the server via the server's TCP port.
A server running on the same computer can be connected to with the following
command:

@samp{@cmd{connect localhost}}
@code{connect localhost}

8 changes: 4 additions & 4 deletions doomsday/doc/readme/resources.ame
Expand Up @@ -79,10 +79,10 @@ A virtual directory mapping is defined using the @opt{-vdmap} option. It takes
the source and destination directories as parameters. For example:

@ifdef{WIN32}{
@samp{@cmd{-vdmap "D:\Games\MyAuto" "C:\Doomsday\Data\jDoom\Auto"}}
@code{-vdmap "D:\Games\MyAuto" "C:\Doomsday\Data\jDoom\Auto"}
}
@else{
@samp{@cmd{-vdmap /home/username/myauto /usr/share/doomsday/data/jdoom/auto}}
@code{-vdmap /home/username/myauto /usr/share/doomsday/data/jdoom/auto}
}

You can define an unlimited number of virtual directory mappings using
Expand Down Expand Up @@ -178,11 +178,11 @@ that contains the current directory and all its subdirectories plus a
@file{DD_DIREC} lump that has (with a high probability) a unique lump name for
each file. You can invoke the utility like this:

@samp{@cmd{ wadtool myfiles.wad /data/jdoom/textures/ }}
@code{ wadtool myfiles.wad /data/jdoom/textures/ }

This would create a WAD file that contains all the files from the current
directory. When writing the @file{DD_DIREC} table, the prefix
"/data/jdoom/textures/" would be added to each file name. @cmd{wadtool} is
"/data/jdoom/textures/" would be added to each file name. @bin{wadtool} is
available in the Doomsday source repository under @file{/tools/wadtool}.


Expand Down
2 changes: 1 addition & 1 deletion doomsday/doc/server/manpage.ame
Expand Up @@ -37,7 +37,7 @@ at startup. More files can be loaded at runtime with the @cmd{load} command.

}

In addition to these, @cmd{doomsday-server} supports many of the command line
In addition to these, @bin{doomsday-server} supports many of the command line
options of doomsday(6).


Expand Down
2 changes: 1 addition & 1 deletion doomsday/doc/shell-text/shell-text.ame
Expand Up @@ -18,7 +18,7 @@ $ Extra formatting macros.

@chapter{ Options }

This version of @cmd{doomsday-shell-text} does not support any command line
This version of @bin{doomsday-shell-text} does not support any command line
options.

$*
Expand Down
12 changes: 6 additions & 6 deletions doomsday/libdeng2/api2.doxy
Expand Up @@ -9,17 +9,17 @@ OUTPUT_DIRECTORY = ../apidoc/api2/
INPUT = include src
FILE_PATTERNS = *
EXCLUDE_PATTERNS = .DS_Store
PREDEFINED = __cplusplus __DENG2__ \
"DENG2_ERROR(N)=class N : public de::Error {};" \
"DENG2_SUB_ERROR(B,N)=class N : public B {};" \
"DENG2_PIMPL(C)=typedef C Public; struct C::Instance : public de::Private<C>" \
PREDEFINED = __cplusplus __DENG2__ \
"DENG2_PIMPL(ClassName)=typedef ClassName Public; struct ClassName::Instance : public de::Private<ClassName>" \
"DENG2_PIMPL_NOREF(C)=struct C::Instance : public de::IPrivate" \
"DENG2_PRIVATE(Var)=struct Instance; Instance *Var;"
"DENG2_PRIVATE(Var)=struct Instance; Instance *Var;" \
"DENG2_ERROR(N)=class N : public de::Error {};" \
"DENG2_SUB_ERROR(B,N)=class N : public B {};"

INCLUDED_BY_GRAPH = NO
COLLABORATION_GRAPH = NO
REFERENCED_BY_RELATION = NO
OPTIMIZE_OUTPUT_FOR_C = NO
MACRO_EXPANSION = YES
EXPAND_ONLY_PREDEF = YES
EXPAND_ONLY_PREDEF = NO
INTERNAL_DOCS = NO
12 changes: 10 additions & 2 deletions doomsday/libdeng2/include/de/math.h
Expand Up @@ -36,6 +36,7 @@ namespace de {
#undef PI
ddouble const PI = 3.14159265358979323846;
ddouble const EPSILON = 1.0e-7;
dfloat const FLOAT_EPSILON = 1.0e-5;

/// Absolute value.
template <typename Type>
Expand Down Expand Up @@ -94,8 +95,15 @@ inline dint64 ceil(ddouble const &value) {
return dint64(std::ceil(value));
}

/// Compare two floating-point values for equality, with the precision of EPSILON.
inline ddouble fequal(ddouble a, ddouble b) {
/// Compare two single-precision floating-point values for equality,
/// with the precision of FLOAT_EPSILON.
inline bool fequal(dfloat a, dfloat b) {
return abs(a - b) < FLOAT_EPSILON;
}

/// Compare two double-precision floating-point values for equality,
/// with the precision of EPSILON.
inline bool fequal(ddouble a, ddouble b) {
return abs(a - b) < EPSILON;
}

Expand Down

0 comments on commit 42e7e14

Please sign in to comment.