• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ logvisor::Module类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中logvisor::Module的典型用法代码示例。如果您正苦于以下问题:C++ Module类的具体用法?C++ Module怎么用?C++ Module使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了Module类的19个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: AthenaExcHandler

void AthenaExcHandler(athena::error::Level level, const char* file, const char* /*function*/, int line, const char* fmt,
                      ...) {
  static logvisor::Module Log("heclTest::AthenaExcHandler");
  va_list ap;
  va_start(ap, fmt);
  Log.reportSource(logvisor::Level(level), file, uint32_t(line), fmt, ap);
  va_end(ap);
}
开发者ID:AxioDL,项目名称:hecl,代码行数:8,代码来源:main.cpp


示例2: Log

namespace urde {
logvisor::Module Log("urde::RetroTypes::CAssetId");

CAssetId::CAssetId(CInputStream& in) {
  if (g_Main) {
    if (g_Main->GetExpectedIdSize() == sizeof(u32))
      Assign(in.readUint32Big());
    else if (g_Main->GetExpectedIdSize() == sizeof(u64))
      Assign(in.readUint64Big());
    else
      Log.report(logvisor::Fatal, "Unsupported id length %i", g_Main->GetExpectedIdSize());
  } else
    Log.report(logvisor::Fatal, "Input constructor called before runtime Main entered!");
}

void CAssetId::PutTo(COutputStream& out) {
  if (g_Main) {
    if (g_Main->GetExpectedIdSize() == sizeof(u32))
      out.writeUint32Big(u32(id));
    else if (g_Main->GetExpectedIdSize() == sizeof(u64))
      out.writeUint64Big(id);
    else
      Log.report(logvisor::Fatal, "Unsupported id length %i", g_Main->GetExpectedIdSize());
  } else
    Log.report(logvisor::Fatal, "PutTo called before runtime Main entered!");
}

} // namespace urde
开发者ID:AxioDL,项目名称:urde,代码行数:28,代码来源:RetroTypes.cpp


示例3: read

void ColorElementFactory::read(athena::io::IStreamReader& r)
{
    uint32_t clsId;
    r.readBytesToBuf(&clsId, 4);
    switch (clsId)
    {
    case SBIG('KEYE'):
    case SBIG('KEYP'):
        m_elem.reset(new struct CEKeyframeEmitter);
        break;
    case SBIG('CNST'):
        m_elem.reset(new struct CEConstant);
        break;
    case SBIG('CHAN'):
        m_elem.reset(new struct CETimeChain);
        break;
    case SBIG('CFDE'):
        m_elem.reset(new struct CEFadeEnd);
        break;
    case SBIG('FADE'):
        m_elem.reset(new struct CEFade);
        break;
    case SBIG('PULS'):
        m_elem.reset(new struct CEPulse);
        break;
    case SBIG('NONE'):
        m_elem.reset();
        return;
    default:
        m_elem.reset();
        LogModule.report(logvisor::Fatal, "Unknown ColorElement class %.4s @%" PRIi64, &clsId, r.position());
        return;
    }
    m_elem->read(r);
}
开发者ID:KalDragon,项目名称:urde,代码行数:35,代码来源:ParticleCommon.cpp


示例4: Log

namespace boo {
static logvisor::Module Log("boo::GLX");

void GLXExtensionCheck() {
  if (!GLXEW_SGI_video_sync)
    Log.report(logvisor::Fatal, "GLX_SGI_video_sync not available");
  if (!GLXEW_EXT_swap_control && !GLXEW_MESA_swap_control && !GLXEW_SGI_swap_control)
    Log.report(logvisor::Fatal, "swap_control not available");
}

void GLXEnableVSync(Display* disp, GLXWindow drawable) {
  if (GLXEW_EXT_swap_control)
    glXSwapIntervalEXT(disp, drawable, 1);
  else if (GLXEW_MESA_swap_control)
    glXSwapIntervalMESA(1);
  else if (GLXEW_SGI_swap_control)
    glXSwapIntervalSGI(1);
}

} // namespace boo
开发者ID:AxioDL,项目名称:boo,代码行数:20,代码来源:GLX.cpp


示例5: Log

