Пример #1
0
void AliveAudio::PlayOneShot(std::string soundID)
{
	jsonxx::Array soundList = AliveAudio::m_Config.get<jsonxx::Array>("sounds");

	for (int i = 0; i < soundList.size(); i++)
	{
		jsonxx::Object sndObj = soundList.get<jsonxx::Object>(i);
		if (sndObj.get<jsonxx::String>("id") == soundID)
		{
			float randA = 0;
			float randB = 0;

			if (sndObj.has<jsonxx::Array>("pitchrand"))
			{
				randA = (float)sndObj.get<jsonxx::Array>("pitchrand").get<jsonxx::Number>(0);
				randB = (float)sndObj.get<jsonxx::Array>("pitchrand").get<jsonxx::Number>(1);
			}

			PlayOneShot((int)sndObj.get<jsonxx::Number>("prog"), (int)sndObj.get<jsonxx::Number>("note"), 1.0f, AliveAudioHelper::RandFloat(randA, randB));
		}
	}
}
Пример #2
0
void AliveAudio::DebugPlayFirstToneSample(int program, int tone)
{
	PlayOneShot(program, (m_CurrentSoundbank->m_Programs[program]->m_Tones[tone]->Min + m_CurrentSoundbank->m_Programs[program]->m_Tones[tone]->Max) / 2, 1);
}
Пример #3
0
void customize_Scene::MouseClick(void)
{

	if (PtInRect(&_HairLeft.rc, GetMousePos()))
	{
		if (HairNum > -1)
		{
			HairNum--;
			Push = true;
		}
		else
		{
			HairNum = _vHair.size() - 1;
			Push = true;
		}
	}
	else if (PtInRect(&_HairRight.rc, GetMousePos()))
	{
		if (HairNum < _vHair.size() - 1 || HairNum == -1)
		{
			HairNum++;
			Push = true;
		}
		else
		{
			HairNum = -1;
			Push = true;
		}
	}
	else if (PtInRect(&_HeadLeft.rc, GetMousePos()))
	{
		if (HeadNum > 0)
		{
			PrevNum2 = HeadNum;
			HeadNum--;
			Push2 = true;
		}
		else
		{
			PrevNum2 = HeadNum;
			HeadNum = _vHead.size() - 1;
			Push2 = true;
		}
	}
	else if (PtInRect(&_HeadRight.rc, GetMousePos()))
	{
		if (HeadNum < _vHead.size() - 1)
		{
			PrevNum2 = HeadNum;
			HeadNum++;
			Push2 = true;
		}
		else
		{
			PrevNum2 = HeadNum;
			HeadNum = 0;
			Push2 = true;
		}

	}
	else if (PtInRect(&_CameraFace.rc, GetMousePos()))
	{
		Z = 2;
		Y = 4.5;
		LookY = 4.3;
	}
	else if (PtInRect(&_CameraBody.rc, GetMousePos()))
	{
		Z = 6;
		Y = 4.5;
		LookY = 2;
	}
	else if (PtInRect(&_Plus.rc, GetMousePos()))
	{
		if (Z > 0.5)
		Z -= 0.2;
	}
	else if (PtInRect(&_Minus.rc, GetMousePos()))
	{
		if (Z < 10)
			Z += 0.2;
	}
	else if (PtInRect(&_Up.rc, GetMousePos()))
	{
		Y += 0.2;
	}
	else if (PtInRect(&_Down.rc, GetMousePos()))
	{
		Y -= 0.2;
	}
	else if (PtInRect(&_LookUp.rc, GetMousePos()))
	{
		LookY += 0.2;
	}
	else if (PtInRect(&_LookDown.rc, GetMousePos()))
	{
		LookY -= 0.2;
	}
	else if (PtInRect(&_AtkAni1.rc, GetMousePos()))
	{
		if (!Ani)
		{
			PlayOneShot("Combo1_Double");
			Ani = true;
		}
	}
	else if (PtInRect(&_AtkAni2.rc, GetMousePos()))
	{
		if (!Ani)
		{
			PlayOneShot("Combo2_Double");
			Ani = true;
		}
	}
	else if (PtInRect(&_GuardAni.rc, GetMousePos()))
	{
		if (!Ani)
		{
			PlayOneShot("Idle3");
			Ani = true;
		}
	}
	else if (PtInRect(&_MoveAni.rc, GetMousePos()))
	{
		if (!Ani)
		{
			PlayOneShot("Run");
			Ani = true;
		}		
	}
	else if (PtInRect(&_Ok.rc, GetMousePos()))
	{
		if (HairNum == -1)
		{
			SCENEMANAGER->FindScece("game")->TempHair = "없음";
		}
		else
		{
			SCENEMANAGER->FindScece("game")->TempHair = _vHair[HairNum]->filePath;
		}
		SCENEMANAGER->FindScece("game")->TempHead = _vHead[HeadNum]->filePath;
		SCENEMANAGER->FindScece("game")->TempColor = _HairColor;
		
		for (int i = 0; i < _vHead.size(); i++)
		{
			if (i == HeadNum)continue;
			RESOURCE_SKINNEDXMESH->RemoveResource(_vHead[i]->filePath);
		}
		if (HairNum == -1)
		{
			for (int i = 0; i < _vHair.size(); i++)
			{
				RESOURCE_SKINNEDXMESH->RemoveResource(_vHair[i]->filePath);
			}
		}
		else
		{
			for (int i = 0; i < _vHair.size(); i++)
			{
				if (i == HairNum)continue;
				RESOURCE_SKINNEDXMESH->RemoveResource(_vHair[i]->filePath);
			}
		}
		//RESOURCE_TEXTURE->ClearResource();
		SCENEMANAGER->ChangeScene("game");
	} 
	else if (PtInRect(&_ColorBarControlR.rc, GetMousePos()))
	{
		R = true; WINSIZEX; WINSIZEY;
	}
	else if (PtInRect(&_ColorBarControlG.rc, GetMousePos()))
	{
		G = true;
	}
	else if (PtInRect(&_ColorBarControlB.rc, GetMousePos()))
	{
		B = true;
	}
	else if (PtInRect(&_ColorBarControlA.rc, GetMousePos()))
	{
		A = true;
	}
	else if (PtInRect(&_ColorBlue.rc, GetMousePos()))
	{
		_ColorBarControlR.x = 995;
		_ColorBarControlG.x = 995;
		_ColorBarControlB.x = 1180;
		_ColorBarControlR.rc = RectMakeCenter(_ColorBarControlR.x, _ColorBarControlR.y, 32, 32);
		_ColorBarControlG.rc = RectMakeCenter(_ColorBarControlG.x, _ColorBarControlG.y, 32, 32);
		_ColorBarControlB.rc = RectMakeCenter(_ColorBarControlB.x, _ColorBarControlB.y, 32, 32);
		_R = _ColorBarControlR.x - 995;
		_G = _ColorBarControlG.x - 995;
		_B = _ColorBarControlB.x - 995;
	}
	else if (PtInRect(&_ColorBlack.rc, GetMousePos()))
	{
		_ColorBarControlR.x = 995;
		_ColorBarControlG.x = 995;
		_ColorBarControlB.x = 995;
		_ColorBarControlR.rc = RectMakeCenter(_ColorBarControlR.x, _ColorBarControlR.y, 32, 32);
		_ColorBarControlG.rc = RectMakeCenter(_ColorBarControlG.x, _ColorBarControlG.y, 32, 32);
		_ColorBarControlB.rc = RectMakeCenter(_ColorBarControlB.x, _ColorBarControlB.y, 32, 32);
		_R = _ColorBarControlR.x - 995;
		_G = _ColorBarControlG.x - 995;
		_B = _ColorBarControlB.x - 995;
	}
	else if (PtInRect(&_ColorGreen.rc, GetMousePos()))
	{
		_ColorBarControlR.x = 995;
		_ColorBarControlG.x = 1180;
		_ColorBarControlB.x = 995;
		_ColorBarControlR.rc = RectMakeCenter(_ColorBarControlR.x, _ColorBarControlR.y, 32, 32);
		_ColorBarControlG.rc = RectMakeCenter(_ColorBarControlG.x, _ColorBarControlG.y, 32, 32);
		_ColorBarControlB.rc = RectMakeCenter(_ColorBarControlB.x, _ColorBarControlB.y, 32, 32);
		_R = _ColorBarControlR.x - 995;
		_G = _ColorBarControlG.x - 995;
		_B = _ColorBarControlB.x - 995;
	}
	else if (PtInRect(&_ColorRed.rc, GetMousePos()))
	{
		_ColorBarControlR.x = 1180;
		_ColorBarControlG.x = 995;
		_ColorBarControlB.x = 995;
		_ColorBarControlR.rc = RectMakeCenter(_ColorBarControlR.x, _ColorBarControlR.y, 32, 32);
		_ColorBarControlG.rc = RectMakeCenter(_ColorBarControlG.x, _ColorBarControlG.y, 32, 32);
		_ColorBarControlB.rc = RectMakeCenter(_ColorBarControlB.x, _ColorBarControlB.y, 32, 32);
		_R = _ColorBarControlR.x - 995;
		_G = _ColorBarControlG.x - 995;
		_B = _ColorBarControlB.x - 995;
	}
	else if (PtInRect(&_ColorSky.rc, GetMousePos()))
	{
		_ColorBarControlR.x = 995;
		_ColorBarControlG.x = 1180;
		_ColorBarControlB.x = 1180;
		_ColorBarControlR.rc = RectMakeCenter(_ColorBarControlR.x, _ColorBarControlR.y, 32, 32);
		_ColorBarControlG.rc = RectMakeCenter(_ColorBarControlG.x, _ColorBarControlG.y, 32, 32);
		_ColorBarControlB.rc = RectMakeCenter(_ColorBarControlB.x, _ColorBarControlB.y, 32, 32);
		_R = _ColorBarControlR.x - 995;
		_G = _ColorBarControlG.x - 995;
		_B = _ColorBarControlB.x - 995;
	}
	else if (PtInRect(&_ColorYellow.rc, GetMousePos()))
	{
		_ColorBarControlR.x = 1180;
		_ColorBarControlG.x = 1180;
		_ColorBarControlB.x = 995;
		_ColorBarControlR.rc = RectMakeCenter(_ColorBarControlR.x, _ColorBarControlR.y, 32, 32);
		_ColorBarControlG.rc = RectMakeCenter(_ColorBarControlG.x, _ColorBarControlG.y, 32, 32);
		_ColorBarControlB.rc = RectMakeCenter(_ColorBarControlB.x, _ColorBarControlB.y, 32, 32);
		_R = _ColorBarControlR.x - 995;
		_G = _ColorBarControlG.x - 995;
		_B = _ColorBarControlB.x - 995;
	}
	else if (PtInRect(&_ColorRand.rc, GetMousePos()))
	{
		_ColorBarControlR.x = RandomFloatRange(995,1180);
		_ColorBarControlG.x = RandomFloatRange(995,1180);
		_ColorBarControlB.x = RandomFloatRange(995,1180);
		_ColorBarControlR.rc = RectMakeCenter(_ColorBarControlR.x, _ColorBarControlR.y, 32, 32);
		_ColorBarControlG.rc = RectMakeCenter(_ColorBarControlG.x, _ColorBarControlG.y, 32, 32);
		_ColorBarControlB.rc = RectMakeCenter(_ColorBarControlB.x, _ColorBarControlB.y, 32, 32);
		_R = _ColorBarControlR.x - 995;
		_G = _ColorBarControlG.x - 995;
		_B = _ColorBarControlB.x - 995;
	}
	//pMainCamera->GetWorldPosToScreenPos()
}