Skip to content

Commit e3cc304

Browse files
committed
Fix xrLC compilation, a bit tweaked Shader_xrLC.h
1 parent 29ad349 commit e3cc304

File tree

2 files changed

+20
-14
lines changed

2 files changed

+20
-14
lines changed

src/utils/Shader_xrLC.h

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1+
#pragma once
12
#ifndef SHADER_XRLC_H
23
#define SHADER_XRLC_H
3-
#pragma once
44

55
struct Shader_xrLC
66
{
@@ -57,7 +57,7 @@ class Shader_xrLC_LIB
5757
public:
5858
void Load(LPCSTR name)
5959
{
60-
IReader* fs = FS.r_open(name);
60+
auto fs = FS.r_open(name);
6161
if (NULL == fs)
6262
{
6363
string256 inf;
@@ -77,40 +77,43 @@ class Shader_xrLC_LIB
7777
}
7878
bool Save(LPCSTR name)
7979
{
80-
IWriter* F = FS.w_open(name);
80+
auto F = FS.w_open(name);
8181
if (F)
8282
{
8383
F->w(&*library.begin(), (u32)library.size() * sizeof(Shader_xrLC));
8484
FS.w_close(F);
8585
return true;
8686
}
87-
else
88-
{
89-
return false;
90-
}
87+
return false;
9188
}
9289
void Unload() { library.clear(); }
90+
9391
u32 GetID(LPCSTR name) const
9492
{
9593
for (auto it = library.begin(); it != library.end(); it++)
9694
if (0 == stricmp(name, it->Name))
9795
return u32(it - library.begin());
9896
return u32(-1);
9997
}
98+
10099
Shader_xrLC* Get(LPCSTR name)
101100
{
102-
for (auto it = library.begin(); it != library.end(); it++)
103-
if (0 == stricmp(name, it->Name))
104-
return &(*it);
105-
return NULL;
101+
for (auto& shader : library)
102+
if (0 == stricmp(name, shader.Name))
103+
return &shader;
104+
return nullptr;
106105
}
107-
IC Shader_xrLC* Get(int id) { return &library[id]; }
108-
IC const Shader_xrLC* Get(int id) const { return &library[id]; }
106+
107+
Shader_xrLC* Get(int id) { return &library[id]; }
108+
109+
const Shader_xrLC* Get(int id) const { return &library[id]; }
110+
109111
Shader_xrLC* Append(Shader_xrLC* parent = 0)
110112
{
111113
library.push_back(parent ? Shader_xrLC(*parent) : Shader_xrLC());
112114
return &library.back();
113115
}
116+
114117
void Remove(LPCSTR name)
115118
{
116119
for (auto it = library.begin(); it != library.end(); it++)
@@ -120,8 +123,11 @@ class Shader_xrLC_LIB
120123
break;
121124
}
122125
}
126+
123127
void Remove(int id) { library.erase(library.begin() + id); }
128+
124129
Shader_xrLCVec& Library() { return library; }
130+
125131
const Shader_xrLCVec& Library() const { return library; }
126132
};
127133

src/utils/xrLC/NvMender2002/NVMeshMender.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -704,7 +704,7 @@ bool NVMeshMender::Munge(const NVMeshMender::VAVector& input, NVMeshMender::VAVe
704704
pPositions = (vec3*)(&(positions[0]));
705705
tex = (vec3*)(&(output[(*texIter).second].floatVector_[0]));
706706

707-
double _eps = type_epsilon(double) * 10;
707+
double _eps = type_epsilon<double> * 10;
708708
double a, b, c;
709709
vec3d sxt;
710710

0 commit comments

Comments
 (0)