⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 soundmanager.h.svn-base

📁 坦克大战游戏完整全套源代码
💻 SVN-BASE
字号:
#ifndef COMMON_SOUND_MANAGER_H#define COMMON_SOUND_MANAGER_H#include <string>#include <vector>#include <map>#include "caPoint2d.h"#include "common/entity.h"#include "common/utils.h"using std::map;using std::string;using std::vector;using cAni::Point2f;class HGE;class SoundManager : public Singleton<SoundManager>{public:    SoundManager();    virtual ~SoundManager();    HEFFECT load(const char *name);    void play(const char *name, const Point2f &pos, float volume = 1.0f);    void step(float gameTime, float deltaTime);protected:    HGE *hge;    map<string, HEFFECT> sounds;    struct ChannelInfo    {        float startTime;        float length;        float volume;        HCHANNEL channel;        //bool bOnline;        static bool CompareByVolume(const ChannelInfo &a, const ChannelInfo &b)        {            return a.volume > b.volume;        }    };    float curTime;    vector<ChannelInfo> channels;};#endif//COMMON_SOUND_MANAGER_H

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -