Esempio n. 1
0
//---------------------------------------------------------------------
// ● フレーム更新
//---------------------------------------------------------------------
void SceneGameover::onUpdate()
{
    mPointCursor->update();

    // 説明文描画中
    if ( !mFormatText.isFinished() )
    {
        mFormatText.update();
        LNFormatTextDrawData data;
        while ( mFormatText.getNextDrawData( &data ) )
        {
			mDescContents->DrawText(StringRef(data.Text, data.Length), data.Rect, data.Font, Color32::White, Color32::Black, 0, TextAlignment::Left);
        }
    }

    switch ( mStep )
    {
        /////////////////////// ブラインド中
        case 0:
        {
            mBlindSprite->SetOpacity( static_cast< float >( mFrameCount ) / 180 );
            ++mFrameCount;
            if ( mFrameCount == 120 )
            {
                mStep = 1;
                mFrameCount = 0;
                mLogoFadeValue.Start( 0.0f, 1.0f, 1.0f );
            }
            break;
        }
        /////////////////////// GameOver フェードイン中
        case 1:
        {
            mLogoFadeValue.AdvanceTime( 0.016f );
            mLogoSprite->SetOpacity( mLogoFadeValue.GetValue() );

            float y = ( 1.0f - mLogoFadeValue.GetValue() ) * 32 + 128;
            mLogoSprite->SetPosition( 320, y );

            
            if ( mFrameCount == 60 )
            {
                mStep = 2;
                mFrameCount = 0;
                mFadeValue.Start( 0.0f, 1.0f, 30.0f );
                _onSelectIndex();
            }
            ++mFrameCount;
            break;
        }
        /////////////////////// コンテンツフェードイン中
        case 2:
        {
            mFadeValue.AdvanceTime( 1.0f );

            float op = mFadeValue.GetValue();
            mDescWindowSprite->SetOpacity( op );
            mDescContentsSprite->SetOpacity( op );
            mCommandSprite[ 0 ]->SetOpacity( op );
            mCommandSprite[ 1 ]->SetOpacity( op );
            mBlindSprite2->SetOpacity( op / 2 );

            ++mFrameCount;
            if ( mFrameCount == 60 )
            {
                mStep = 3;
                mFrameCount = 0;
            }
            break;
        }
        /////////////////////// コンテンツ選択中
        case 3:
        {
            // 決定
            if ( Input::IsTriggered( LN_BUTTON_A ) )
            {
                mPointCursor->moveToInit();
                mStep = 4;
                mFrameCount = 0;
				Accessor::ToneLayer->ChangeTone(ToneF(-1, -1, -1, 0), 1.0f);
            }

            // ↑
            if ( Input::IsRepeated( LN_BUTTON_UP ) )
            {
                --mSelectIndex;
                if ( mSelectIndex < 0 )
                {
                    mSelectIndex = 1;
                }
                _onSelectIndex();
            }
            // ↓
            if ( Input::IsRepeated( LN_BUTTON_DOWN ) )
            {
                ++mSelectIndex;
                if ( mSelectIndex > 1 )
                {
                    mSelectIndex = 0;
                }
                _onSelectIndex();
            }
            break;
        }
        /////////////////////// 終了中
        case 4:
        {
            if ( mFrameCount == 60 )
            {
                if ( mSelectIndex == 0 )
                {

                    // 仮
                    //Audio.playBGM("Data/Sound/BGM/sol_battle014_xp.mid",60);

					if ( MapManager::getInstance()->getMapID() != 7 )
					{

						GameAudio::PlayBGM(MAIN_BGM_NAME,0.60);
					}

                    GameManager::getInstance()->reset();
                    this->returnScene();
                }
                else
                {
                    GameManager::getInstance()->finalize();
                    this->changeScene( NEW SceneTitle() );
                }
            }
            ++mFrameCount;
            break;
        }
    }

	// 以前はこの関数 (SceneGameover::onUpdate()) の先頭で親シーンの onUpdate() を呼び出していた。
	// しかし、コンティニュー時に現在のマップを再構築した後に onUpdate() が呼ばれなかったため、
	// 古いオブジェクトたちの解放が1フレーム遅れていた。(必要なくなったオブジェクトは onUpdate() で開放しているため)
	// 結果、一瞬だけ2倍相当のオブジェクトが出現することになり、描画可能なスプライト数を超えてしまった。
    this->getParentScene()->onUpdate();
}
Esempio n. 2
0
	inline
    String ReadCollection :: getName () const
        throw ( ErrorMsg )
    { return StringRef ( self -> getName () ) . toString (); }
Esempio n. 3
0
	StringRef substr(size_type pos) const {
		return StringRef(beg_ + pos, end_);
	}
