Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
faf3669
refactor(IW3): rework image loader to remove dependency on `d3d9ltcg.…
michaeloliverx Jun 25, 2026
3120b02
refactor: IW3 enhance image replacement ergonomics
michaeloliverx Jun 26, 2026
6b3f0d8
feat: IW4 raw image loader
michaeloliverx Jun 26, 2026
57e8d1f
feat: T4 raw image loader
michaeloliverx Jun 26, 2026
d9ddc32
refactor: move dds handling to module, cleanup iw4 loader
michaeloliverx Jun 26, 2026
c8690c3
refactor: split dds types
michaeloliverx Jun 26, 2026
3b55ec1
refactor: implement endian byte swap utility functions
michaeloliverx Jun 26, 2026
002e00d
refactor: cleanup IW3 loader
michaeloliverx Jun 26, 2026
ff7b04c
refactor: extract image writing
michaeloliverx Jun 26, 2026
104d6ed
refactor: reduce duplication with shared image helpers
michaeloliverx Jun 26, 2026
7c67d13
fix: bounds issue when dumping images
michaeloliverx Jun 26, 2026
e0e95ca
feat: prefer highmip level when dumping textures
michaeloliverx Jun 26, 2026
ecc6fcf
chore: cleanup log messages
michaeloliverx Jun 26, 2026
b1a84a6
feat: IW4 image dumping
michaeloliverx Jun 28, 2026
eeb5dc7
chore: update IW3 CodJumper RPG texture
michaeloliverx Jun 28, 2026
1036474
refactor: IW4 add `dump_assets` dvar
michaeloliverx Jun 28, 2026
b0c254c
refactor: add `dump_assets` to config
michaeloliverx Jun 28, 2026
33265a9
feat: add `userraw` path for local overridden textures
michaeloliverx Jun 28, 2026
8721b93
fix: IW4 use hunk allocated scratch for streamed images
michaeloliverx Jun 28, 2026
8cfba5b
stash
michaeloliverx Jun 28, 2026
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
13 changes: 13 additions & 0 deletions codxe.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,11 @@
</ClCompile>

<ClCompile Include="src\common\config.cpp" />
<ClCompile Include="src\image\dds_loader.cpp" />
<ClCompile Include="src\image\dds_writer.cpp" />
<ClCompile Include="src\image\texture_layout.cpp" />
<ClCompile Include="src\image\xenos_texture.cpp" />
<ClCompile Include="src\utils\endian.cpp" />

<ClCompile Include="src\game\iw2\sp\components\scr_parser.cpp" />
<ClCompile Include="src\game\iw2\sp\main.cpp" />
Expand Down Expand Up @@ -134,6 +139,7 @@
<ClCompile Include="src\game\iw4\mp_tu6\components\events.cpp" />
<ClCompile Include="src\game\iw4\mp_tu6\components\g_client_fields.cpp" />
<ClCompile Include="src\game\iw4\mp_tu6\components\g_scr_main.cpp" />
<ClCompile Include="src\game\iw4\mp_tu6\components\image_loader.cpp" />
<ClCompile Include="src\game\iw4\mp_tu6\components\mpsp.cpp" />
<ClCompile Include="src\game\iw4\mp_tu6\components\mr.cpp" />
<ClCompile Include="src\game\iw4\mp_tu6\components\patches.cpp" />
Expand Down Expand Up @@ -203,6 +209,12 @@

<ClInclude Include="src\common\branding.h" />
<ClInclude Include="src\common\config.h" />
<ClInclude Include="src\image\dds_loader.h" />
<ClInclude Include="src\image\dds_types.h" />
<ClInclude Include="src\image\dds_writer.h" />
<ClInclude Include="src\image\texture_layout.h" />
<ClInclude Include="src\image\xenos_texture.h" />
<ClInclude Include="src\utils\endian.h" />

<ClInclude Include="src\game\iw2\sp\components\scr_parser.h" />
<ClInclude Include="src\game\iw2\sp\main.h" />
Expand Down Expand Up @@ -262,6 +274,7 @@
<ClInclude Include="src\game\iw4\mp_tu6\components\events.h" />
<ClInclude Include="src\game\iw4\mp_tu6\components\g_client_fields.h" />
<ClInclude Include="src\game\iw4\mp_tu6\components\g_scr_main.h" />
<ClInclude Include="src\game\iw4\mp_tu6\components\image_loader.h" />
<ClInclude Include="src\game\iw4\mp_tu6\components\mpsp.h" />
<ClInclude Include="src\game\iw4\mp_tu6\components\mr.h" />
<ClInclude Include="src\game\iw4\mp_tu6\components\patches.h" />
Expand Down
Binary file not shown.
Binary file not shown.
18 changes: 6 additions & 12 deletions src/common/config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@

const char *CONFIG_PATH = "game:\\_codxe\\codxe.json";
const char *MOD_DIR = "game:\\_codxe\\mods";
const char *USERRAW_DIR = "game:\\_codxe\\userraw";
const char *DUMP_DIR = "game:\\_codxe\\dump";

// Default values
std::string Config::active_mod = "";
bool Config::dump_rawfile = false;
bool Config::dump_map_ents = false;
bool Config::dump_assets = false;
std::string Config::mod_base_path = "";

namespace
Expand Down Expand Up @@ -203,8 +203,7 @@ Config::~Config()
// Reset to defaults on cleanup
active_mod = "";
mod_base_path = "";
dump_rawfile = false;
dump_map_ents = false;
dump_assets = false;
DbgPrint("[codxe][Config] Configuration unloaded\n");
}

Expand Down Expand Up @@ -243,13 +242,9 @@ bool Config::LoadFromJson(const char *jsonBuffer, DWORD bufferSize)
wcstombs(narrowValue, valueBuffer, sizeof(narrowValue));
active_mod = narrowValue;
}
else if (wcscmp(propertyName, L"dump_rawfile") == 0)
else if (wcscmp(propertyName, L"dump_assets") == 0)
{
dump_rawfile = (jsonTokenType == Json_True);
}
else if (wcscmp(propertyName, L"dump_map_ents") == 0)
{
dump_map_ents = (jsonTokenType == Json_True);
dump_assets = (jsonTokenType == Json_True);
}
else
{
Expand All @@ -262,8 +257,7 @@ bool Config::LoadFromJson(const char *jsonBuffer, DWORD bufferSize)

DbgPrint("[codxe][Config] Configuration loaded:\n");
DbgPrint(" Active Mod: %s\n", active_mod.c_str());
DbgPrint(" Dump Raw Scripts: %s\n", dump_rawfile ? "true" : "false");
DbgPrint(" Dump Map Entities: %s\n", dump_map_ents ? "true" : "false");
DbgPrint(" Dump Assets: %s\n", dump_assets ? "true" : "false");

if (!active_mod.empty())
{
Expand Down
4 changes: 2 additions & 2 deletions src/common/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

extern const char *CONFIG_PATH;
extern const char *MOD_DIR;
extern const char *USERRAW_DIR;
extern const char *DUMP_DIR;

bool DirectoryExists(const char *path);
Expand All @@ -23,8 +24,7 @@ class Config : public Module

static std::string active_mod;
static std::string mod_base_path;
static bool dump_rawfile;
static bool dump_map_ents;
static bool dump_assets;

static std::string GetModBasePath();
static const char *GetModBasePathCStr();
Expand Down
2 changes: 1 addition & 1 deletion src/game/iw2/mp/components/scr_parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ char *Scr_AddSourceBuffer_Hook(const char *filename, const char *extFilename, co
archive);
};

if (Config::dump_rawfile)
if (Config::dump_assets)
{
DbgPrint("GSCLoader: Dumping script %s\n", extFilename);
auto contents = callOriginal();
Expand Down
2 changes: 1 addition & 1 deletion src/game/iw2/sp/components/scr_parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ char *Scr_AddSourceBuffer_Hook(const char *filename, const char *extFilename, co
archive);
};

if (Config::dump_rawfile)
if (Config::dump_assets)
{
DbgPrint("GSCLoader: Dumping script %s\n", extFilename);
auto contents = callOriginal();
Expand Down
Loading
Loading