.osr 文件格式解析(四) - LifeBarGraph和TimeStamp

上一遍我们已经把osr的全部数据读出来了,虽然有些还不能看,但是至少全部的数据已经读取完毕了。这章我们来讲讲LifeBarGraph和TimeStamp。

##LifeBarGraph
在上一章我们读取出来的LifeBarGraph是下面这样的:

	2254|1,4681|1,7548|1,9974|1,12181|1,15492|1,30489|1,32916|1,35135|1,37769|1,39988|1,42197|1,44386|1,47034|1,49220|1,51445|1,53629|1,55862|0.98,58614|1,60710|1,62901|1,65121|1,67437|0.99,69533|1,71695|...

ppy原文:Life bar graph: comma separated pairs u┃v, where u is the time in milliseconds into the song and v is a floating point value from 0 - 1 that represents the amount of life you have at the given time (0 = life bar is empty, 1= life bar is full).
大概意思就是LifeBar 是以逗号(,)分隔的形如"u|v"的字符串,其u是时间(毫秒),v是HP百分比

搞这么复杂,其实就是一个结构体啦

    struct osrLifeBar
    {
        int time;	//时间(毫秒)
        float life;	//生命值[0,1]
    }


    std::vector<osrLifeBar> LoadOsrLifeBar(const std::string str)
    {
    	std::vector<osrLifeBar> LifeBar;
    	std::vector<std::string> lif
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值