Esempio n. 4
0
Node* SparrowGeneralFixture::createSimpleConcept(StringRef name, CompilationContext* ctx) {
    auto res = SprFrontend::mkSprConcept(createLocation(), name, StringRef("x"), nullptr, nullptr);
    if (ctx)
        Nest_setContext(res, ctx);
    return res;
}
static StringRef GetText(const Token &Tok, const SourceManager &Sources) {
  return StringRef(Sources.getCharacterData(Tok.getLocation()),
                   Tok.getLength());
}
Esempio n. 6
0
    StringRef substr(size_type pos, size_type count) const {
		return StringRef(beg_ + pos, beg_ + pos + count);
	}
Esempio n. 7
0
 StringRef substr(size_t pos = 0, size_t length = npos) {
   if (pos > length_) {
     return StringRef();
   }
   return StringRef(ptr_ + pos, std::min(length_ - pos, length));
 }
Esempio n. 8
0
void ScalarTraits<char_16>::output(const char_16 &Val, void *,
                                   llvm::raw_ostream &Out) {
  auto Len = strnlen(&Val[0], 16);
  Out << StringRef(&Val[0], Len);
}
Esempio n. 9
0
void ProjucerApplication::initialiseWindows (const String& commandLine)
{
    const String commandLineWithoutNSDebug (commandLine.replace ("-NSDocumentRevisionsDebugMode YES", StringRef()));

    if (commandLineWithoutNSDebug.trim().isNotEmpty() && ! commandLineWithoutNSDebug.trim().startsWithChar ('-'))
        anotherInstanceStarted (commandLine);
    else
        mainWindowList.reopenLastProjects();

    mainWindowList.createWindowIfNoneAreOpen();
}
Esempio n. 10
0
StringRef RuntimeDyldImpl::getEHFrameSection() {
  return StringRef();
}
void NonConstReferences::check(const MatchFinder::MatchResult &Result) {
  const auto *Parameter = Result.Nodes.getNodeAs<ParmVarDecl>("param");
  const auto *Function =
      dyn_cast_or_null<FunctionDecl>(Parameter->getParentFunctionOrMethod());

  if (Function == nullptr || Function->isImplicit())
    return;

  if (!Function->isCanonicalDecl())
    return;

  if (const CXXMethodDecl *Method = dyn_cast<CXXMethodDecl>(Function)) {
    // Don't warn on implementations of an interface using references.
    if (Method->begin_overridden_methods() != Method->end_overridden_methods())
      return;
    // Don't warn on lambdas, as they frequently have to conform to the
    // interface defined elsewhere.
    if (Method->getParent()->isLambda())
      return;
  }

  auto ReferencedType = *Result.Nodes.getNodeAs<QualType>("referenced_type");
  // Don't warn on function references, they shouldn't be constant.
  if (ReferencedType->isFunctionProtoType())
    return;

  // Don't warn on dependent types in templates.
  if (ReferencedType->isDependentType())
    return;

  if (Function->isOverloadedOperator()) {
    switch (Function->getOverloadedOperator()) {
      case clang::OO_LessLess:
      case clang::OO_PlusPlus:
      case clang::OO_MinusMinus:
      case clang::OO_PlusEqual:
      case clang::OO_MinusEqual:
      case clang::OO_StarEqual:
      case clang::OO_SlashEqual:
      case clang::OO_PercentEqual:
      case clang::OO_LessLessEqual:
      case clang::OO_GreaterGreaterEqual:
      case clang::OO_PipeEqual:
      case clang::OO_CaretEqual:
      case clang::OO_AmpEqual:
        // Don't warn on the first parameter of operator<<(Stream&, ...),
        // operator++, operator-- and operation+assignment operators.
        if (Function->getParamDecl(0) == Parameter)
          return;
        break;
      case clang::OO_GreaterGreater: {
        auto isNonConstRef = [](clang::QualType T) {
          return T->isReferenceType() &&
                 !T.getNonReferenceType().isConstQualified();
        };
        // Don't warn on parameters of stream extractors:
        //   Stream& operator>>(Stream&, Value&);
        // Both parameters should be non-const references by convention.
        if (isNonConstRef(Function->getParamDecl(0)->getType()) &&
            (Function->getNumParams() < 2 || // E.g. member operator>>.
             isNonConstRef(Function->getParamDecl(1)->getType())) &&
            isNonConstRef(Function->getReturnType()))
          return;
        break;
      }
      default:
        break;
    }
  }

  // Some functions use references to comply with established standards.
  if (Function->getDeclName().isIdentifier() && Function->getName() == "swap")
    return;

  // iostream parameters are typically passed by non-const reference.
  if (StringRef(ReferencedType.getAsString()).endswith("stream"))
    return;

  diag(Parameter->getLocation(),
       "non-const reference parameter '%0', make it const or use a pointer")
      << Parameter->getName();
}