Merge branch 'master' into gamma-correction

This commit is contained in:
Robert Beckebans 2015-12-21 13:00:52 +01:00
commit 51cac2394f
12 changed files with 207 additions and 133 deletions

View file

@ -170,6 +170,10 @@ _________________________
> yum install cmake SDL-devel openal-devel
On ArchLinux
> sudo pacman -S sdl2 ffmpeg openal cmake
On openSUSE (tested in 13.1)
> zypper in openal-soft-devel cmake libSDL-devel libffmpeg1-devel
@ -214,29 +218,22 @@ unfortunately requires Steam for Windows - Steam for Linux or OSX won't do, beca
Even the DVD version of Doom 3 BFG only contains encrytped data that is decoded
by Steam on install.
Fortunately, you can run Steam in Wine to install Doom3 BFG and afterwards copy the
game data somewhere else to use it with native executables.
Winetricks ( http://winetricks.org/ ) makes installing Windows Steam on Linux really easy.
On Linux and OSX the easiest way to install is with SteamCMD: https://developer.valvesoftware.com/wiki/SteamCMD
See the description on https://developer.valvesoftware.com/wiki/SteamCMD#Linux (OS X is directly below that) on how to install SteamCMD on your system. You won't have to create a new user.
If using the Linux version of Steam, you can open the console (launch steam with -console or try steam://open/console in a web browser) and enter the following:
download_depot 208200 208202
This will download the base game files to a path similar to (the path cannot be configured):
~/.steam/root/ubuntu12_32/steamapps/content/app_208200/depot_208202/
Steam will not provide feedback on the download progress so you will have to watch the folder.
You will also have to run download_depot for your language:
download_depot 208200 <language depot>
Where <language depot> is:
English: 208203
German: 208204
French: 208205
Italian: 208206
Spanish: 208207
Japanese: 208208
Combining the contents of both depots will provide the necessary game files for the engine.
Then you can download Doom 3 BFG with
> ./steamcmd.sh +@sSteamCmdForcePlatformType windows +login <YOUR_STEAM_LOGIN_NAME> +force_install_dir ./doom3bfg/ +app_update 208200 validate +quit
(replace <YOUR_STEAM_LOGIN_NAME> with your steam login name)
When it's done you should have the normal windows installation of Doom 3 BFG in ./doom3bfg/ and the needed files in ./doom3bfg/base/
That number is the "AppID" of Doom 3 BFG; if you wanna use this to get the data of other games you own, you can look up the AppID at https://steamdb.info/
NOTE that we've previously recommended using download_depot in the Steam console to install the game data. That turned out to be unreliable and result in broken, unusable game data. So use SteamCMD instead, as described above.
Anyway:
1. Install Doom 3 BFG in Steam (Windows version), make sure it's getting
1. Install Doom 3 BFG in Steam (Windows version) or SteamCMD, make sure it's getting
updated/patched.
2. Create your own Doom 3 BFG directory, e.g. /path/to/Doom3BFG/
@ -244,6 +241,7 @@ Anyway:
3. Copy the game-data's base dir from Steam to that directory
(e.g. /path/to/Doom3BFG/), it's in
/your/path/to/Steam/steamapps/common/DOOM 3 BFG Edition/base/
or, if you used SteamCMD, in the path you used above.
4. Copy your RBDoom3BFG executable that you created in 5) or 6) and the FFmpeg DLLs to your own
Doom 3 BFG directory (/path/to/Doom3BFG).

View file

@ -1,76 +1,76 @@
//
// KEY BINDINGS
//
unbindall
//
// weapons
//
bind 1 "_impulse0" // weap
bind 2 "_impulse2" // weap
bind 3 "_impulse3" // weap
bind 4 "_impulse5" // weap
bind 5 "_impulse6" // weap
bind 6 "_impulse7" // weap
bind 7 "_impulse8" // weap
bind 8 "_impulse9" // weap
bind 9 "_impulse10" // weap
//bind 0 "_impulse11" // weap
bind q "_impulse12" // weap
bind TAB "_impulse19" // PDA in SP, scoreboard in MP
bind r "_impulse13" // reload
bind f "_impulse16" // Flash Light
bind [ "_impulse15"
bind ] "_impulse14"
bind / "_impulse14"
bind ENTER _button2
bind mwheelup "_impulse15"
bind mwheeldown "_impulse14"
//
// CHARACTER CONTROLS
//
bind CTRL _attack
bind SHIFT _speed
bind DEL _lookdown
bind PGDN _lookup
bind c _movedown
bind SPACE _moveup
bind UPARROW _forward
bind DOWNARROW _back
bind LEFTARROW _left
bind RIGHTARROW _right
bind w _forward
bind a _moveleft
bind s _back
bind d _moveright
bind e _use
//
// CLIENT ENVIRONMENT COMMANDS
//
bind F5 "savegame quick"
bind F9 "loadgame quick"
bind F12 screenshot
bind t clientMessageMode
bind y "clientMessageMode 1"
//
// MOUSE BUTTONS
//
bind MOUSE1 _attack
bind MOUSE2 _moveup
//
// KEY BINDINGS
//
unbindall
//
// weapons
//
bind 1 "_impulse0" // weap
bind 2 "_impulse2" // weap
bind 3 "_impulse3" // weap
bind 4 "_impulse5" // weap
bind 5 "_impulse6" // weap
bind 6 "_impulse7" // weap
bind 7 "_impulse8" // weap
bind 8 "_impulse9" // weap
bind 9 "_impulse10" // weap
//bind 0 "_impulse11" // weap
bind q "_impulse12" // weap
bind TAB "_impulse19" // PDA in SP, scoreboard in MP
bind r "_impulse13" // reload
bind f "_impulse16" // Flash Light
bind [ "_impulse15"
bind ] "_impulse14"
bind / "_impulse14"
bind ENTER _button2
bind mwheelup "_impulse15"
bind mwheeldown "_impulse14"
//
// CHARACTER CONTROLS
//
bind CTRL _attack
bind SHIFT _speed
bind DEL _lookdown
bind PGDN _lookup
bind c _movedown
bind SPACE _moveup
bind UPARROW _forward
bind DOWNARROW _back
bind LEFTARROW _left
bind RIGHTARROW _right
bind w _forward
bind a _moveleft
bind s _back
bind d _moveright
bind e _use
//
// CLIENT ENVIRONMENT COMMANDS
//
bind F5 "savegame quick"
bind F9 "loadgame quick"
bind F12 screenshot
bind t clientMessageMode
bind y "clientMessageMode 1"
//
// MOUSE BUTTONS
//
bind MOUSE1 _attack
bind MOUSE2 _moveup

View file

@ -642,13 +642,21 @@ bool idCollisionModelManagerLocal::LoadCollisionModelFile( const char* name, uns
file->ReadString( fileVersion );
if( fileID == CM_FILEID && fileVersion == CM_FILEVERSION && crc == mapFileCRC && numEntries > 0 )
{
loaded = true; // DG: moved this up here to prevent segfaults, see below
for( int i = 0; i < numEntries; i++ )
{
cm_model_t* model = LoadBinaryModelFromFile( file, currentTimeStamp );
// DG: handle the case that loading the binary model fails gracefully
// (otherwise we'll get a segfault when someone wants to use models[numModels])
if( model == NULL )
{
loaded = false;
break;
}
// DG end
models[ numModels ] = model;
numModels++;
}
loaded = true;
}
}

View file

