Windows build fixes and warning avoidance

This commit is contained in:
Jack Andersen 2018-05-24 20:37:27 -10:00
parent e3c936648b
commit 77c7daa67c
8 changed files with 20 additions and 25 deletions

View File

@ -36,7 +36,7 @@ public:
void charKeyUp(unsigned long charCode, boo::EModifierKey mods);
void specialKeyDown(boo::ESpecialKey key, boo::EModifierKey mods, bool isRepeat);
void specialKeyUp(boo::ESpecialKey key, boo::EModifierKey mods);
void resized(const boo::SWindowRect&, const boo::SWindowRect&) {}
void resized(const boo::SWindowRect&, bool) {}
void mouseDown(const boo::SWindowCoord&, boo::EMouseButton, boo::EModifierKey);
void mouseUp(const boo::SWindowCoord&, boo::EMouseButton, boo::EModifierKey);
@ -630,10 +630,10 @@ struct AppCallback : boo::IApplicationCallback
m_win->setStyle(~boo::EWindowStyle::Resize);
m_win->showWindow();
boo::ObjToken<boo::ITextureR> tex;
m_win->getMainContextDataFactory()->BooCommitTransaction([&](boo::IGraphicsDataFactory::Context& ctx) {
m_win->getMainContextDataFactory()->commitTransaction([&](boo::IGraphicsDataFactory::Context& ctx) {
tex = ctx.newRenderTexture(100, 100, boo::TextureClampMode::Repeat, 1, 0);
return true;
});
} BooTrace);
boo::IGraphicsCommandQueue* q = m_win->getCommandQueue();
q->setRenderTarget(tex);
q->clearTarget();

View File

@ -47,12 +47,8 @@ public:
size_t m_fileSz;
bool m_isDir;
private:
friend class DirectoryEnumerator;
Entry(SystemString&& path, const SystemChar* name, size_t sz, bool isDir)
: m_path(std::move(path)), m_name(name), m_fileSz(sz), m_isDir(isDir)
{
}
Entry(const SystemString& path, const SystemChar* name, size_t sz, bool isDir)
: m_path(path), m_name(name), m_fileSz(sz), m_isDir(isDir) {}
};
private:

View File

@ -14,16 +14,16 @@ class Listener;
using Vector3f = float[3];
static float Dot(const Vector3f& a, const Vector3f& b) { return a[0] * b[0] + a[1] * b[1] + a[2] * b[2]; }
static inline float Dot(const Vector3f& a, const Vector3f& b) { return a[0] * b[0] + a[1] * b[1] + a[2] * b[2]; }
static float Length(const Vector3f& a)
static inline float Length(const Vector3f& a)
{
if (std::fabs(a[0]) <= FLT_EPSILON && std::fabs(a[1]) <= FLT_EPSILON && std::fabs(a[2]) <= FLT_EPSILON)
return 0.f;
return std::sqrt(Dot(a, a));
}
static float Normalize(Vector3f& out)
static inline float Normalize(Vector3f& out)
{
float dist = Length(out);
if (dist == 0.f)

View File

@ -320,7 +320,7 @@ public:
if (!m_extCtrlVals)
{
if (m_ctrlValsSelf)
m_ctrlValsSelf[ctrl];
return m_ctrlValsSelf[ctrl];
return 0;
}
return m_extCtrlVals[ctrl];

View File

@ -1802,7 +1802,6 @@ static std::vector<std::pair<SystemString, ContainerRegistry::SongData>> LoadPap
if (songDesc.name[0] == 0)
break;
uint32_t i = 0;
songDescs.push_back(songDesc);
}
size_t endPos = FileLength(midifp);

View File