namespace urde
{
static logvisor::Module Log("urde::CGuiWidget");

typedef bool(CGuiWidget::*FMAF)(CGuiFunctionDef* def, CGuiControllerInfo* info);
static std::unordered_map<u32, FMAF> WidgetFnMap;

void CGuiWidget::LoadWidgetFnMap()
{
    WidgetFnMap.emplace(std::make_pair(2, &CGuiWidget::MAF_StartAnimationSet));
    WidgetFnMap.emplace(std::make_pair(3, &CGuiWidget::MAF_SendMessage));
    WidgetFnMap.emplace(std::make_pair(6, &CGuiWidget::MAF_PauseAnim));
    WidgetFnMap.emplace(std::make_pair(7, &CGuiWidget::MAF_ResumeAnim));
    WidgetFnMap.emplace(std::make_pair(11, &CGuiWidget::MAF_SetState));
    WidgetFnMap.emplace(std::make_pair(12, &CGuiWidget::MAF_SetStateOfWidget));
}

CGuiWidget::CGuiWidget(const CGuiWidgetParms& parms)
: x7c_selfId(parms.x6_selfId), x7e_parentId(parms.x8_parentId),
  xbc_color(parms.x10_color), xc0_color2(parms.x10_color),
  xc4_drawFlags(parms.x14_drawFlags), xc8_frame(parms.x0_frame),
  xf6_24_pg(parms.xd_g), xf6_25_isVisible(parms.xa_defaultVisible),
  xf6_26_isActive(parms.xb_defaultActive),
  xf6_27_(true), xf6_28_eventLock(false),
  xf6_29_cullFaces(parms.xc_cullFaces), xf6_30_(false),
  xf6_31_(true), xf7_24_(false), xf7_25_(true)
{
    if (parms.x4_useAnimController)
        EnsureHasAnimController();
    RecalcWidgetColor(ETraversalMode::Single);
}

CGuiWidget::CGuiWidgetParms
CGuiWidget::ReadWidgetHeader(CGuiFrame* frame, CInputStream& in, bool flag)
{
    std::string name = in.readString(-1);
    s16 selfId = frame->GetWidgetIdDB().AddWidget(name);
    std::string parent = in.readString(-1);
    s16 parentId = frame->GetWidgetIdDB().AddWidget(parent);

    bool useAnimController = in.readBool();
    bool defaultVis = in.readBool();
    bool defaultActive = in.readBool();
    bool cullFaces = in.readBool();
    zeus::CColor color;
    color.readRGBABig(in);
    EGuiModelDrawFlags df = EGuiModelDrawFlags(in.readUint32Big());

    return CGuiWidget::CGuiWidgetParms(frame, useAnimController, selfId,
                                       parentId, defaultVis, defaultActive,
                                       cullFaces, color, df, true, flag);
}

CGuiWidget* CGuiWidget::Create(CGuiFrame* frame, CInputStream& in, bool flag)
{
    CGuiWidgetParms parms = ReadWidgetHeader(frame, in, flag);
    CGuiWidget* ret = new CGuiWidget(parms);
    ret->ParseBaseInfo(frame, in, parms);
    return ret;
}

bool CGuiWidget::Message(const CGuiMessage& msg)
{
}

void CGuiWidget::ParseBaseInfo(CGuiFrame* frame, CInputStream& in, const CGuiWidgetParms& parms)
{
    CGuiWidget* parent = frame->FindWidget(parms.x8_parentId);
    bool a = in.readBool();
    if (a)
        xf4_workerId = in.readInt16Big();
    zeus::CVector3f trans;
    trans.readBig(in);
    zeus::CMatrix3f orient;
    orient.readBig(in);
    x80_transform = zeus::CTransform(orient, trans);
    ReapplyXform();
    zeus::CVector3f rotCenter;
    rotCenter.readBig(in);
    SetRotationCenter(rotCenter);
    ParseMessages(in, parms);
    ParseAnimations(in, parms);
    if (a)
        if (!parent->AddWorkerWidget(this))
        {
            Log.report(logvisor::Warning,
            "Warning: Discarding useless worker id. Parent is not a compound widget.");
            xf4_workerId = -1;
        }
    parent->AddChildWidget(this, false, true);
}

void CGuiWidget::ParseMessages(CInputStream& in, const CGuiWidgetParms& parms)
{
    s16 count = in.readInt16Big();
    assert(count == 0);
    count = in.readInt16Big();
    assert(count == 0);
}

//.........这里部分代码省略.........
开发者ID:KalDragon,项目名称:urde,代码行数:101,代码来源:CGuiWidget.cpp


示例6: Log

namespace urde
{
static logvisor::Module Log("URDE::icons");

specter::IconAtlas<8,8> g_IconAtlas;

boo::GraphicsDataToken InitializeIcons(specter::ViewResources& viewRes)
{
    athena::io::MemoryReader r(URDE_ICONS, URDE_ICONS_SZ);
    size_t fmt = r.readUint32Big();
    if (fmt != 16)
        Log.report(logvisor::Fatal, "incorrect icon texture format");
    size_t width = r.readUint16Big();
    size_t height = r.readUint16Big();
    size_t mips = r.readUint32Big();
    size_t decompSz = r.readUint32Big();

    std::unique_ptr<uint8_t[]> texels(new uint8_t[decompSz]);
    uLongf destSz = decompSz;
    size_t pos = r.position();
    if (uncompress(texels.get(), &destSz, URDE_ICONS + pos, URDE_ICONS_SZ - pos) != Z_OK)
        Log.report(logvisor::Fatal, "unable to decompress icons");

    g_IconAtlas.initializeAtlas(viewRes.m_factory->newStaticTexture(width, height, mips, boo::TextureFormat::RGBA8,
                                                                    texels.get(), destSz));
    return viewRes.m_factory->commit();
}

specter::Icon& GetIcon(SpaceIcon icon)
{
    switch (icon)
    {
    case SpaceIcon::ResourceBrowser:
        return g_IconAtlas.getIcon(0, 0);
    case SpaceIcon::ParticleEditor:
        return g_IconAtlas.getIcon(0, 1);
    case SpaceIcon::WorldEditor:
        return g_IconAtlas.getIcon(0, 2);
    case SpaceIcon::InformationCenter:
        return g_IconAtlas.getIcon(0, 3);
    case SpaceIcon::ModelViewer:
        return g_IconAtlas.getIcon(0, 4);
    default:
        return g_IconAtlas.getIcon(6, 0);
    }
}

specter::Icon& GetIcon(MonoIcon icon)
{
    switch (icon)
    {
    case MonoIcon::Sync:
        return g_IconAtlas.getIcon(7, 0);
    case MonoIcon::Edit:
        return g_IconAtlas.getIcon(7, 1);
    case MonoIcon::Caution:
        return g_IconAtlas.getIcon(7, 2);
    case MonoIcon::Save:
        return g_IconAtlas.getIcon(7, 3);
    case MonoIcon::Filter:
        return g_IconAtlas.getIcon(7, 4);
    case MonoIcon::Document:
        return g_IconAtlas.getIcon(7, 5);
    case MonoIcon::ZoomOut:
        return g_IconAtlas.getIcon(7, 6);
    case MonoIcon::ZoomIn:
        return g_IconAtlas.getIcon(7, 7);
    case MonoIcon::Exclaim:
        return g_IconAtlas.getIcon(6, 0);
    case MonoIcon::Clock:
        return g_IconAtlas.getIcon(6, 1);
    case MonoIcon::Gamepad:
        return g_IconAtlas.getIcon(6, 2);
    case MonoIcon::Unlink:
        return g_IconAtlas.getIcon(6, 3);
    case MonoIcon::Link:
        return g_IconAtlas.getIcon(6, 4);
    case MonoIcon::Folder:
        return g_IconAtlas.getIcon(6, 5);
    case MonoIcon::Info:
        return g_IconAtlas.getIcon(6, 6);
    default:
        return g_IconAtlas.getIcon(6, 0);
    }
}

}
开发者ID:KalDragon,项目名称:urde,代码行数:87,代码来源:icons.cpp


示例7: Log

namespace specter
{
static logvisor::Module Log("specter::ViewResources");

void ViewResources::init(boo::IGraphicsDataFactory* factory, FontCache* fcache,
                         const IThemeData* theme, float pf)
{
    if (!factory || !fcache || !theme)
        Log.report(logvisor::Fatal, "all arguments of ViewResources::init() must be non-null");
    m_pixelFactor = pf;
    m_factory = factory;
    m_theme = theme;
    m_fcache = fcache;
    unsigned dpi = 72.f * m_pixelFactor;

    m_curveFont = fcache->prepCurvesFont(factory, AllCharFilter, false, 8.f, dpi);

    m_resData = factory->commitTransaction(
    [&](boo::IGraphicsDataFactory::Context& ctx) -> bool
    {
        switch (ctx.platform())
        {
        case boo::IGraphicsDataFactory::Platform::OGL:
            init<boo::GLDataFactory::Context>(static_cast<boo::GLDataFactory::Context&>(ctx), *theme, fcache);
            break;
#if _WIN32
        case boo::IGraphicsDataFactory::Platform::D3D11:
        case boo::IGraphicsDataFactory::Platform::D3D12:
            init<boo::ID3DDataFactory::Context>(static_cast<boo::ID3DDataFactory::Context&>(ctx), *theme, fcache);
            break;
#endif
#if BOO_HAS_METAL
        case boo::IGraphicsDataFactory::Platform::Metal:
            init<boo::MetalDataFactory::Context>(static_cast<boo::MetalDataFactory::Context&>(ctx), *theme, fcache);
            break;
#endif
#if BOO_HAS_VULKAN
        case boo::IGraphicsDataFactory::Platform::Vulkan:
            init<boo::VulkanDataFactory::Context>(static_cast<boo::VulkanDataFactory::Context&>(ctx), *theme, fcache);
            break;
#endif
        default:
            Log.report(logvisor::Fatal, _S("unable to init view system for %s"), ctx.platformName());
        }
        return true;
    });
}

void ViewResources::prepFontCacheSync()
{
    unsigned dpi = 72.f * m_pixelFactor;
    if (m_fcacheInterrupt) return;
    m_mainFont = m_fcache->prepMainFont(m_factory, AllCharFilter, false, 10.f, dpi);
    if (m_fcacheInterrupt) return;
    m_monoFont = m_fcache->prepMonoFont(m_factory, AllCharFilter, false, 10.f, dpi);
    if (m_fcacheInterrupt) return;
    m_heading14 = m_fcache->prepMainFont(m_factory, LatinAndJapaneseCharFilter, false, 14.f, dpi);
    if (m_fcacheInterrupt) return;
    m_heading18 = m_fcache->prepMainFont(m_factory, LatinAndJapaneseCharFilter, false, 18.f, dpi);
    if (m_fcacheInterrupt) return;
    m_titleFont = m_fcache->prepMainFont(m_factory, LatinCharFilter, false, 36.f, dpi);
    if (m_fcacheInterrupt) return;
    m_fcache->closeBuiltinFonts();
    m_fcacheReady = true;
}

void ViewResources::prepFontCacheAsync(boo::IWindow* window)
{
    m_fcacheReady = false;
    m_fcacheThread = std::thread([this, window]()
    {
        window->getLoadContextDataFactory();
        prepFontCacheSync();
    });
}

void ViewResources::resetPixelFactor(float pf)
{
    m_pixelFactor = pf;
    unsigned dpi = 72.f * m_pixelFactor;
    m_curveFont = m_fcache->prepCurvesFont(m_factory, AllCharFilter, false, 8.f, dpi);
    prepFontCacheSync();
}

void ViewResources::resetTheme(const IThemeData* theme)
{
    m_theme = theme;
}

}
开发者ID:zoujiaqing,项目名称:specter,代码行数:90,代码来源:ViewResources.cpp


示例8: LogModule

namespace DNAParticle
{
logvisor::Module LogModule("urde::DNAParticle");

void RealElementFactory::read(athena::io::YAMLDocReader& r)
{
    const auto& mapChildren = r.getCurNode()->m_mapChildren;
    if (mapChildren.empty())
    {
        m_elem.reset();
        return;
    }

    const auto& elem = mapChildren[0];
    if (elem.first.size() < 4)
        LogModule.report(logvisor::Fatal, "short FourCC in element '%s'", elem.first.c_str());

    switch (*reinterpret_cast<const uint32_t*>(elem.first.data()))
    {
    case SBIG('LFTW'):
        m_elem.reset(new struct RELifetimeTween);
        break;
    case SBIG('CNST'):
        m_elem.reset(new struct REConstant);
        break;
    case SBIG('CHAN'):
        m_elem.reset(new struct RETimeChain);
        break;
    case SBIG('ADD_'):
        m_elem.reset(new struct REAdd);
        break;
    case SBIG('CLMP'):
        m_elem.reset(new struct REClamp);
        break;
    case SBIG('KEYE'):
    case SBIG('KEYP'):
        m_elem.reset(new struct REKeyframeEmitter);
        break;
    case SBIG('IRND'):
        m_elem.reset(new struct REInitialRandom);
        break;
    case SBIG('RAND'):
        m_elem.reset(new struct RERandom);
        break;
    case SBIG('MULT'):
        m_elem.reset(new struct REMultiply);
        break;
    case SBIG('PULS'):
        m_elem.reset(new struct REPulse);
        break;
    case SBIG('SCAL'):
        m_elem.reset(new struct RETimeScale);
        break;
    case SBIG('RLPT'):
        m_elem.reset(new struct RELifetimePercent);
        break;
    case SBIG('SINE'):
        m_elem.reset(new struct RESineWave);
        break;
    case SBIG('ISWT'):
        m_elem.reset(new struct REInitialSwitch);
        break;
    case SBIG('CLTN'):
        m_elem.reset(new struct RECompareLessThan);
        break;
    case SBIG('CEQL'):
        m_elem.reset(new struct RECompareEquals);
        break;
    case SBIG('PAP1'):
        m_elem.reset(new struct REParticleAdvanceParam1);
        break;
    case SBIG('PAP2'):
        m_elem.reset(new struct REParticleAdvanceParam2);
        break;
    case SBIG('PAP3'):
        m_elem.reset(new struct REParticleAdvanceParam3);
        break;
    case SBIG('PAP4'):
        m_elem.reset(new struct REParticleAdvanceParam4);
        break;
    case SBIG('PAP5'):
        m_elem.reset(new struct REParticleAdvanceParam5);
        break;
    case SBIG('PAP6'):
        m_elem.reset(new struct REParticleAdvanceParam6);
        break;
    case SBIG('PAP7'):
        m_elem.reset(new struct REParticleAdvanceParam7);
        break;
    case SBIG('PAP8'):
        m_elem.reset(new struct REParticleAdvanceParam8);
        break;
    case SBIG('PSLL'):
        m_elem.reset(new struct REParticleSizeOrLineLength);
        break;
    case SBIG('PRLW'):
        m_elem.reset(new struct REParticleRotationOrLineWidth);
        break;
    case SBIG('SUB_'):
        m_elem.reset(new struct RESubtract);
//.........这里部分代码省略.........
开发者ID:KalDragon,项目名称:urde,代码行数:101,代码来源:ParticleCommon.cpp


示例9: appMain

namespace urde
{
static logvisor::Module Log{"URDE"};

struct Application : boo::IApplicationCallback
{
    hecl::Runtime::FileStoreManager m_fileMgr;
    hecl::CVarManager m_cvarManager;
    std::unique_ptr<ViewManager> m_viewManager;

    bool m_running = true;

    Application() :
        m_fileMgr(_S("urde")),
        m_cvarManager(m_fileMgr)
    {
        m_viewManager.reset(new ViewManager(m_fileMgr, m_cvarManager));
    }

    int appMain(boo::IApplication* app)
    {
        initialize(app);
        m_viewManager->init(app);
        while (m_running)
        {
            if (!m_viewManager->proc())
                break;
        }
        m_viewManager->stop();
        m_cvarManager.serialize();
        m_viewManager.reset();
        return 0;
    }
    void appQuitting(boo::IApplication*)
    {
        m_running = false;
    }
    void appFilesOpen(boo::IApplication*, const std::vector<boo::SystemString>&)
    {

    }

    void initialize(boo::IApplication* app)
    {
        zeus::detectCPU();

        const zeus::CPUInfo& cpuInf = zeus::cpuFeatures();
        Log.report(logvisor::Info, "CPU Name: %s", cpuInf.cpuBrand);
        Log.report(logvisor::Info, "CPU Vendor: %s", cpuInf.cpuVendor);
        hecl::SystemString features;
        if (cpuInf.AESNI)
            features += _S("AES-NI");
        if (cpuInf.SSE1)
        {
            if (!features.empty())
                features += _S(", SSE1");
            else
                features += _S("SSE1");
        }
        else
        {
            Log.report(logvisor::Fatal, _S("URDE requires SSE1 minimum"));
            return;
        }
        if (cpuInf.SSE2)
            features += _S(", SSE2");
        else
        {
            Log.report(logvisor::Fatal, _S("URDE requires SSE2 minimum"));
            return;
        }
        if (cpuInf.SSE3)
            features += _S(", SSE3");
        if (cpuInf.SSSE3)
            features += _S(", SSSE3");
        if (cpuInf.SSE4a)
            features += _S(", SSE4a");
        if (cpuInf.SSE41)
            features += _S(", SSE4.1");
        if (cpuInf.SSE42)
            features += _S(", SSE4.2");
        Log.report(logvisor::Info, _S("CPU Features: %s"), features.c_str());
    }
};

}
开发者ID:KalDragon,项目名称:urde,代码行数:86,代码来源:main.cpp


示例10: if

CAssetId::CAssetId(CInputStream& in) {
  if (g_Main) {
    if (g_Main->GetExpectedIdSize() == sizeof(u32))
      Assign(in.readUint32Big());
    else if (g_Main->GetExpectedIdSize() == sizeof(u64))
      Assign(in.readUint64Big());
    else
      Log.report(logvisor::Fatal, "Unsupported id length %i", g_Main->GetExpectedIdSize());
  } else
    Log.report(logvisor::Fatal, "Input constructor called before runtime Main entered!");
}
开发者ID:AxioDL,项目名称:urde,代码行数:11,代码来源:RetroTypes.cpp


示例11: PutTo

void CAssetId::PutTo(COutputStream& out) {
  if (g_Main) {
    if (g_Main->GetExpectedIdSize() == sizeof(u32))
      out.writeUint32Big(u32(id));
    else if (g_Main->GetExpectedIdSize() == sizeof(u64))
      out.writeUint64Big(id);
    else
      Log.report(logvisor::Fatal, "Unsupported id length %i", g_Main->GetExpectedIdSize());
  } else
    Log.report(logvisor::Fatal, "PutTo called before runtime Main entered!");
}
开发者ID:AxioDL,项目名称:urde,代码行数:11,代码来源:RetroTypes.cpp


示例12: ParseBaseInfo

void CGuiWidget::ParseBaseInfo(CGuiFrame* frame, CInputStream& in, const CGuiWidgetParms& parms)
{
    CGuiWidget* parent = frame->FindWidget(parms.x8_parentId);
    bool a = in.readBool();
    if (a)
        xf4_workerId = in.readInt16Big();
    zeus::CVector3f trans;
    trans.readBig(in);
    zeus::CMatrix3f orient;
    orient.readBig(in);
    x80_transform = zeus::CTransform(orient, trans);
    ReapplyXform();
    zeus::CVector3f rotCenter;
    rotCenter.readBig(in);
    SetRotationCenter(rotCenter);
    ParseMessages(in, parms);
    ParseAnimations(in, parms);
    if (a)
        if (!parent->AddWorkerWidget(this))
        {
            Log.report(logvisor::Warning,
            "Warning: Discarding useless worker id. Parent is not a compound widget.");
            xf4_workerId = -1;
        }
    parent->AddChildWidget(this, false, true);
}
开发者ID:KalDragon,项目名称:urde,代码行数:26,代码来源:CGuiWidget.cpp


示例13:

Locale::Locale(const std::string& name, const std::string& fullName,
               const unsigned char* yamlSource, size_t yamlLength)
: m_name(name), m_fullName(fullName)
{
    athena::io::YAMLDocReader reader;
    yaml_parser_set_input_string(reader.getParser(), yamlSource, yamlLength);
    reader.parse();
    m_rootNode = std::move(reader.releaseRootNode());
    if (m_rootNode)
    {
        m_langNode = m_rootNode->findMapChild(name.c_str());
        if (!m_langNode)
            Log.report(logvisor::Fatal, "no root node '%s' found in locale", name.c_str());
    }
    else
        Log.report(logvisor::Warning, "locale empty");
}
开发者ID:zoujiaqing,项目名称:specter,代码行数:17,代码来源:Translator.cpp


示例14: AthenaExc

static void AthenaExc(athena::error::Level level, const char* file,
                      const char*, int line, const char* fmt, ...)
{
    va_list ap;
    va_start(ap, fmt);
    AthenaLog.reportSource(logvisor::Level(level), file, line, fmt, ap);
    va_end(ap);
}
开发者ID:KalDragon,项目名称:urde,代码行数:8,代码来源:main.cpp


示例15: init

void ViewResources::init(boo::IGraphicsDataFactory* factory, FontCache* fcache,
                         const IThemeData* theme, float pf)
{
    if (!factory || !fcache || !theme)
        Log.report(logvisor::Fatal, "all arguments of ViewResources::init() must be non-null");
    m_pixelFactor = pf;
    m_factory = factory;
    m_theme = theme;
    m_fcache = fcache;
    unsigned dpi = 72.f * m_pixelFactor;

    m_curveFont = fcache->prepCurvesFont(factory, AllCharFilter, false, 8.f, dpi);

    m_resData = factory->commitTransaction(
    [&](boo::IGraphicsDataFactory::Context& ctx) -> bool
    {
        switch (ctx.platform())
        {
        case boo::IGraphicsDataFactory::Platform::OGL:
            init<boo::GLDataFactory::Context>(static_cast<boo::GLDataFactory::Context&>(ctx), *theme, fcache);
            break;
#if _WIN32
        case boo::IGraphicsDataFactory::Platform::D3D11:
        case boo::IGraphicsDataFactory::Platform::D3D12:
            init<boo::ID3DDataFactory::Context>(static_cast<boo::ID3DDataFactory::Context&>(ctx), *theme, fcache);
            break;
#endif
#if BOO_HAS_METAL
        case boo::IGraphicsDataFactory::Platform::Metal:
            init<boo::MetalDataFactory::Context>(static_cast<boo::MetalDataFactory::Context&>(ctx), *theme, fcache);
            break;
#endif
#if BOO_HAS_VULKAN
        case boo::IGraphicsDataFactory::Platform::Vulkan:
            init<boo::VulkanDataFactory::Context>(static_cast<boo::VulkanDataFactory::Context&>(ctx), *theme, fcache);
            break;
#endif
        default:
            Log.report(logvisor::Fatal, _S("unable to init view system for %s"), ctx.platformName());
        }
        return true;
    });
}
开发者ID:zoujiaqing,项目名称:specter,代码行数:43,代码来源:ViewResources.cpp


示例16: initialize

    void initialize(boo::IApplication* app)
    {
        zeus::detectCPU();

        const zeus::CPUInfo& cpuInf = zeus::cpuFeatures();
        Log.report(logvisor::Info, "CPU Name: %s", cpuInf.cpuBrand);
        Log.report(logvisor::Info, "CPU Vendor: %s", cpuInf.cpuVendor);
        hecl::SystemString features;
        if (cpuInf.AESNI)
            features += _S("AES-NI");
        if (cpuInf.SSE1)
        {
            if (!features.empty())
                features += _S(", SSE1");
            else
                features += _S("SSE1");
        }
        else
        {
            Log.report(logvisor::Fatal, _S("URDE requires SSE1 minimum"));
            return;
        }
        if (cpuInf.SSE2)
            features += _S(", SSE2");
        else
        {
            Log.report(logvisor::Fatal, _S("URDE requires SSE2 minimum"));
            return;
        }
        if (cpuInf.SSE3)
            features += _S(", SSE3");
        if (cpuInf.SSSE3)
            features += _S(", SSSE3");
        if (cpuInf.SSE4a)
            features += _S(", SSE4a");
        if (cpuInf.SSE41)
            features += _S(", SSE4.1");
        if (cpuInf.SSE42)
            features += _S(", SSE4.2");
        Log.report(logvisor::Info, _S("CPU Features: %s"), features.c_str());
    }
开发者ID:KalDragon,项目名称:urde,代码行数:41,代码来源:main.cpp


示例17: InitializeIcons

boo::GraphicsDataToken InitializeIcons(specter::ViewResources& viewRes)
{
    athena::io::MemoryReader r(URDE_ICONS, URDE_ICONS_SZ);
    size_t fmt = r.readUint32Big();
    if (fmt != 16)
        Log.report(logvisor::Fatal, "incorrect icon texture format");
    size_t width = r.readUint16Big();
    size_t height = r.readUint16Big();
    size_t mips = r.readUint32Big();
    size_t decompSz = r.readUint32Big();

    std::unique_ptr<uint8_t[]> texels(new uint8_t[decompSz]);
    uLongf destSz = decompSz;
    size_t pos = r.position();
    if (uncompress(texels.get(), &destSz, URDE_ICONS + pos, URDE_ICONS_SZ - pos) != Z_OK)
        Log.report(logvisor::Fatal, "unable to decompress icons");

    g_IconAtlas.initializeAtlas(viewRes.m_factory->newStaticTexture(width, height, mips, boo::TextureFormat::RGBA8,
                                                                    texels.get(), destSz));
    return viewRes.m_factory->commit();
}
开发者ID:KalDragon,项目名称:urde,代码行数:21,代码来源:icons.cpp


示例18: GLXExtensionCheck

void GLXExtensionCheck() {
  if (!GLXEW_SGI_video_sync)
    Log.report(logvisor::Fatal, "GLX_SGI_video_sync not available");
  if (!GLXEW_EXT_swap_control && !GLXEW_MESA_swap_control && !GLXEW_SGI_swap_control)
    Log.report(logvisor::Fatal, "swap_control not available");
}
开发者ID:AxioDL,项目名称:boo,代码行数:6,代码来源:GLX.cpp


示例19: main

int main(int argc, const boo::SystemChar** argv)
#endif
{
  logvisor::RegisterConsoleLogger();

  std::vector<boo::SystemString> m_args;
  m_args.reserve(argc);
  double rate = NativeSampleRate;
  int chCount = 2;
  double volume = 1.0;
  for (int i = 1; i < argc; ++i) {
#if _WIN32
    if (!wcsncmp(argv[i], L"-r", 2)) {
      if (argv[i][2])
        rate = wcstod(&argv[i][2], nullptr);
      else if (argc > (i + 1)) {
        rate = wcstod(argv[i + 1], nullptr);
        ++i;
      }
    } else if (!wcsncmp(argv[i], L"-c", 2)) {
      if (argv[i][2])
        chCount = wcstoul(&argv[i][2], nullptr, 0);
      else if (argc > (i + 1)) {
        chCount = wcstoul(argv[i + 1], nullptr, 0);
        ++i;
      }
    } else if (!wcsncmp(argv[i], L"-v", 2)) {
      if (argv[i][2])
        volume = wcstod(&argv[i][2], nullptr);
      else if (argc > (i + 1)) {
        volume = wcstod(argv[i + 1], nullptr);
        ++i;
      }
    } else
      m_args.push_back(argv[i]);
#else
    if (!strncmp(argv[i], "-r", 2)) {
      if (argv[i][2])
        rate = strtod(&argv[i][2], nullptr);
      else if (argc > (i + 1)) {
        rate = strtod(argv[i + 1], nullptr);
        ++i;
      }
    } else if (!strncmp(argv[i], "-c", 2)) {
      if (argv[i][2])
        chCount = strtoul(&argv[i][2], nullptr, 0);
      else if (argc > (i + 1)) {
        chCount = strtoul(argv[i + 1], nullptr, 0);
        ++i;
      }
    } else if (!strncmp(argv[i], "-v", 2)) {
      if (argv[i][2])
        volume = strtod(&argv[i][2], nullptr);
      else if (argc > (i + 1)) {
        volume = strtod(argv[i + 1], nullptr);
        ++i;
      }
    } else
      m_args.push_back(argv[i]);
#endif
  }

  /* Load data */
  if (m_args.size() < 1) {
    Log.report(logvisor::Error,
               "Usage: amuserender <group-file> [<songs-file>] [-r <sample-rate>] [-c <channel-count>] [-v <volume "
               "0.0-1.0>]");
    return 1;
  }

  amuse::ContainerRegistry::Type cType = amuse::ContainerRegistry::DetectContainerType(m_args[0].c_str());
  if (cType == amuse::ContainerRegistry::Type::Invalid) {
    Log.report(logvisor::Error, "invalid/no data at path argument");
    return 1;
  }
  Log.report(logvisor::Info, _SYS_STR("Found '%s' Audio Group data"), amuse::ContainerRegistry::TypeToName(cType));

  std::vector<std::pair<amuse::SystemString, amuse::IntrusiveAudioGroupData>> data =
      amuse::ContainerRegistry::LoadContainer(m_args[0].c_str());
  if (data.empty()) {
    Log.report(logvisor::Error, "invalid/no data at path argument");
    return 1;
  }

  int m_groupId = -1;
  int m_setupId = -1;
  const amuse::SystemString* m_groupName = nullptr;
  const amuse::SystemString* m_songName = nullptr;
  amuse::ContainerRegistry::SongData* m_arrData = nullptr;
  bool m_sfxGroup = false;

  std::list<amuse::AudioGroupProject> m_projs;
  std::map<int, std::pair<std::pair<amuse::SystemString, amuse::IntrusiveAudioGroupData>*,
                          amuse::ObjToken<amuse::SongGroupIndex>>>
      allSongGroups;
  std::map<int, std::pair<std::pair<amuse::SystemString, amuse::IntrusiveAudioGroupData>*,
                          amuse::ObjToken<amuse::SFXGroupIndex>>>
      allSFXGroups;
  size_t totalGroups = 0;

//.........这里部分代码省略.........
开发者ID:AxioDL,项目名称:amuse,代码行数:101,代码来源:amuserender.cpp



注:本文中的logvisor::Module类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ lt::session类代码示例发布时间:2022-05-31
下一篇:
C++ logs::channel类代码示例发布时间:2022-05-31
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap