Subversion Repository Public Repository

Divide-Framework

This repository has no backups
This repository's network speed is throttled to 100KB/sec

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#include "stdafx.h"

#include "Headers/SceneGUIElements.h"

#include "Headers/GUI.h"
#include "Headers/GUIFlash.h"
#include "Headers/GUIText.h"
#include "Headers/GUIButton.h"
#include "Headers/GUIConsole.h"
#include "Headers/GUIMessageBox.h"

#include "Platform/Video/Headers/GFXDevice.h"

#include <CEGUI/CEGUI.h>

namespace Divide {

SceneGUIElements::SceneGUIElements(Scene& parentScene, GUI& context)
    : GUIInterface(context, context.getDisplayResolution()),
      SceneComponent(parentScene)
{
}

SceneGUIElements::~SceneGUIElements()
{
}

void SceneGUIElements::draw(GFXDevice& context) {
    for (U8 i = 0; i < to_base(GUIType::COUNT); ++i) {
        if (i != to_base(GUIType::GUI_TEXT)) {
            for (const GUIMap::value_type& guiStackIterator : _guiElements[i]) {
                GUIElement& element = *guiStackIterator.second.first;
                // Skip hidden elements
                if (element.isVisible()) {
                    element.draw(context);
                }
            }
        }
    }

    TextElementBatch batch;
    for (const GUIMap::value_type& guiStackIterator : _guiElements[to_base(GUIType::GUI_TEXT)]) {
        GUIText& textElement = static_cast<GUIText&>(*guiStackIterator.second.first);
        if (!textElement.text().empty()) {
            batch._data.emplace_back(textElement, textElement.getPosition());
        }
    }

    if (!batch().empty()) {
        Attorney::GFXDeviceGUI::drawText(context, batch);
    }
}

void SceneGUIElements::onEnable() {
    for (U8 i = 0; i < to_base(GUIType::COUNT); ++i) {
        for (const GUIMap::value_type& guiStackIterator : _guiElements[i]) {
            guiStackIterator.second.first->setVisible(guiStackIterator.second.second);
        }
    }
}

void SceneGUIElements::onDisable() {
    for (U8 i = 0; i < to_base(GUIType::COUNT); ++i) {
        for (const GUIMap::value_type& guiStackIterator : _guiElements[i]) {
            guiStackIterator.second.first->setVisible(false);
        }
    }
}

}; // namespace Divide

Commits for Divide-Framework/trunk/Source Code/GUI/SceneGUIElements.cpp

Diff revisions: vs.
Revision Author Commited Message
946 Diff Diff IonutCava picture IonutCava Sun 01 Oct, 2017 21:25:10 +0000

[Ionut]
- Attempt to fix text rendering / flashing issue (improved but not fixed yet)

941 Diff Diff IonutCava picture IonutCava Mon 04 Sep, 2017 20:55:02 +0000

[Ionut]
- Update CEGUI from static to dynamic config (some dlls might still be missing)
- Attempt to work around a weird string issue with the newest VS2017 update

927 Diff Diff IonutCava picture IonutCava Thu 10 Aug, 2017 21:55:10 +0000

[Ionut]
- Cleanup Text rendering and text related structs
- Add labels to DebugViews

890 Diff Diff IonutCava picture IonutCava Sun 14 May, 2017 20:54:59 +0000

[Ionut]
- Add pre-compiled header support
- Initial code for per-stage tessellation computation

872 Diff Diff IonutCava picture IonutCava Mon 06 Mar, 2017 23:23:20 +0000

[IonutCava]
- Optimise static casts

867 Diff Diff IonutCava picture IonutCava Mon 20 Feb, 2017 17:01:12 +0000

[IonutCava]
- Rename to_XNN and to_const_XNN functions to reflect the target data type they are converting to.
- Cleanup Angle namespace and remove all “inDegrees” parameters from rotation functions. Use aliases to differentiate between Degree and Radian parameters.
- Profile guided optimizations.

818 Diff Diff IonutCava picture IonutCava Mon 16 Jan, 2017 17:23:20 +0000

[IonutCava]
- Units get their bound node setup by the SGN UnitComponent and not during creation
- Profile guided optimizations

802 Diff Diff IonutCava picture IonutCava Tue 29 Nov, 2016 17:15:38 +0000

[IonutCava]
- GUI class is no longer a Singleton
- Reduced usage of GFXDevice::instance()

715 Diff Diff IonutCava picture IonutCava Fri 27 May, 2016 16:19:22 +0000

[IonutCava]
- Added initial Fade In / Fade Out post effect (used for scene transitions for now)
- Added a GUI Interface that handles a list of GUI elements (used by GUI and SceneGUIElements)
- Fixed some race conditions related to multi-threaded scene loading (a lot remain to be fixed)
- Improved per-thread GPU sync system a bit
- Simplified Singleton define macros (although we should get rid of singletons all together)

714 IonutCava picture IonutCava Thu 26 May, 2016 16:26:23 +0000

[IonutCava]
- Initial code for multithreaded scene load:
— Tasks can have a “sync with gpu” flag that will cause them to use a shared context (so they can call GL functions)
- Added per scene GUI lists that get passed to the main GUI class (still need a base class to hold the map and accessors to avoid code duplication)
- Re-enabled threading unit tests