@ -60,7 +60,7 @@ DirectoryEnumerator::DirectoryEnumerator(SystemStringView path, Mode mode, bool
else
continue;
m_entries.push_back(std::move(Entry(std::move(fp), d.cFileName, sz, isDir)));
m_entries.emplace_back(fp, d.cFileName, sz, isDir);
} while (FindNextFileW(dir, &d));
break;
case Mode::DirsThenFilesSorted:
@ -79,7 +79,7 @@ DirectoryEnumerator::DirectoryEnumerator(SystemStringView path, Mode mode, bool
Sstat st;
if (Stat(fp.c_str(), &st) || !S_ISDIR(st.st_mode))
continue;
sort.emplace(std::make_pair(d.cFileName, Entry(std::move(fp), d.cFileName, 0, true)));
sort.emplace(std::make_pair(d.cFileName, Entry(fp, d.cFileName, 0, true)));
} while (FindNextFileW(dir, &d));
m_entries.reserve(sort.size());
@ -115,7 +115,7 @@ DirectoryEnumerator::DirectoryEnumerator(SystemStringView path, Mode mode, bool
Sstat st;
if (Stat(fp.c_str(), &st) || !S_ISREG(st.st_mode))
continue;
sort.emplace(std::make_pair(st.st_size, Entry(std::move(fp), d.cFileName, st.st_size, false)));
sort.emplace(std::make_pair(st.st_size, Entry(fp, d.cFileName, st.st_size, false)));
} while (FindNextFileW(dir, &d));
m_entries.reserve(sort.size());
@ -141,7 +141,7 @@ DirectoryEnumerator::DirectoryEnumerator(SystemStringView path, Mode mode, bool
Sstat st;
if (Stat(fp.c_str(), &st) || !S_ISREG(st.st_mode))
continue;
sort.emplace(std::make_pair(d.cFileName, Entry(std::move(fp), d.cFileName, st.st_size, false)));
sort.emplace(std::make_pair(d.cFileName, Entry(fp, d.cFileName, st.st_size, false)));
} while (FindNextFileW(dir, &d));
m_entries.reserve(sort.size());
@ -189,7 +189,7 @@ DirectoryEnumerator::DirectoryEnumerator(SystemStringView path, Mode mode, bool
else
continue;
m_entries.push_back(Entry(std::move(fp), d->d_name, sz, isDir));
m_entries.emplace_back(fp, d->d_name, sz, isDir);
}
break;
case Mode::DirsThenFilesSorted:
@ -208,7 +208,7 @@ DirectoryEnumerator::DirectoryEnumerator(SystemStringView path, Mode mode, bool
Sstat st;
if (Stat(fp.c_str(), &st) || !S_ISDIR(st.st_mode))
continue;
sort.emplace(std::make_pair(d->d_name, Entry(std::move(fp), d->d_name, 0, true)));
sort.emplace(std::make_pair(d->d_name, Entry(fp, d->d_name, 0, true)));
}
m_entries.reserve(sort.size());
@ -243,7 +243,7 @@ DirectoryEnumerator::DirectoryEnumerator(SystemStringView path, Mode mode, bool
Sstat st;
if (Stat(fp.c_str(), &st) || !S_ISREG(st.st_mode))
continue;
sort.emplace(std::make_pair(st.st_size, Entry(std::move(fp), d->d_name, st.st_size, false)));
sort.emplace(std::make_pair(st.st_size, Entry(fp, d->d_name, st.st_size, false)));
}
m_entries.reserve(sort.size());
@ -269,7 +269,7 @@ DirectoryEnumerator::DirectoryEnumerator(SystemStringView path, Mode mode, bool
Sstat st;
if (Stat(fp.c_str(), &st) || !S_ISREG(st.st_mode))
continue;
sort.emplace(std::make_pair(d->d_name, Entry(std::move(fp), d->d_name, st.st_size, false)));
sort.emplace(std::make_pair(d->d_name, Entry(fp, d->d_name, st.st_size, false)));
}
m_entries.reserve(sort.size());

View File

@ -174,7 +174,7 @@ void Sequencer::advance(double dt)
float vol;
if (m_curVol < m_volFadeTarget)
vol = std::min(m_volFadeTarget, m_curVol + step);
else if (m_curVol >= m_volFadeTarget)
else
vol = std::max(m_volFadeTarget, m_curVol - step);
if (vol == m_volFadeTarget)
m_volFadeTime = 0.f;

View File

@ -891,8 +891,8 @@ bool SoundMacroState::advance(Voice& vox, double dt)
}
case Op::SendFlag:
{
int8_t id = cmd.m_data[0];
int8_t val = cmd.m_data[1];
//int8_t id = cmd.m_data[0];
//int8_t val = cmd.m_data[1];
break; /* TODO: figure out a good API */
}
case Op::PitchWheelR: