Skip to content

Commit 20302a8

Browse files
committed
Merge remote-tracking branch 'intorr/intorr_dev' into xd_dev
2 parents 97ee2ee + 9f41ddc commit 20302a8

24 files changed

+98
-550
lines changed

src/utils/xrAI/StdAfx.cpp

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,21 @@
11
#include "stdafx.h"
2+
#include "xrCore/cdecl_cast.hpp"
3+
#include "utils/xrLCUtil/LevelCompilerLoggerWindow.hpp"
4+
5+
ILevelCompilerLogger& Logger = LevelCompilerLoggerWindow::instance();
6+
7+
CThread::LogFunc ProxyMsg = cdecl_cast([](const char* format, ...) {
8+
va_list args;
9+
va_start(args, format);
10+
Logger.clMsgV(format, args);
11+
va_end(args);
12+
});
13+
14+
CThreadManager::ReportStatusFunc ProxyStatus = cdecl_cast([](const char* format, ...) {
15+
va_list args;
16+
va_start(args, format);
17+
Logger.StatusV(format, args);
18+
va_end(args);
19+
});
20+
21+
CThreadManager::ReportProgressFunc ProxyProgress = cdecl_cast([](float progress) { Logger.Progress(progress); });

src/utils/xrAI/StdAfx.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@
1010
#include <d3dx9.h>
1111
#include "Common/_d3d_extensions.h"
1212

13-
#include "utils/xrLCUtil/LevelCompilerLoggerWindow.hpp"
13+
#include "utils/xrLCUtil/ILevelCompilerLogger.hpp"
1414
#include "utils/xrLCUtil/xrThread.hpp"
1515

16-
extern LevelCompilerLoggerWindow& Logger;
16+
extern ILevelCompilerLogger& Logger;
1717
extern CThread::LogFunc ProxyMsg;
1818
extern CThreadManager::ReportStatusFunc ProxyStatus;
1919
extern CThreadManager::ReportProgressFunc ProxyProgress;

src/utils/xrAI/xrAI.cpp

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -9,32 +9,13 @@
99

1010
#pragma comment(lib, "winmm.LIB")
1111

12-
#include "xrCore/cdecl_cast.hpp"
1312
#include "xrCore/ModuleLookup.hpp"
1413

1514
#include "factory_api.h"
1615

1716
Factory_Create* create_entity = 0;
1817
Factory_Destroy* destroy_entity = 0;
1918

20-
LevelCompilerLoggerWindow& Logger = LevelCompilerLoggerWindow();
21-
22-
CThread::LogFunc ProxyMsg = cdecl_cast([](const char* format, ...) {
23-
va_list args;
24-
va_start(args, format);
25-
Logger.clMsgV(format, args);
26-
va_end(args);
27-
});
28-
29-
CThreadManager::ReportStatusFunc ProxyStatus = cdecl_cast([](const char* format, ...) {
30-
va_list args;
31-
va_start(args, format);
32-
Logger.StatusV(format, args);
33-
va_end(args);
34-
});
35-
36-
CThreadManager::ReportProgressFunc ProxyProgress = cdecl_cast([](float progress) { Logger.Progress(progress); });
37-
3819
extern void xrCompiler(LPCSTR name, bool draft_mode, bool pure_covers, LPCSTR out_name);
3920
extern void verify_level_graph(LPCSTR name, bool verbose);
4021

