Skip to content

Commit

Permalink
Move common LC UI to xrUtil (xrLCUtil).
Browse files Browse the repository at this point in the history
  • Loading branch information
nitrocaster committed Sep 28, 2015
1 parent 10c6b47 commit 32a7801
Show file tree
Hide file tree
Showing 124 changed files with 1,218 additions and 2,051 deletions.
2 changes: 1 addition & 1 deletion src/engine.sln
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "xrPostprocessEditor", "edit
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "xrManagedApi", "editors\xrManagedApi\xrManagedApi.vcxproj", "{55B0E2CA-E27A-47FC-BC92-21ABDC1044F5}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "xrUtil", "utils\xrUtil\xrUtil.vcxproj", "{B90BDC22-A891-4B33-B562-29D701F65DBD}"
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "xrLCUtil", "utils\xrLCUtil\xrLCUtil.vcxproj", "{B90BDC22-A891-4B33-B562-29D701F65DBD}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down
2 changes: 1 addition & 1 deletion src/utils/Shader_xrLC.h
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ IC void post_process_materials(const Shader_xrLC_LIB &shaders, const xr_vecto
// clMsg (" * %20s / %-20s",shader_render[M.shader].name, shader_compile[M.shader_xrlc].name);
int id = shaders.GetID(shader_compile[M.shader_xrlc].name);
if (id<0) {
clMsg ("ERROR: Shader '%s' not found in library",shader_compile[M.shader].name);
Logger.clMsg ("ERROR: Shader '%s' not found in library",shader_compile[M.shader].name);
R_ASSERT(id>=0);
}
M.reserved = u16(id);
Expand Down
8 changes: 7 additions & 1 deletion src/utils/xrAI/StdAfx.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
#define XR_EPROPS_API
#include "../../xrcore/clsid.h"
#include "defines.h"
#include "cl_log.h"
#include "../../xrcdb/xrCDB.h"
#include "_d3d_extensions.h"

Expand All @@ -29,6 +28,13 @@
#include <sys/stat.h>
#include <io.h>
#include <stdio.h>
#include "utils/xrLCUtil/LevelCompilerLoggerWindow.hpp"
#include "utils/xrLCUtil/xrThread.hpp"

extern LevelCompilerLoggerWindow &Logger;
extern CThread::LogFunc ProxyMsg;
extern CThreadManager::ReportStatusFunc ProxyStatus;
extern CThreadManager::ReportProgressFunc ProxyProgress;

#ifdef AI_COMPILER
# include "../../xrServerEntities/smart_cast.h"
Expand Down
249 changes: 0 additions & 249 deletions src/utils/xrAI/cl_log.cpp

This file was deleted.

9 changes: 0 additions & 9 deletions src/utils/xrAI/cl_log.h

This file was deleted.

8 changes: 4 additions & 4 deletions src/utils/xrAI/compiler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ void mem_Optimize ()

void xrCompiler (LPCSTR name, bool draft_mode, bool pure_covers, LPCSTR out_name)
{
Phase ("Loading level...");
Logger.Phase("Loading level...");
xrLoad (name,draft_mode);
mem_Optimize();

Expand All @@ -76,12 +76,12 @@ void xrCompiler (LPCSTR name, bool draft_mode, bool pure_covers, LPCSTR out_name
// mem_Optimize();

if (!draft_mode) {
Phase("Lighting nodes...");
Logger.Phase("Lighting nodes...");
xrLight ();
// xrDisplay ();
mem_Optimize();

Phase("Calculating coverage...");
Logger.Phase("Calculating coverage...");
xrCover (pure_covers);
mem_Optimize();
}
Expand All @@ -94,7 +94,7 @@ void xrCompiler (LPCSTR name, bool draft_mode, bool pure_covers, LPCSTR out_name
// Phase("Visualizing nodes...");
// xrDisplay ();

Phase("Saving nodes...");
Logger.Phase("Saving nodes...");
xrSaveNodes (name,out_name);
mem_Optimize();
}
10 changes: 5 additions & 5 deletions src/utils/xrAI/compiler_cover.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include "stdafx.h"
#include "compiler.h"
#include "xrCDB/Intersect.hpp"
#include "utils/xrUtil/xrThread.hpp"
#include "utils/xrLCUtil/xrThread.hpp"
#include <mmsystem.h>

#include "quadtree.h"
Expand Down Expand Up @@ -238,7 +238,7 @@ class CoverThread : public CThread
typedef float Cover[4];

public:
CoverThread (u32 ID, u32 _start, u32 _end) : CThread(ID, clMsg)
CoverThread (u32 ID, u32 _start, u32 _end) : CThread(ID, ProxyMsg)
{
Nstart = _start;
Nend = _end;
Expand Down Expand Up @@ -565,7 +565,7 @@ void compute_non_covers ()
extern void mem_Optimize();
void xrCover (bool pure_covers)
{
Status("Calculating...");
Logger.Status("Calculating...");

if (!pure_covers)
compute_cover_nodes ();
Expand All @@ -574,7 +574,7 @@ void xrCover (bool pure_covers)

// Start threads, wait, continue --- perform all the work
u32 start_time = timeGetTime();
CThreadManager Threads(Status, Progress);
CThreadManager Threads(ProxyStatus, ProxyProgress);
u32 stride = g_nodes.size()/NUM_THREADS;
u32 last = g_nodes.size()-stride*(NUM_THREADS-1);
for (u32 thID=0; thID<NUM_THREADS; thID++) {
Expand All @@ -597,7 +597,7 @@ void xrCover (bool pure_covers)
}

// Smooth
Status ("Smoothing coverage mask...");
Logger.Status("Smoothing coverage mask...");
mem_Optimize ();
Nodes Old = g_nodes;
for (u32 N=0; N<g_nodes.size(); N++)
Expand Down
5 changes: 1 addition & 4 deletions src/utils/xrAI/compiler_display.cpp
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
#include "stdafx.h"
#include "compiler.h"

//-------------------------------------------------------------------------------------------------------
#include "resource.h"

extern HWND logWindow;

int dimX,dimZ;
struct Texel {
vertex* N;
Expand Down Expand Up @@ -274,6 +270,7 @@ static BOOL CALLBACK disp_proc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lP
void xrDisplay ()
{
InternalRender ();
HWND logWindow = Logger.GetWindow();
DialogBox (HINSTANCE(GetModuleHandle(0)),MAKEINTRESOURCE(IDD_NVIEW),logWindow,disp_proc);
xr_free (texels);
}
Loading

0 comments on commit 32a7801

Please sign in to comment.