From: Javier Fernandez-I. <iv...@us...> - 2005-02-27 23:55:06
|
Update of /cvsroot/planeshift/planeshift/src/client In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10880/src/client Modified Files: psengine.h psengine.cpp Log Message: Sounds are now muted when the canvas is hidden. Additionally, there is an option to mute sounds when the client loses focus. Index: psengine.h =================================================================== RCS file: /cvsroot/planeshift/planeshift/src/client/psengine.h,v retrieving revision 1.150 retrieving revision 1.151 diff -C2 -d -r1.150 -r1.151 *** psengine.h 27 Feb 2005 16:57:34 -0000 1.150 --- psengine.h 27 Feb 2005 23:54:51 -0000 1.151 *************** *** 2,6 **** * psengine.h * ! * Copyright (C) 2001 PlaneShift Team (in...@pl..., * http://www.planeshift.it) * --- 2,6 ---- * psengine.h * ! * Copyright (C) 2001 PlaneShift Team (in...@pl..., * http://www.planeshift.it) * *************** *** 130,139 **** iVirtualClock *GetVirtualClock() { return vc; } iDocumentSystem* GetXMLParser () const { return xmlparser; } ! /** gets a reference to the iLoader plugin * @return the iLoader plugin */ iLoader *GetLoader() { return loader; } ! MsgHandler *GetMsgHandler(); CmdHandler *GetCmdHandler(); --- 130,139 ---- iVirtualClock *GetVirtualClock() { return vc; } iDocumentSystem* GetXMLParser () const { return xmlparser; } ! /** gets a reference to the iLoader plugin * @return the iLoader plugin */ iLoader *GetLoader() { return loader; } ! MsgHandler *GetMsgHandler(); CmdHandler *GetCmdHandler(); *************** *** 142,149 **** psSlotManager* GetSlotManager() { return slotManager;} ClientCacheManager* GetCacheManager() { return cachemanager; } ! psClientCharManager * GetCharManager() { return charmanager; } ! /// check if the game has been loaded or not --- 142,149 ---- psSlotManager* GetSlotManager() { return slotManager;} ClientCacheManager* GetCacheManager() { return cachemanager; } ! psClientCharManager * GetCharManager() { return charmanager; } ! /// check if the game has been loaded or not *************** *** 160,164 **** psMainWidget *GetMainWidget() { return mainWidget; } psMouseBinds* GetMouseBinds(); ! psEffectManager* GetEffectManager() { return effectManager; } --- 160,164 ---- psMainWidget *GetMainWidget() { return mainWidget; } psMouseBinds* GetMouseBinds(); ! psEffectManager* GetEffectManager() { return effectManager; } *************** *** 166,176 **** ModeHandler* GetModeHandler() { return modehandler; } ! // Get the Action Handler ! ActionHandler* GetActionHandler() { return actionhandler; }; /// access the player's petitioner target void SetTargetPetitioner(const char * pet) { targetPetitioner = pet; } const char * GetTargetPetitioner() { return targetPetitioner; } ! //quits client void QuitClient(); --- 166,176 ---- ModeHandler* GetModeHandler() { return modehandler; } ! // Get the Action Handler ! ActionHandler* GetActionHandler() { return actionhandler; }; /// access the player's petitioner target void SetTargetPetitioner(const char * pet) { targetPetitioner = pet; } const char * GetTargetPetitioner() { return targetPetitioner; } ! //quits client void QuitClient(); *************** *** 214,219 **** float GetKFactor() { return KFactor; } void SetKFactor(float K) { KFactor = K; } ! ! psCharControlManager* GetCharControl() { return charControl; } iEvent* GetLastEvent() { return lastEvent; } --- 214,219 ---- float GetKFactor() { return KFactor; } void SetKFactor(float K) { KFactor = K; } ! ! psCharControlManager* GetCharControl() { return charControl; } iEvent* GetLastEvent() { return lastEvent; } *************** *** 222,237 **** csRandomGen& GetRandomGen(){ return random; } float GetRandom() { return random.Get(); } ! /** Loads in a material and gives it a name. * * @param materialName The name this material should use. * @param texture The name of the texture file this material should use. ! * @return A material wrapper if successful in loading or finding the * material, NULL otherwise. */ ! iMaterialWrapper* LoadMaterial( const char* materialName, const char* texture ); ! /** Attach a mesh to another mesh in a particular socket on a different mesh. ! * * @param mesh The mesh to attach to. * @param socket The name of the socket to attach to. --- 222,237 ---- csRandomGen& GetRandomGen(){ return random; } float GetRandom() { return random.Get(); } ! /** Loads in a material and gives it a name. * * @param materialName The name this material should use. * @param texture The name of the texture file this material should use. ! * @return A material wrapper if successful in loading or finding the * material, NULL otherwise. */ ! iMaterialWrapper* LoadMaterial( const char* materialName, const char* texture ); ! /** Attach a mesh to another mesh in a particular socket on a different mesh. ! * * @param mesh The mesh to attach to. * @param socket The name of the socket to attach to. *************** *** 243,250 **** /** Sets a trait on a cal3d submesh ! * * @param mesh The mesh to change * @param trait The trait to set. ! */ bool SetTrait( iMeshWrapper* mesh, Trait * trait); --- 243,250 ---- /** Sets a trait on a cal3d submesh ! * * @param mesh The mesh to change * @param trait The trait to set. ! */ bool SetTrait( iMeshWrapper* mesh, Trait * trait); *************** *** 254,261 **** * @param xmlString The xml string that describes the appearance. * ! * @return true if the appearance could be constructed on the mesh. */ bool BuildAppearance( iMeshWrapper* mesh, const char* xmlString ); ! /** Attaches meshes to a player based on the equipment string passed in. * --- 254,261 ---- * @param xmlString The xml string that describes the appearance. * ! * @return true if the appearance could be constructed on the mesh. */ bool BuildAppearance( iMeshWrapper* mesh, const char* xmlString ); ! /** Attaches meshes to a player based on the equipment string passed in. * *************** *** 265,269 **** */ void BuildEquipment( iMeshWrapper* mesh, const char* equipment ); ! /** Remove a mesh from a particular socket. * --- 265,269 ---- */ void BuildEquipment( iMeshWrapper* mesh, const char* equipment ); ! /** Remove a mesh from a particular socket. * *************** *** 273,279 **** * @return True if the detach was successful. */ ! bool Detach( iMeshWrapper* mesh, const char* socket ); ! ! /** Changes the material that is on a mesh. * Assumes that the mesh is infact a cal3d state mesh. --- 273,279 ---- * @return True if the detach was successful. */ ! bool Detach( iMeshWrapper* mesh, const char* socket ); ! ! /** Changes the material that is on a mesh. * Assumes that the mesh is infact a cal3d state mesh. *************** *** 286,290 **** */ bool ChangeMaterial( iMeshWrapper* mesh, csString& part, csString& material, csString& texture ); ! /** Changes the materail on a submesh back to the default material. * @param mesh The main mesh wrapper --- 286,290 ---- */ bool ChangeMaterial( iMeshWrapper* mesh, csString& part, csString& material, csString& texture ); ! /** Changes the materail on a submesh back to the default material. * @param mesh The main mesh wrapper *************** *** 325,329 **** */ void SetLoadedMap(bool value) { loadedMap = value; } ! /** Checks if the client had any errors during the loading state * @return value --- 325,329 ---- */ void SetLoadedMap(bool value) { loadedMap = value; } ! /** Checks if the client had any errors during the loading state * @return value *************** *** 347,354 **** void AddLoadingWindowMsg(const csString & msg); ! /** Shortcut to pawsQuitInfoBox ! * @param Message to display before quiting ! */ ! void FatalError(const char* msg); /** Logged in? --- 347,354 ---- void AddLoadingWindowMsg(const csString & msg); ! /** Shortcut to pawsQuitInfoBox ! * @param Message to display before quiting ! */ ! void FatalError(const char* msg); /** Logged in? *************** *** 357,371 **** void SetLoggedIn(bool v){ loggedIn = v;} ! /** Set the number of characters this player has. * Used to wait for full loading of characters in selection screen. */ void SetNumChars( int chars ) { numOfChars = chars; } ! ! /// Get the number of characters this player should have. int GetNumChars() { return numOfChars; } /// Force the next frame to get drawn. Used when updating LoadWindow. void ForceRefresh() { elapsed = 10000; } ! /// Set Guild Name here for use with Entity labels void SetGuildName(const char *name) { guildname = name; } --- 357,371 ---- void SetLoggedIn(bool v){ loggedIn = v;} ! /** Set the number of characters this player has. * Used to wait for full loading of characters in selection screen. */ void SetNumChars( int chars ) { numOfChars = chars; } ! ! /// Get the number of characters this player should have. int GetNumChars() { return numOfChars; } /// Force the next frame to get drawn. Used when updating LoadWindow. void ForceRefresh() { elapsed = 10000; } ! /// Set Guild Name here for use with Entity labels void SetGuildName(const char *name) { guildname = name; } *************** *** 374,381 **** const char *GetGuildName() { return guildname; } ! private: // Load the log report settings from the config file. void LoadLogSettings(); ! /// queries all needed plugins bool QueryPlugins(); --- 374,405 ---- const char *GetGuildName() { return guildname; } ! /** Gets whether sounds should be muted when the application loses focus. ! * ! * @return true if sounds should be muted, false otherwise ! */ ! bool GetMuteSoundsOnFocusLoss(void) const ! { ! return muteSoundsOnFocusLoss; ! } ! ! /** Sets whether sounds should be muted when the application loses focus. ! * ! * @param value true if sounds should be muted, false otherwise ! */ ! void SetMuteSoundsOnFocusLoss(bool value) ! { ! muteSoundsOnFocusLoss = value; ! } ! ! /// Mute all sounds. ! void MuteAllSounds(void); ! ! /// Unmute all sounds. ! void UnmuteAllSounds(void); ! ! private: // Load the log report settings from the config file. void LoadLogSettings(); ! /// queries all needed plugins bool QueryPlugins(); *************** *** 390,394 **** iObjectRegistry* object_reg; /// Engine plug-in handle. ! csRef<iEngine> engine; /// config Manager csRef<iConfigManager> cfgmgr; --- 414,418 ---- iObjectRegistry* object_reg; /// Engine plug-in handle. ! csRef<iEngine> engine; /// config Manager csRef<iConfigManager> cfgmgr; *************** *** 396,411 **** csRef<iTextureManager> txtmgr; /// Virtual File System ! csRef<iVFS> vfs; /// 2d canvas ! csRef<iGraphics2D> g2d; /// 3d canvas ! csRef<iGraphics3D> g3d; /// PS Sound manager csRef<iSoundManager> soundmanager; /// Event Queue ! csRef<iEventQueue> queue; /// network manager ! csRef<psNetManager> netmanager; /// clock csRef<iVirtualClock> vc; --- 420,435 ---- csRef<iTextureManager> txtmgr; /// Virtual File System ! csRef<iVFS> vfs; /// 2d canvas ! csRef<iGraphics2D> g2d; /// 3d canvas ! csRef<iGraphics3D> g3d; /// PS Sound manager csRef<iSoundManager> soundmanager; /// Event Queue ! csRef<iEventQueue> queue; /// network manager ! csRef<psNetManager> netmanager; /// clock csRef<iVirtualClock> vc; *************** *** 420,429 **** // Handling background audio sent from server, etc. ! csRef<ModeHandler> modehandler; ! csRef<ActionHandler> actionhandler; // Region/map file memory manager. ! csRef<ZoneHandler> zonehandler; /* status, misc. vars */ --- 444,453 ---- // Handling background audio sent from server, etc. ! csRef<ModeHandler> modehandler; ! csRef<ActionHandler> actionhandler; // Region/map file memory manager. ! csRef<ZoneHandler> zonehandler; /* status, misc. vars */ *************** *** 440,449 **** csString lasterror; ! csString guildname; ///Holds the charactermanager psClientCharManager *charmanager; ! // Used to stop rendering when the window is minimized bool drawScreen; --- 464,473 ---- csString lasterror; ! csString guildname; ///Holds the charactermanager psClientCharManager *charmanager; ! // Used to stop rendering when the window is minimized bool drawScreen; *************** *** 474,487 **** bool okToLoadModels; // Make sure that it is allowed to start preloading float KFactor; // Hold the K factor used for casting spells. ! iEvent* lastEvent; csRandomGen random; ! ! psSlotManager* slotManager; psQuestionClient* questionclient; ! //Confirmation type on duels int confirmation; --- 498,511 ---- bool okToLoadModels; // Make sure that it is allowed to start preloading float KFactor; // Hold the K factor used for casting spells. ! iEvent* lastEvent; csRandomGen random; ! ! psSlotManager* slotManager; psQuestionClient* questionclient; ! //Confirmation type on duels int confirmation; *************** *** 492,501 **** //Widget load errors csArray<csString> wdgProblems; ! ! /// Stores the number of chars available to this player. Used in loading. int numOfChars; /// Time elapsed since the last drawn frame. Used during loading. int elapsed; }; --- 516,528 ---- //Widget load errors csArray<csString> wdgProblems; ! ! /// Stores the number of chars available to this player. Used in loading. int numOfChars; /// Time elapsed since the last drawn frame. Used during loading. int elapsed; + + /// Whether sounds should be muted when the application loses focus. + bool muteSoundsOnFocusLoss; }; Index: psengine.cpp =================================================================== RCS file: /cvsroot/planeshift/planeshift/src/client/psengine.cpp,v retrieving revision 1.468 retrieving revision 1.469 diff -C2 -d -r1.468 -r1.469 *** psengine.cpp 27 Feb 2005 17:10:35 -0000 1.468 --- psengine.cpp 27 Feb 2005 23:54:51 -0000 1.469 *************** *** 227,236 **** loadstate = LS_NONE; loadError = false; ! charmanager=NULL; slotManager=NULL; questionclient = NULL; modehandler = 0; ! actionhandler = 0; zonehandler = NULL; loadtimeout = 0; [...1401 lines suppressed...] // start the main event loop csDefaultRunLoop(object_reg); // Remove engine from object registry ! object_reg->Unregister ((iPSEngine*) psengine, "iPSEngine"); // delete main object *************** *** 1869,1873 **** csInitializer::DestroyApplication(object_reg); ! return 0; } --- 1904,1908 ---- csInitializer::DestroyApplication(object_reg); ! return 0; } |