@@ -184,7 +165,7 @@ void Startup(LPSTR lpCmdLine)
184165
int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
185166
{
186167
xrDebug::Initialize(false);
187-
Core.Initialize("xrai", 0);
168+
Core.Initialize("xrAI");
188169

189170
Startup(lpCmdLine);
190171

src/utils/xrDO_Light/StdAfx.cpp

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,21 @@
11
#include "stdafx.h"
2+
#include "xrCore/cdecl_cast.hpp"
3+
#include "utils/xrLCUtil/LevelCompilerLoggerWindow.hpp"
4+
5+
ILevelCompilerLogger& Logger = LevelCompilerLoggerWindow::instance();
6+
7+
CThread::LogFunc ProxyMsg = cdecl_cast([](const char* format, ...) {
8+
va_list args;
9+
va_start(args, format);
10+
Logger.clMsgV(format, args);
11+
va_end(args);
12+
});
13+
14+
CThreadManager::ReportStatusFunc ProxyStatus = cdecl_cast([](const char* format, ...) {
15+
va_list args;
16+
va_start(args, format);
17+
Logger.StatusV(format, args);
18+
va_end(args);
19+
});
20+
21+
CThreadManager::ReportProgressFunc ProxyProgress = cdecl_cast([](float progress) { Logger.Progress(progress); });

src/utils/xrDO_Light/StdAfx.h

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,11 @@
11
#pragma once
22

33
#include "Common/Common.hpp"
4-
#include "xrCore/xrCore.h"
5-
6-
#pragma warning(push)
7-
#pragma warning(disable : 4995)
8-
#include <d3dx9.h>
9-
#include <commctrl.h>
10-
#pragma warning(pop)
11-
12-
#define ENGINE_API
13-
#define ECORE_API
14-
#define XR_EPROPS_API
15-
#include "xrCore/clsid.h"
16-
#include "xrCDB/xrCDB.h"
17-
#include "Common/_d3d_extensions.h"
18-
19-
#include <fcntl.h>
20-
#include <sys/types.h>
21-
#include <sys/stat.h>
22-
#include <io.h>
23-
#include <stdio.h>
24-
25-
#ifdef AI_COMPILER
26-
#include "smart_cast.h"
27-
#endif
284

295
#include "utils/xrLCUtil/ILevelCompilerLogger.hpp"
306
#include "utils/xrLCUtil/xrThread.hpp"
31-
#include "xrCore/cdecl_cast.hpp"
32-
#include "xrScriptEngine/DebugMacros.hpp" // XXX: move debug macros to xrCore
337

348
extern ILevelCompilerLogger& Logger;
359
extern CThread::LogFunc ProxyMsg;
3610
extern CThreadManager::ReportStatusFunc ProxyStatus;
3711
extern CThreadManager::ReportProgressFunc ProxyProgress;
38-
39-
#define READ_IF_EXISTS(ltx, method, section, name, default_value)\
40-
(ltx->line_exist(section, name)) ? ltx->method(section, name) : default_value

src/utils/xrDO_Light/xrDO_Light.cpp

Lines changed: 1 addition & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,19 @@
11
#include "stdafx.h"
2-
#include "process.h"
32

43
#include "utils/xrLC_Light/xrlc_light.h"
5-
#include "utils/xrLCUtil/LevelCompilerLoggerWindow.hpp"
6-
#include "xrCore/cdecl_cast.hpp"
7-
#include "utils/xrLCUtil/xrLCUtil.hpp"
84
//#pragma comment(linker,"/STACK:0x800000,0x400000")
95

10-
#pragma comment(lib, "comctl32.lib")
11-
#pragma comment(lib, "winmm.LIB")
12-
13-
ILevelCompilerLogger& Logger = LevelCompilerLoggerWindow();
14-
15-
CThread::LogFunc ProxyMsg = cdecl_cast([](const char* format, ...) {
16-
va_list args;
17-
va_start(args, format);
18-
Logger.clMsgV(format, args);
19-
va_end(args);
20-
});
21-
22-
CThreadManager::ReportStatusFunc ProxyStatus = cdecl_cast([](const char* format, ...) {
23-
va_list args;
24-
va_start(args, format);
25-
Logger.StatusV(format, args);
26-
va_end(args);
27-
});
28-
29-
CThreadManager::ReportProgressFunc ProxyProgress = cdecl_cast([](float progress) { Logger.Progress(progress); });
30-
316
static const char* h_str =
327
"The following keys are supported / required:\n"
338
"-? or -h == this help\n"
349
"-f<NAME> == compile level in gamedata\\levels\\<NAME>\\\n"
35-
"-o == modify build options\n"
3610
"\n"
3711
"NOTE: The last key is required for any functionality\n";
3812

3913
void Help() { MessageBox(0, h_str, "Command line options", MB_OK | MB_ICONINFORMATION); }
4014
void Startup(LPSTR lpCmdLine)
4115
{
4216
char cmd[512];
43-
// BOOL bModifyOptions = FALSE;
4417
bool bNet = false;
4518
xr_strcpy(cmd, lpCmdLine);
4619
_strlwr(cmd);
@@ -54,7 +27,6 @@ void Startup(LPSTR lpCmdLine)
5427
Help();
5528
return;
5629
}
57-
// if (strstr(cmd,"-o")) bModifyOptions = TRUE;
5830
if (strstr(cmd, "-net"))
5931
bNet = true;
6032
// Load project
@@ -65,7 +37,6 @@ void Startup(LPSTR lpCmdLine)
6537
xr_sprintf(temp, "%s - Detail Compiler", name);
6638
Logger.Initialize(temp);
6739

68-
// FS.update_path (name,"$game_levels$",name);
6940
FS.get_path("$level$")->_set(name);
7041

7142
CTimer dwStartupTime;
@@ -84,9 +55,9 @@ void Startup(LPSTR lpCmdLine)
8455

8556
int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
8657
{
87-
// Initialize debugging
8858
xrDebug::Initialize(false);
8959
Core.Initialize("xrDO");
60+
9061
Startup(lpCmdLine);
9162

9263
return 0;

src/utils/xrDXT/DXT.cpp

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,19 @@
22
#include "dxtlib.h"
33
#include <nvtt/nvtt.h>
44
#include "ETextureParams.h"
5-
#include "dds.h"
5+
//#include "dds.h"
66

7-
BOOL APIENTRY DllMain(HANDLE hModule, u32 ul_reason_for_call, LPVOID lpReserved) { return TRUE; }
7+
//BOOL APIENTRY DllMain(HANDLE hModule, u32 ul_reason_for_call, LPVOID lpReserved) { return TRUE; }
88
static HFILE gFileOut;
99
static HFILE gFileIn;
1010

11-
const u32 fcc_DXT1 = MAKEFOURCC('D', 'X', 'T', '1');
11+
/*const u32 fcc_DXT1 = MAKEFOURCC('D', 'X', 'T', '1');
1212
const u32 fcc_DXT2 = MAKEFOURCC('D', 'X', 'T', '2');
1313
const u32 fcc_DXT3 = MAKEFOURCC('D', 'X', 'T', '3');
1414
const u32 fcc_DXT4 = MAKEFOURCC('D', 'X', 'T', '4');
15-
const u32 fcc_DXT5 = MAKEFOURCC('D', 'X', 'T', '5');
15+
const u32 fcc_DXT5 = MAKEFOURCC('D', 'X', 'T', '5');*/
1616

17-
void __cdecl WriteDTXnFile(DWORD count, void* buffer, void* userData)
17+
/*void __cdecl WriteDTXnFile(DWORD count, void* buffer, void* userData)
1818
{
1919
if (count == sizeof(DDS_HEADER))
2020
{
@@ -32,7 +32,7 @@ void __cdecl WriteDTXnFile(DWORD count, void* buffer, void* userData)
3232
}
3333
}
3434
_write(gFileOut, buffer, count);
35-
}
35+
}*/
3636

3737
class DDSWriter : public nvtt::OutputHandler
3838
{
@@ -48,7 +48,7 @@ DDSWriter::DDSWriter(HFILE& file) : file(file) {}
4848
void DDSWriter::beginImage(int size, int width, int height, int depth, int face, int miplevel) {}
4949
bool DDSWriter::writeData(const void* data, int size)
5050
{
51-
if (size == sizeof(DDS_HEADER))
51+
/*if (size == sizeof(DDS_HEADER))
5252
{
5353
DDS_HEADER* hdr = (DDS_HEADER*)data;
5454
if (hdr->dwSize == size)
@@ -62,7 +62,7 @@ bool DDSWriter::writeData(const void* data, int size)
6262
case fcc_DXT5: hdr->ddspf.dwRGBBitCount = 0; break;
6363
}
6464
}
65-
}
65+
}*/
6666
_write(file, data, size);
6767
return true;
6868
}
@@ -89,15 +89,15 @@ void DDSErrorHandler::error(nvtt::Error e)
8989
MessageBox(0, msg, "DXT compress error", MB_ICONERROR | MB_OK);
9090
}
9191

92-
void __cdecl ReadDTXnFile(DWORD count, void* buffer, void* userData) { _read(gFileIn, buffer, count); }
92+
/*void __cdecl ReadDTXnFile(DWORD count, void* buffer, void* userData) { _read(gFileIn, buffer, count); }
9393
HRESULT WriteCompressedData(void* data, int miplevel, u32 size)
9494
{
9595
_write(gFileOut, data, size);
9696
FillMemory(data, size, 0xff);
9797
return 0;
98-
}
98+
}*/
9999

100-
ENGINE_API u32* Build32MipLevel(u32& _w, u32& _h, u32& _p, u32* pdwPixelSrc, STextureParams* fmt, float blend)
100+
/*ENGINE_API*/ u32* Build32MipLevel(u32& _w, u32& _h, u32& _p, u32* pdwPixelSrc, STextureParams* fmt, float blend)
101101
{
102102
R_ASSERT(pdwPixelSrc);
103103
R_ASSERT(_w % 2 == 0);
@@ -260,7 +260,7 @@ int DXTCompressImage(LPCSTR out_name, u8* raw_data, u32 w, u32 h, u32 pitch, STe
260260
u8* pixel = pImagePixels;
261261
for (u32 k = 0; k < w * 2 * h; k++, pixel += 4)
262262
{
263-
pixels[k].set(pixel[2], pixel[1], pixel[0], pixel[3]);
263+
pixels[k].set(pixel[0], pixel[1], pixel[2], pixel[3]);
264264
}
265265
inOpt.setMipmapData(pixels, w, h);
266266
result = nvtt::Compressor().process(inOpt, compOpt, outOpt);
@@ -272,7 +272,7 @@ int DXTCompressImage(LPCSTR out_name, u8* raw_data, u32 w, u32 h, u32 pitch, STe
272272
rgba_t* pixels = pImage.pixels();
273273
u8* pixel = raw_data;
274274
for (u32 k = 0; k < w * h; k++, pixel += 4)
275-
pixels[k].set(pixel[2], pixel[1], pixel[0], pixel[3]);
275+
pixels[k].set(pixel[0], pixel[1], pixel[2], pixel[3]);
276276
inOpt.setMipmapData(pixels, w, h);
277277
result = nvtt::Compressor().process(inOpt, compOpt, outOpt);
278278
}

src/utils/xrDXT/StdAfx.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#pragma once
22

3-
#define ENGINE_API
4-
#define XR_EPROPS_API
3+
//#define ENGINE_API
4+
//#define XR_EPROPS_API
55
#define ECORE_API
66

77
#include "Common/Common.hpp"

src/utils/xrLC/StdAfx.cpp

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,21 @@
11
#include "stdafx.h"
2+
#include "xrCore/cdecl_cast.hpp"
3+
#include "utils/xrLCUtil/LevelCompilerLoggerWindow.hpp"
4+
5+
ILevelCompilerLogger& Logger = LevelCompilerLoggerWindow::instance();
6+
7+
CThread::LogFunc ProxyMsg = cdecl_cast([](const char* format, ...) {
8+
va_list args;
9+
va_start(args, format);
10+
Logger.clMsgV(format, args);
11+
va_end(args);
12+
});
13+
14+
CThreadManager::ReportStatusFunc ProxyStatus = cdecl_cast([](const char* format, ...) {
15+
va_list args;
16+
va_start(args, format);
17+
Logger.StatusV(format, args);
18+
va_end(args);
19+
});
20+
21+
CThreadManager::ReportProgressFunc ProxyProgress = cdecl_cast([](float progress) { Logger.Progress(progress); });

src/utils/xrLC/StdAfx.h

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,12 @@
11
#pragma once
2-
#include <memory>
3-
#include "Common/Common.hpp"
4-
#include "utils/xrLC_Light/xrLC_Light.h"
52

6-
#define ENGINE_API // fake, to enable sharing with engine
7-
// comment - ne figa oni ne sharyatsya
3+
#define ENGINE_API
84

9-
#define ECORE_API // fake, to enable sharing with editors
10-
#define XR_EPROPS_API
11-
#include "xrCore/clsid.h"
5+
#include "Common/Common.hpp"
6+
#include "utils/xrLC_Light/xrLC_Light.h"
127

138
#include "utils/xrLCUtil/ILevelCompilerLogger.hpp"
149
#include "utils/xrLCUtil/xrThread.hpp"
15-
#include "xrCore/cdecl_cast.hpp"
1610

1711
extern ILevelCompilerLogger& Logger;
1812
extern CThread::LogFunc ProxyMsg;

0 commit comments

Comments
 (0)