mirror of
https://github.com/AxioDL/amuse.git
synced 2025-06-06 14:43:31 +00:00
Windows compile fixes
This commit is contained in:
parent
2a5823d6de
commit
2d3aa03a51
@ -9,11 +9,27 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <thread>
|
#include <thread>
|
||||||
#include <map>
|
#include <map>
|
||||||
|
#include <varargs.h>
|
||||||
|
|
||||||
#define VOL_FACTOR 0.25
|
#define VOL_FACTOR 0.25
|
||||||
|
|
||||||
static logvisor::Module Log("amuseplay");
|
static logvisor::Module Log("amuseplay");
|
||||||
|
|
||||||
|
#if __GNUC__
|
||||||
|
__attribute__((__format__ (__printf__, 3, 4)))
|
||||||
|
#endif
|
||||||
|
static inline void SNPrintf(boo::SystemChar* str, size_t maxlen, const boo::SystemChar* format, ...)
|
||||||
|
{
|
||||||
|
va_list va;
|
||||||
|
va_start(va, format);
|
||||||
|
#if _WIN32
|
||||||
|
_vsnwprintf(str, maxlen, format, va);
|
||||||
|
#else
|
||||||
|
vsnprintf(str, maxlen, format, va);
|
||||||
|
#endif
|
||||||
|
va_end(va);
|
||||||
|
}
|
||||||
|
|
||||||
static amuse::IntrusiveAudioGroupData LoadFromArgs(int argc, const boo::SystemChar** argv,
|
static amuse::IntrusiveAudioGroupData LoadFromArgs(int argc, const boo::SystemChar** argv,
|
||||||
std::string& descOut, bool& good)
|
std::string& descOut, bool& good)
|
||||||
{
|
{
|
||||||
@ -68,14 +84,14 @@ static amuse::IntrusiveAudioGroupData LoadFromArgs(int argc, const boo::SystemCh
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* Now attempt multi-file case */
|
/* Now attempt multi-file case */
|
||||||
char path[1024];
|
boo::SystemChar path[1024];
|
||||||
|
|
||||||
/* Project */
|
/* Project */
|
||||||
snprintf(path, 1024, "%s.pro", argv[1]);
|
SNPrintf(path, 1024, _S("%s.pro"), argv[1]);
|
||||||
r.emplace(path, 32 * 1024, false);
|
r.emplace(path, 32 * 1024, false);
|
||||||
if (r->hasError())
|
if (r->hasError())
|
||||||
{
|
{
|
||||||
snprintf(path, 1024, "%s.proj", argv[1]);
|
SNPrintf(path, 1024, _S("%s.proj"), argv[1]);
|
||||||
r.emplace(path, 32 * 1024, false);
|
r.emplace(path, 32 * 1024, false);
|
||||||
if (r->hasError())
|
if (r->hasError())
|
||||||
return {nullptr, nullptr, nullptr, nullptr};
|
return {nullptr, nullptr, nullptr, nullptr};
|
||||||
@ -83,11 +99,11 @@ static amuse::IntrusiveAudioGroupData LoadFromArgs(int argc, const boo::SystemCh
|
|||||||
std::unique_ptr<uint8_t[]> proj = r->readUBytes(r->length());
|
std::unique_ptr<uint8_t[]> proj = r->readUBytes(r->length());
|
||||||
|
|
||||||
/* Pool */
|
/* Pool */
|
||||||
snprintf(path, 1024, "%s.poo", argv[1]);
|
SNPrintf(path, 1024, _S("%s.poo"), argv[1]);
|
||||||
r.emplace(path, 32 * 1024, false);
|
r.emplace(path, 32 * 1024, false);
|
||||||
if (r->hasError())
|
if (r->hasError())
|
||||||
{
|
{
|
||||||
snprintf(path, 1024, "%s.pool", argv[1]);
|
SNPrintf(path, 1024, _S("%s.pool"), argv[1]);
|
||||||
r.emplace(path, 32 * 1024, false);
|
r.emplace(path, 32 * 1024, false);
|
||||||
if (r->hasError())
|
if (r->hasError())
|
||||||
return {nullptr, nullptr, nullptr, nullptr};
|
return {nullptr, nullptr, nullptr, nullptr};
|
||||||
@ -95,11 +111,11 @@ static amuse::IntrusiveAudioGroupData LoadFromArgs(int argc, const boo::SystemCh
|
|||||||
std::unique_ptr<uint8_t[]> pool = r->readUBytes(r->length());
|
std::unique_ptr<uint8_t[]> pool = r->readUBytes(r->length());
|
||||||
|
|
||||||
/* Sdir */
|
/* Sdir */
|
||||||
snprintf(path, 1024, "%s.sdi", argv[1]);
|
SNPrintf(path, 1024, _S("%s.sdi"), argv[1]);
|
||||||
r.emplace(path, 32 * 1024, false);
|
r.emplace(path, 32 * 1024, false);
|
||||||
if (r->hasError())
|
if (r->hasError())
|
||||||
{
|
{
|
||||||
snprintf(path, 1024, "%s.sdir", argv[1]);
|
SNPrintf(path, 1024, _S("%s.sdir"), argv[1]);
|
||||||
r.emplace(path, 32 * 1024, false);
|
r.emplace(path, 32 * 1024, false);
|
||||||
if (r->hasError())
|
if (r->hasError())
|
||||||
return {nullptr, nullptr, nullptr, nullptr};
|
return {nullptr, nullptr, nullptr, nullptr};
|
||||||
@ -107,11 +123,11 @@ static amuse::IntrusiveAudioGroupData LoadFromArgs(int argc, const boo::SystemCh
|
|||||||
std::unique_ptr<uint8_t[]> sdir = r->readUBytes(r->length());
|
std::unique_ptr<uint8_t[]> sdir = r->readUBytes(r->length());
|
||||||
|
|
||||||
/* Samp */
|
/* Samp */
|
||||||
snprintf(path, 1024, "%s.sam", argv[1]);
|
SNPrintf(path, 1024, _S("%s.sam"), argv[1]);
|
||||||
r.emplace(path, 32 * 1024, false);
|
r.emplace(path, 32 * 1024, false);
|
||||||
if (r->hasError())
|
if (r->hasError())
|
||||||
{
|
{
|
||||||
snprintf(path, 1024, "%s.samp", argv[1]);
|
SNPrintf(path, 1024, _S("%s.samp"), argv[1]);
|
||||||
r.emplace(path, 32 * 1024, false);
|
r.emplace(path, 32 * 1024, false);
|
||||||
if (r->hasError())
|
if (r->hasError())
|
||||||
return {nullptr, nullptr, nullptr, nullptr};
|
return {nullptr, nullptr, nullptr, nullptr};
|
||||||
@ -635,7 +651,7 @@ struct AppCallback : boo::IApplicationCallback
|
|||||||
int appMain(boo::IApplication* app)
|
int appMain(boo::IApplication* app)
|
||||||
{
|
{
|
||||||
/* Event window */
|
/* Event window */
|
||||||
m_win = app->newWindow("amuseplay", 1);
|
m_win = app->newWindow(_S("amuseplay"), 1);
|
||||||
m_win->setCallback(&m_events);
|
m_win->setCallback(&m_events);
|
||||||
m_win->setWindowFrame(100, 100, 100, 100);
|
m_win->setWindowFrame(100, 100, 100, 100);
|
||||||
m_win->setStyle(~boo::EWindowStyle::Resize);
|
m_win->setStyle(~boo::EWindowStyle::Resize);
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
#include <array>
|
||||||
#include <list>
|
#include <list>
|
||||||
#include "optional.hpp"
|
#include "optional.hpp"
|
||||||
#include "Entity.hpp"
|
#include "Entity.hpp"
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
#include "amuse/SurroundProfiles.hpp"
|
#include "amuse/SurroundProfiles.hpp"
|
||||||
#include <cmath>
|
#include <cmath>
|
||||||
|
#include <algorithm>
|
||||||
#include <cfloat>
|
#include <cfloat>
|
||||||
|
|
||||||
namespace amuse
|
namespace amuse
|
||||||
|
Loading…
x
Reference in New Issue
Block a user