@ -307,7 +307,7 @@ idCVar idFileSystemLocal::fs_game_base( "fs_game_base", "", CVAR_SYSTEM | CVAR_
idCVar fs_basepath( "fs_basepath", "", CVAR_SYSTEM | CVAR_INIT, "" );
idCVar fs_savepath( "fs_savepath", "", CVAR_SYSTEM | CVAR_INIT, "" );
idCVar fs_resourceLoadPriority( "fs_resourceLoadPriority", "1", CVAR_SYSTEM , "if 1, open requests will be honored from resource files first; if 0, the resource files are checked after normal search paths" );
idCVar fs_resourceLoadPriority( "fs_resourceLoadPriority", "0", CVAR_SYSTEM , "if 1, open requests will be honored from resource files first; if 0, the resource files are checked after normal search paths" );
idCVar fs_enableBackgroundCaching( "fs_enableBackgroundCaching", "1", CVAR_SYSTEM , "if 1 allow the 360 to precache game files in the background" );
idFileSystemLocal fileSystemLocal;

View file

@ -232,6 +232,7 @@ public:
{
BindShader_Builtin( BUILTIN_TEXTURE_TEXGEN_VERTEXCOLOR );
};
void BindShader_Interaction()
{
BindShader_Builtin( BUILTIN_INTERACTION );
@ -288,6 +289,7 @@ public:
{
BindShader_Builtin( BUILTIN_SIMPLESHADE );
}
void BindShader_Environment()
{
BindShader_Builtin( BUILTIN_ENVIRONMENT );
@ -350,6 +352,7 @@ public:
{
BindShader_Builtin( BUILTIN_BLENDLIGHT );
}
void BindShader_Fog()
{
BindShader_Builtin( BUILTIN_FOG );
@ -406,6 +409,7 @@ public:
{
BindShader_Builtin( BUILTIN_BINK_GUI );
}
void BindShader_MotionBlur()
{
BindShader_Builtin( BUILTIN_MOTION_BLUR );
@ -572,14 +576,14 @@ protected:
idList<glslUniformLocation_t> uniformLocations;
};
int currentRenderProgram;
idList<glslProgram_t> glslPrograms;
idList<glslProgram_t, TAG_RENDER> glslPrograms;
idStaticList < idVec4, RENDERPARM_USER + MAX_GLSL_USER_PARMS > glslUniforms;
int currentVertexShader;
int currentFragmentShader;
idList<vertexShader_t > vertexShaders;
idList<fragmentShader_t > fragmentShaders;
idList<vertexShader_t, TAG_RENDER> vertexShaders;
idList<fragmentShader_t, TAG_RENDER> fragmentShaders;
};
extern idRenderProgManager renderProgManager;

View file

@ -976,6 +976,13 @@ const char* fragmentInsert_GLSL_ES_3_00 =
"#version 300 es\n"
"#define PC\n"
"precision mediump float;\n"
"precision lowp sampler2D;\n"
"precision lowp sampler2DShadow;\n"
"precision lowp sampler2DArray;\n"
"precision lowp sampler2DArrayShadow;\n"
"precision lowp samplerCube;\n"
"precision lowp samplerCubeShadow;\n"
"precision lowp sampler3D;\n"
"\n"
"void clip( float v ) { if ( v < 0.0 ) { discard; } }\n"
"void clip( vec2 v ) { if ( any( lessThan( v, vec2( 0.0 ) ) ) ) { discard; } }\n"

View file

@ -311,7 +311,7 @@ static void R_CheckCvars()
{
case GLDRV_OPENGL_ES2:
case GLDRV_OPENGL_ES3:
case GLDRV_OPENGL_MESA:
//case GLDRV_OPENGL_MESA:
r_useShadowMapping.SetInteger( 0 );
break;

View file

@ -94,6 +94,7 @@ enum graphicsDriverType_t
GLDRV_OPENGL_ES2,
GLDRV_OPENGL_ES3,
GLDRV_OPENGL_MESA, // fear this, it is probably the best to disable GPU skinning and run shaders in GLSL ES 1.0
GLDRV_OPENGL_MESA_CORE_PROFILE
};
// RB end

View file

@ -350,12 +350,19 @@ static void R_CheckPortableExtensions()
// RB: Mesa support
if( idStr::Icmpn( glConfig.renderer_string, "Mesa", 4 ) == 0 || idStr::Icmpn( glConfig.renderer_string, "X.org", 4 ) == 0 || idStr::Icmpn( glConfig.renderer_string, "Gallium", 7 ) == 0 )
{
glConfig.driverType = GLDRV_OPENGL_MESA;
if( glConfig.driverType == GLDRV_OPENGL32_CORE_PROFILE )
{
glConfig.driverType = GLDRV_OPENGL_MESA_CORE_PROFILE;
}
else
{
glConfig.driverType = GLDRV_OPENGL_MESA;
}
}
// RB end
// GL_ARB_multitexture
if( glConfig.driverType == GLDRV_OPENGL32_COMPATIBILITY_PROFILE || glConfig.driverType == GLDRV_OPENGL32_CORE_PROFILE || glConfig.driverType == GLDRV_OPENGL_MESA )
if( glConfig.driverType != GLDRV_OPENGL3X )
{
glConfig.multitextureAvailable = true;
}
@ -370,8 +377,14 @@ static void R_CheckPortableExtensions()
// GL_ARB_texture_compression + GL_S3_s3tc
// DRI drivers may have GL_ARB_texture_compression but no GL_EXT_texture_compression_s3tc
glConfig.textureCompressionAvailable = GLEW_ARB_texture_compression != 0 && GLEW_EXT_texture_compression_s3tc != 0;
if( glConfig.driverType == GLDRV_OPENGL_MESA_CORE_PROFILE )
{
glConfig.textureCompressionAvailable = true;
}
else
{
glConfig.textureCompressionAvailable = GLEW_ARB_texture_compression != 0 && GLEW_EXT_texture_compression_s3tc != 0;
}
// GL_EXT_texture_filter_anisotropic
glConfig.anisotropicFilterAvailable = GLEW_EXT_texture_filter_anisotropic != 0;
if( glConfig.anisotropicFilterAvailable )
@ -406,13 +419,34 @@ static void R_CheckPortableExtensions()
r_useSRGB.SetModified(); // the CheckCvars() next frame will enable / disable it
// GL_ARB_vertex_buffer_object
glConfig.vertexBufferObjectAvailable = GLEW_ARB_vertex_buffer_object != 0;
if( glConfig.driverType == GLDRV_OPENGL_MESA_CORE_PROFILE )
{
glConfig.vertexBufferObjectAvailable = true;
}
else
{
glConfig.vertexBufferObjectAvailable = GLEW_ARB_vertex_buffer_object != 0;
}
// GL_ARB_map_buffer_range, map a section of a buffer object's data store
glConfig.mapBufferRangeAvailable = GLEW_ARB_map_buffer_range != 0;
//if( glConfig.driverType == GLDRV_OPENGL_MESA_CORE_PROFILE )
//{
// glConfig.mapBufferRangeAvailable = true;
//}
//else
{
glConfig.mapBufferRangeAvailable = GLEW_ARB_map_buffer_range != 0;
}
// GL_ARB_vertex_array_object
glConfig.vertexArrayObjectAvailable = GLEW_ARB_vertex_array_object != 0;
//if( glConfig.driverType == GLDRV_OPENGL_MESA_CORE_PROFILE )
//{
// glConfig.vertexArrayObjectAvailable = true;
//}
//else
{
glConfig.vertexArrayObjectAvailable = GLEW_ARB_vertex_array_object != 0;
}
// GL_ARB_draw_elements_base_vertex
glConfig.drawElementsBaseVertexAvailable = GLEW_ARB_draw_elements_base_vertex != 0;
@ -470,18 +504,18 @@ static void R_CheckPortableExtensions()
common->Printf( "X..%s not found\n", "GL_GREMEDY_string_marker" );
}
// GL_EXT_framebuffer_object
glConfig.framebufferObjectAvailable = GLEW_EXT_framebuffer_object != 0;
// GL_ARB_framebuffer_object
glConfig.framebufferObjectAvailable = GLEW_ARB_framebuffer_object != 0;
if( glConfig.framebufferObjectAvailable )
{
glGetIntegerv( GL_MAX_RENDERBUFFER_SIZE, &glConfig.maxRenderbufferSize );
glGetIntegerv( GL_MAX_COLOR_ATTACHMENTS, &glConfig.maxColorAttachments );
common->Printf( "...using %s\n", "GL_EXT_framebuffer_object" );
common->Printf( "...using %s\n", "GL_ARB_framebuffer_object" );
}
else
{
common->Printf( "X..%s not found\n", "GL_EXT_framebuffer_object" );
common->Printf( "X..%s not found\n", "GL_ARB_framebuffer_object" );
}
// GL_EXT_framebuffer_blit
@ -492,7 +526,7 @@ static void R_CheckPortableExtensions()
}
else
{
common->Printf( "X..%s not found\n", "GL_EXT_framebuffer_object" );
common->Printf( "X..%s not found\n", "GL_EXT_framebuffer_blit" );
}
// GL_ARB_debug_output
@ -549,10 +583,10 @@ static void R_CheckPortableExtensions()
idLib::Error( "GL_ARB_draw_elements_base_vertex not available" );
}
// GL_ARB_vertex_program / GL_ARB_fragment_program
if( !glConfig.fragmentProgramAvailable )
{
idLib::Warning( "GL_ARB_fragment_program not available" );
}
//if( !glConfig.fragmentProgramAvailable )
//{
// idLib::Warning( "GL_ARB_fragment_program not available" );
//}
// GLSL
if( !glConfig.glslAvailable )
{
@ -793,10 +827,11 @@ void R_InitOpenGL()
float glVersion = atof( glConfig.version_string );
float glslVersion = atof( glConfig.shading_language_string );
idLib::Printf( "OpenGL Version : %3.1f\n", glVersion );
idLib::Printf( "OpenGL Vendor : %s\n", glConfig.vendor_string );
idLib::Printf( "OpenGL Renderer : %s\n", glConfig.renderer_string );
idLib::Printf( "OpenGL GLSL : %3.1f\n", glslVersion );
idLib::Printf( "OpenGL Version : %3.1f\n", glVersion );
idLib::Printf( "OpenGL Vendor : %s\n", glConfig.vendor_string );
idLib::Printf( "OpenGL Renderer : %s\n", glConfig.renderer_string );
idLib::Printf( "OpenGL GLSL : %3.1f\n", glslVersion );
idLib::Printf( "OpenGL Extensions: %s\n", glConfig.extensions_string );
// OpenGL driver constants
GLint temp;

View file

@ -587,6 +587,7 @@ static void RB_ShowLightCount()
}
}
#if 0
/*
===============
RB_SetWeaponDepthHack
@ -669,6 +670,7 @@ static void RB_LoadMatrixWithBypass( const float m[16] )
glLoadMatrixf( m );
}
#endif
/*
====================
RB_RenderDrawSurfListWithFunction
@ -690,6 +692,7 @@ static void RB_RenderDrawSurfListWithFunction( drawSurf_t** drawSurfs, int numDr
{
continue;
}
assert( drawSurf->space != NULL );
// RB begin

View file

@ -835,18 +835,6 @@ void Sys_Sleep( int msec )
#endif
}
char* Sys_GetClipboardData()
{
Sys_Printf( "TODO: Sys_GetClipboardData\n" );
return NULL;
}
void Sys_SetClipboardData( const char* string )
{
Sys_Printf( "TODO: Sys_SetClipboardData\n" );
}
// stub pretty much everywhere - heavy calling
void Sys_FlushCacheMemory( void* base, int bytes )
{

View file

@ -1731,6 +1731,36 @@ const char* Sys_GetKeyName( keyNum_t keynum )
return NULL;
}
char* Sys_GetClipboardData()
{
#if SDL_VERSION_ATLEAST(2, 0, 0)
char* txt = SDL_GetClipboardText();
if( txt == NULL )
{
return NULL;
}
else if( txt[0] == '\0' )
{
SDL_free( txt );
return NULL;
}
char* ret = Mem_CopyString( txt );
SDL_free( txt );
return ret;
#else
return NULL; // SDL1.2 doesn't support clipboard
#endif
}
void Sys_SetClipboardData( const char* string )
{
#if SDL_VERSION_ATLEAST(2, 0, 0)
SDL_SetClipboardText( string );
#endif
}
//=====================================================================================
// Joystick Input Handling