Linux multi-monitor fullscreen support
[ryzomcore.git] / ryzom / client / src / interface_v3 / flying_text_manager.h
blobd3d4c8957693279e2a10b127dc576b9e660bb36d
1 // Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
2 // Copyright (C) 2010 Winch Gate Property Limited
3 //
4 // This source file has been modified by the following contributors:
5 // Copyright (C) 2020 Jan BOON (Kaetemi) <jan.boon@kaetemi.be>
6 //
7 // This program is free software: you can redistribute it and/or modify
8 // it under the terms of the GNU Affero General Public License as
9 // published by the Free Software Foundation, either version 3 of the
10 // License, or (at your option) any later version.
12 // This program is distributed in the hope that it will be useful,
13 // but WITHOUT ANY WARRANTY; without even the implied warranty of
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 // GNU Affero General Public License for more details.
17 // You should have received a copy of the GNU Affero General Public License
18 // along with this program. If not, see <http://www.gnu.org/licenses/>.
21 #ifndef NL_FLYING_TEXT_MANAGER_H
22 #define NL_FLYING_TEXT_MANAGER_H
24 #include "nel/misc/types_nl.h"
25 #include "interface_pointer.h"
26 #include "nel/misc/rgba.h"
27 #include "nel/misc/vector.h"
28 #include <vector>
29 #include <map>
32 // ***************************************************************************
33 /**
34 * A Manager that manage allocation and display of flying text
35 * \author Lionel Berenguier
36 * \author Nevrax France
37 * \date 2004
39 class CFlyingTextManager
41 public:
43 /// Constructor
44 CFlyingTextManager();
45 ~CFlyingTextManager();
47 /// Called by CInterfaceManager::initInGame()
48 void initInGame();
49 /// Called by CInterfaceManager::releaseInGame()
50 void releaseInGame();
52 /** add a flying text at a position (called during entity display). NB: may fail if no more free groups
53 * \param offsetx: screen offsetx of the group in scene
55 void addFlyingText(void *key, const std::string &text, const NLMISC::CVector &pos, NLMISC::CRGBA color, float scale, sint offsetX=0);
56 /// release no more used flying text (called by CEntityManager at each draw)
57 void releaseNotUsedFlyingText();
59 /// get the special offsetX for character (from define)
60 sint getOffsetXForCharacter() const {return _CharacterWindowOffsetX;}
62 private:
63 struct CGroupInfo
65 class CGroupInScene *GroupInScene;
66 class CViewText *ViewText;
67 bool UsedThisFrame;
68 CGroupInfo()
70 GroupInScene= NULL;
71 ViewText= NULL;
72 UsedThisFrame= false;
76 // pool of interface
77 std::vector<CGroupInfo> _InScenePool;
78 // interface currently displayed
79 typedef std::map<void *, CGroupInfo> TInSceneCurrentMap;
80 TInSceneCurrentMap _InSceneCurrent;
81 // Root Interface ptr
82 CInterfaceGroupPtr _Root;
83 // special decal for character
84 sint _CharacterWindowOffsetX;
86 // release properly
87 void linkToInterface(CGroupInfo &gi);
88 void unlinkToInterface(CGroupInfo &gi);
92 #endif // NL_FLYING_TEXT_MANAGER_H
94 /* End of flying_text_manager.h */