Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions code/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ TARGET_LINK_LIBRARIES(code PUBLIC compiler)

target_link_libraries(code PUBLIC md5)

target_link_libraries(code PUBLIC etcpak)

if (FSO_BUILD_WITH_DISCORD)
target_link_libraries(code PUBLIC discord-rpc)
add_definitions(-DWITH_DISCORD)
Expand Down
8 changes: 8 additions & 0 deletions code/bmpman/bmpman.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1154,6 +1154,14 @@ static int bm_load_info(BM_TYPE type, const char *filename, CFILE *img_cfp, int
*c_type = BM_TYPE_BC7;
break;

case DDS_ETC2_RGBA8:
*c_type = BM_TYPE_ETC2_RGBA_EAC;
break;

case DDS_ETC2_RGB:
*c_type = BM_TYPE_ETC2_RGB;
break;

case DDS_UNCOMPRESSED:
*c_type = BM_TYPE_DDS;
break;
Expand Down
25 changes: 25 additions & 0 deletions code/cfile/cfile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -566,6 +566,31 @@ int cf_rename(const char *old_name, const char *name, int dir_type)

}

int cf_rename(const char* old_name, const char* name, int dir_type, int location_flags)
{
Assert(CF_TYPE_SPECIFIED(dir_type));

int ret_code;
SCP_string old_longname;
SCP_string new_longname;

cf_create_default_path_string(old_longname, dir_type, old_name, location_flags);
cf_create_default_path_string(new_longname, dir_type, name, location_flags);

ret_code = rename(old_longname.c_str(), new_longname.c_str());
if (ret_code != 0) {
switch (errno) {
case EACCES:
return CF_RENAME_FAIL_ACCESS;
case ENOENT:
default:
return CF_RENAME_FAIL_EXIST;
}
}

return CF_RENAME_SUCCESS;
}


// This takes a path (e.g. "C:\Games\FreeSpace2\Lots\More\Directories") and creates it in its entirety.
// Do note that this requires the path to have normalized directory separators as defined by DIR_SEPARATOR_CHAR
Expand Down
2 changes: 2 additions & 0 deletions code/cfile/cfile.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ struct CFILE;
// extra info that can be returned when getting a file listing
typedef struct {
time_t write_time;
size_t size;
} file_list_info;


Expand Down Expand Up @@ -289,6 +290,7 @@ uint cf_add_chksum_long(uint seed, ubyte *buffer, size_t size);
#define CF_RENAME_FAIL_ACCESS 1 // new name could not be created
#define CF_RENAME_FAIL_EXIST 2 // old name does not exist
int cf_rename(const char *old_name, const char *name, int type = CF_TYPE_ANY );
int cf_rename(const char *old_name, const char *name, int type, int location_flags);

// Creates the directory path if it doesn't exist. Even creates all its
// parent paths.
Expand Down
2 changes: 2 additions & 0 deletions code/cfile/cfilesystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1800,6 +1800,7 @@ int cf_get_file_list(SCP_vector<SCP_string>& list, int pathtype, const char* _fi

if (info) {
tinfo.write_time = file.m_time;
tinfo.size = file.size;
info->push_back(tinfo);
}
}
Expand Down Expand Up @@ -1873,6 +1874,7 @@ int cf_get_file_list(SCP_vector<SCP_string>& list, int pathtype, const char* _fi

if (info) {
tinfo.write_time = file.m_time;
tinfo.size = file.size;
info->push_back(tinfo);
}
}
Expand Down
8 changes: 8 additions & 0 deletions code/cmdline/cmdline.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,7 @@ Flag exe_params[] =
{ "-log_multi_packet", "Log multi packet types ", true, 0, EASY_DEFAULT, "Troubleshoot", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-log_multi_packet",},
{ "-no_bsp_align", "Disable pof BSP data alignment", true, 0, EASY_DEFAULT, "Troubleshoot", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-no_bsp_align", },
{ "-no_large_shaders", "Split large shader into smaller shaders", true, 0, EASY_DEFAULT, "Troubleshoot", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-no_large_shaders", },
{ "-no_transcode_cache","Disables the texture transcode cache", true, 0, EASY_DEFAULT, "Troubleshoot", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-no_transcode_cache", },

#ifdef WIN32
{ "-fix_registry", "Use a different registry path", true, 0, EASY_DEFAULT, "Troubleshoot", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-fix_registry", },
Expand Down Expand Up @@ -470,6 +471,7 @@ cmdline_parm no_large_shaders("-no_large_shaders", NULL, AT_NONE);
#ifdef WIN32
cmdline_parm fix_registry("-fix_registry", NULL, AT_NONE);
#endif
cmdline_parm no_transcode_cache_arg("-no_transcode_cache", nullptr, AT_NONE);

int Cmdline_load_all_weapons = 0;
int Cmdline_nomovies = 0;
Expand All @@ -494,6 +496,7 @@ bool Cmdline_no_large_shaders = false;
#ifdef WIN32
bool Cmdline_alternate_registry_path = false;
#endif
bool Cmdline_no_transcode_cache = false;
uint Cmdline_rng_seed = 0;
bool Cmdline_reuse_rng_seed = false;

Expand Down Expand Up @@ -2162,6 +2165,11 @@ bool SetCmdlineParams()
if (no_large_shaders.found()) {
Cmdline_no_large_shaders = true;
}

if (no_transcode_cache_arg.found())
{
Cmdline_no_transcode_cache = true;
}

#ifdef WIN32
if (fix_registry.found()) {
Expand Down
1 change: 1 addition & 0 deletions code/cmdline/cmdline.h
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ extern bool Cmdline_no_large_shaders;
#ifdef WIN32
extern bool Cmdline_alternate_registry_path;
#endif
extern bool Cmdline_no_transcode_cache;

// Developer/Testing related
extern char *Cmdline_start_mission;
Expand Down
Loading
Loading