summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author Miodrag Milanovic <mmicko@gmail.com>2015-02-14 12:53:08 +0100
committer Miodrag Milanovic <mmicko@gmail.com>2015-02-14 12:53:08 +0100
commit8afe66fc634116a654becad7d9f7f53ab199da41 (patch)
tree8c3b7889cba36cbcd2b9d6d8d6b3df87dd495cb2
parent20b68364f7fa3bf692e50504fecf9bc5825eada3 (diff)
Updated BGFX, BX and GENie to latest (nw)
-rw-r--r--3rdparty/bgfx/.gitignore1
-rw-r--r--3rdparty/bgfx/3rdparty/ocornut-imgui/imgui.cpp1704
-rw-r--r--3rdparty/bgfx/3rdparty/ocornut-imgui/imgui.h177
-rw-r--r--3rdparty/bgfx/README.md17
-rw-r--r--3rdparty/bgfx/examples/08-update/update.cpp8
-rw-r--r--3rdparty/bgfx/examples/18-ibl/ibl.cpp10
-rw-r--r--3rdparty/bgfx/examples/common/bgfx_utils.cpp2
-rw-r--r--3rdparty/bgfx/examples/common/common.h5
-rw-r--r--3rdparty/bgfx/examples/common/entry/cmd.cpp19
-rw-r--r--3rdparty/bgfx/examples/common/entry/cmd.h9
-rw-r--r--3rdparty/bgfx/examples/common/entry/entry.cpp34
-rw-r--r--3rdparty/bgfx/examples/common/entry/entry_osx.mm30
-rw-r--r--3rdparty/bgfx/examples/common/entry/entry_p.h12
-rw-r--r--3rdparty/bgfx/examples/common/entry/entry_x11.cpp3
-rw-r--r--3rdparty/bgfx/examples/common/entry/input.cpp61
-rw-r--r--3rdparty/bgfx/examples/common/entry/input.h6
-rw-r--r--3rdparty/bgfx/examples/common/imgui/fs_imgui_latlong.bin.h123
-rw-r--r--3rdparty/bgfx/examples/common/imgui/fs_imgui_latlong.sc38
-rw-r--r--3rdparty/bgfx/examples/common/imgui/imgui.cpp260
-rw-r--r--3rdparty/bgfx/examples/common/imgui/imgui.h14
-rw-r--r--3rdparty/bgfx/examples/common/imgui/vs_imgui_latlong.bin.h84
-rw-r--r--3rdparty/bgfx/examples/common/imgui/vs_imgui_latlong.sc15
-rw-r--r--3rdparty/bgfx/include/bgfx.c99.h3
-rw-r--r--3rdparty/bgfx/include/bgfx.h3
-rw-r--r--3rdparty/bgfx/include/bgfxplatform.h3
-rw-r--r--3rdparty/bgfx/scripts/bgfx.lua9
-rw-r--r--3rdparty/bgfx/src/bgfx.cpp59
-rw-r--r--3rdparty/bgfx/src/bgfx_compute.sh31
-rw-r--r--3rdparty/bgfx/src/bgfx_p.h12
-rw-r--r--3rdparty/bgfx/src/glcontext_egl.cpp4
-rw-r--r--3rdparty/bgfx/src/glcontext_glx.cpp50
-rw-r--r--3rdparty/bgfx/src/glimports.h2
-rw-r--r--3rdparty/bgfx/src/image.cpp174
-rw-r--r--3rdparty/bgfx/src/image.h2
-rw-r--r--3rdparty/bgfx/src/renderer_d3d11.cpp8
-rw-r--r--3rdparty/bgfx/src/renderer_d3d12.cpp6
-rw-r--r--3rdparty/bgfx/src/renderer_gl.cpp13
-rw-r--r--3rdparty/bx/tools/bin/darwin/geniebin385392 -> 385392 bytes
-rw-r--r--3rdparty/bx/tools/bin/linux/geniebin367968 -> 367968 bytes
-rw-r--r--3rdparty/bx/tools/bin/windows/genie.exebin374784 -> 375296 bytes
-rw-r--r--3rdparty/genie/README.md2
-rw-r--r--3rdparty/genie/build/gmake.windows/genie.make4
-rw-r--r--3rdparty/genie/src/actions/make/make_cpp.lua36
-rw-r--r--3rdparty/genie/src/host/scripts.c20
44 files changed, 2063 insertions, 1010 deletions
diff --git a/3rdparty/bgfx/.gitignore b/3rdparty/bgfx/.gitignore
index 974eaf2b983..728a1d0fe01 100644
--- a/3rdparty/bgfx/.gitignore
+++ b/3rdparty/bgfx/.gitignore
@@ -4,4 +4,3 @@
.git
.svn
tags
-src/renderer_d3d12.*
diff --git a/3rdparty/bgfx/3rdparty/ocornut-imgui/imgui.cpp b/3rdparty/bgfx/3rdparty/ocornut-imgui/imgui.cpp
index 2fe96f67df0..7c86ebeb055 100644
--- a/3rdparty/bgfx/3rdparty/ocornut-imgui/imgui.cpp
+++ b/3rdparty/bgfx/3rdparty/ocornut-imgui/imgui.cpp
@@ -1,4 +1,4 @@
-// ImGui library v1.30
+// ImGui library v1.32 wip
// See ImGui::ShowTestWindow() for sample code.
// Read 'Programmer guide' below for notes on how to setup ImGui in your codebase.
// Get latest version at https://github.com/ocornut/imgui
@@ -17,7 +17,7 @@
- SAMPLE CODE
- FONT DATA
-
+
MISSION STATEMENT
=================
@@ -35,7 +35,7 @@
- doesn't look fancy, doesn't animate
- limited layout features, intricate layouts are typically crafted in code
- occasionally use statically sized buffers for string manipulations - won't crash, but some long text may be clipped
-
+
END-USER GUIDE
==============
@@ -66,11 +66,12 @@
- your code creates the UI, if your code doesn't run the UI is gone! == dynamic UI, no construction step, less data retention on your side, no state duplication, less sync, less errors.
- call and read ImGui::ShowTestWindow() for user-side sample code
- see examples/ folder for standalone sample applications.
- - customization: use the style editor to tweak the look of the interface (e.g. if you want a more compact UI or a different color scheme), and report values in your code.
+ - customization: use the style editor or PushStyleColor/PushStyleVar to tweak the look of the interface (e.g. if you want a more compact UI or a different color scheme).
+
- getting started:
- initialisation: call ImGui::GetIO() and fill the 'Settings' data.
- - every frame:
+ - every frame:
1/ in your mainloop or right after you got your keyboard/mouse info, call ImGui::GetIO() and fill the 'Input' data, then call ImGui::NewFrame().
2/ use any ImGui function you want between NewFrame() and Render()
3/ ImGui::Render() to render all the accumulated command-lists. it will call your RenderDrawListFn handler that you set in the IO structure.
@@ -91,7 +92,7 @@
unsigned char* pixels;
int width, height, bytes_per_pixels;
io.Fonts->GetTexDataAsRGBA32(pixels, &width, &height, &bytes_per_pixels);
- // TODO: copy texture to graphics memory.
+ // TODO: copy texture to graphics memory.
// TODO: store your texture pointer/identifier in 'io.Fonts->TexID'
// Application main loop
@@ -99,10 +100,11 @@
{
// 1) get low-level input
// e.g. on Win32, GetKeyboardState(), or poll your events, etc.
-
+
// 2) TODO: fill all fields of IO structure and call NewFrame
ImGuiIO& io = ImGui::GetIO();
- io.MousePos = ...
+ io.MousePos = mouse_pos;
+ io.MouseDown[0] = mouse_button_0;
io.KeysDown[i] = ...
ImGui::NewFrame();
@@ -118,16 +120,18 @@
// swap video buffer, etc.
}
- - after calling ImGui::NewFrame() you can read back 'io.WantCaptureMouse' and 'io.WantCaptureKeyboard' to tell
- if ImGui wants to use your inputs. so typically can hide the mouse inputs from the rest of your application if ImGui is using it.
-
+ - after calling ImGui::NewFrame() you can read back 'io.WantCaptureMouse' and 'io.WantCaptureKeyboard' to tell if ImGui
+ wants to use your inputs. if it does you can discard/hide the inputs from the rest of your application.
API BREAKING CHANGES
====================
Occasionally introducing changes that are breaking the API. The breakage are generally minor and easy to fix.
Here is a change-log of API breaking changes, if you are using one of the functions listed, expect to have to fix some code.
-
+
+ - 2015/02/10 (1.32) - renamed GetItemWidth() to CalcItemWidth() to clarify its evolving behavior
+ - 2015/02/08 (1.31) - renamed GetTextLineSpacing() to GetTextLineHeightWithSpacing()
+ - 2015/02/01 (1.31) - removed IO.MemReallocFn (unused)
- 2015/01/19 (1.30) - renamed ImGuiStorage::GetIntPtr()/GetFloatPtr() to GetIntRef()/GetIntRef() because Ptr was conflicting with actual pointer storage functions.
- 2015/01/11 (1.30) - big font/image API change! now loads TTF file. allow for multiple fonts. no need for a PNG loader.
(1.30) - removed GetDefaultFontData(). uses io.Fonts->GetTextureData*() API to retrieve uncompressed pixels.
@@ -167,22 +171,22 @@
- in your Render function, try translating your projection matrix by (0.5f,0.5f) or (0.375f,0.375f)
If you are confused about the meaning or use of ID in ImGui:
- - some widgets requires state to be carried over multiple frames (most typically ImGui often wants remember what is the "active" widget).
+ - many widgets requires state to be carried over multiple frames (most typically ImGui often wants remember what is the "active" widget).
to do so they need an unique ID. unique ID are typically derived from a string label, an indice or a pointer.
when you call Button("OK") the button shows "OK" and also use "OK" as an ID.
- ID are uniquely scoped within Windows so no conflict can happen if you have two buttons called "OK" in two different Windows.
- within a same Window, use PushID() / PopID() to easily create scopes and avoid ID conflicts.
+ within a same Window, use PushID() / PopID() to easily create scopes and avoid ID conflicts.
so if you have a loop creating "multiple" items, you can use PushID() / PopID() with the index of each item, or their pointer, etc.
some functions like TreeNode() implicitly creates a scope for you by calling PushID()
- when dealing with trees, ID are important because you want to preserve the opened/closed state of tree nodes.
depending on your use cases you may want to use strings, indices or pointers as ID. experiment and see what makes more sense!
- e.g. When displaying a single object, using a static string as ID will preserve your node open/closed state when the targeted object change
+ e.g. When displaying a single object that may change over time, using a static string as ID will preserve your node open/closed state when the targeted object change
e.g. When displaying a list of objects, using indices or pointers as ID will preserve the node open/closed state per object
- when passing a label you can optionally specify extra unique ID information within the same string using "##". This helps solving the simpler collision cases.
e.g. "Label" display "Label" and uses "Label" as ID
e.g. "Label##Foobar" display "Label" and uses "Label##Foobar" as ID
e.g. "##Foobar" display an empty label and uses "##Foobar" as ID
- - read articles about the imgui principles (see web links) to understand the requirement and use of ID.
+ - read articles about immediate-mode ui principles (see web links) to understand the requirement and use of ID.
If you want to load a different font than the default (ProggyClean.ttf, size 13)
@@ -193,6 +197,7 @@
ImFont* font0 = io.Fonts->AddFontDefault();
ImFont* font1 = io.Fonts->AddFontFromFileTTF("myfontfile.ttf", size_in_pixels);
+ ImFont* font2 = io.Fonts->AddFontFromFileTTF("myfontfile2.ttf", size_in_pixels);
io.Fonts->GetTexDataAsRGBA32() or GetTexDataAsAlpha8()
If you want to display Chinese, Japanese, Korean characters, pass custom Unicode ranges when loading a font:
@@ -224,9 +229,10 @@
// Set pointer to handler in ImGuiIO structure
io.ImeSetInputScreenPosFn = ImImpl_ImeSetInputScreenPosFn;
- - tip: the construct 'IMGUI_ONCE_UPON_A_FRAME { ... }' will evaluate to a block of code only once a frame. You can use it to quickly add custom UI in the middle of a deep nested inner loop in your code.
- - tip: you can call Render() multiple times (e.g for VR renders), up to you to communicate the extra state to your RenderDrawListFn function.
+ - tip: the construct 'IMGUI_ONCE_UPON_A_FRAME { ... }' will run the block of code only once a frame. You can use it to quickly add custom UI in the middle of a deep nested inner loop in your code.
- tip: you can create widgets without a Begin()/End() block, they will go in an implicit window called "Debug"
+ - tip: you can call Begin() multiple times with the same name during the same frame, it will keep appending to the same window.
+ - tip: you can call Render() multiple times (e.g for VR renders).
- tip: call and read the ShowTestWindow() code for more example of how to use ImGui!
@@ -234,17 +240,17 @@
==================
- misc: merge or clarify ImVec4 / ImGuiAabb, they are essentially duplicate containers
-!- i/o: avoid requesting mouse capture if button held and initial click was out of reach for imgui
- window: add horizontal scroll
- window: fix resize grip rendering scaling along with Rounding style setting
- window: autofit feedback loop when user relies on any dynamic layout (window width multiplier, column). maybe just clearly drop manual autofit?
- - window: add a way for very transient windows (non-saved, temporary overlay over hundreds of objects) to "clean" up from the global window list.
+ - window: add a way for very transient windows (non-saved, temporary overlay over hundreds of objects) to "clean" up from the global window list.
- window: allow resizing of child windows (possibly given min/max for each axis?)
- window: background options for child windows, border option (disable rounding)
- window: resizing from any sides? + mouse cursor directives for app.
+ - widgets: clicking on widget b while widget a should activate widget b (doesn't anymore because of hover capture)
- widgets: display mode: widget-label, label-widget (aligned on column or using fixed size), label-newline-tab-widget etc.
- widgets: clip text? hover clipped text shows it in a tooltip or in-place overlay
- - main: considering adding EndFrame() - optional, else done in Render(). and Init()
+ - main: considering adding EndFrame()/Init(). some constructs are awkward in the implementation because of the lack of them.
- main: IsItemHovered() returns true even if mouse is active on another widget (e.g. dragging outside of sliders). Maybe not a sensible default? Add parameter or alternate function?
- main: IsItemHovered() make it more consistent for various type of widgets, widgets with multiple components, etc. also effectively IsHovered() region sometimes differs from hot region, e.g tree nodes
- main: IsItemHovered() info stored in a stack? so that 'if TreeNode() { Text; TreePop; } if IsHovered' return the hover state of the TreeNode?
@@ -256,33 +262,36 @@
- input number: use mouse wheel to step up/down
- input number: non-decimal input.
- layout: horizontal layout helper (github issue #97)
+ - layout: more generic alignment state (left/right/centered) for single items?
- layout: clean up the InputFloatN/SliderFloatN/ColorEdit4 layout code. item width should include frame padding.
- columns: separator function or parameter that works within the column (currently Separator() bypass all columns)
- columns: declare column set (each column: fixed size, %, fill, distribute default size among fills)
- columns: columns header to act as button (~sort op) and allow resize/reorder
- columns: user specify columns size
- combo: turn child handling code into pop up helper
- - list selection, concept of a selectable "block" (that can be multiple widgets)
- - menubar, menus
+ - combo: contents should extends to fit label if combo widget is small
+ - listbox: multiple selection
+ - listbox: user may want to initial scroll to focus on the one selected value?
+ ! menubar, menus
- tabs
- gauge: various forms of gauge/loading bars widgets
- color: better color editor.
- - plot: make it easier for user to draw into the graph (e.g: draw basis, highlight certain points, 2d plots, multiple plots)
- - plot: "smooth" automatic scale, user give an input 0.0(full user scale) 1.0(full derived from value)
+ - plot: make it easier for user to draw extra stuff into the graph (e.g: draw basis, highlight certain points, 2d plots, multiple plots)
+ - plot: "smooth" automatic scale over time, user give an input 0.0(full user scale) 1.0(full derived from value)
- plot: add a helper e.g. Plot(char* label, float value, float time_span=2.0f) that stores values and Plot them for you - probably another function name. and/or automatically allow to plot ANY displayed value (more reliance on stable ID)
- - file selection widget -> build the tool in our codebase to improve model-dialog idioms (may or not lead to ImGui changes)
+ - file selection widget -> build the tool in our codebase to improve model-dialog idioms
- slider: allow using the [-]/[+] buttons used by InputFloat()/InputInt()
- slider: initial absolute click is imprecise. change to relative movement slider? hide mouse cursor, allow more precise input using less screen-space.
- - text edit: clean up the mess caused by converting UTF-8 <> wchar
- - text edit: centered text for slider or input text to it matches typical positioning.
- - text edit: flag to disable live update of the user buffer.
+ - text edit: clean up the mess caused by converting UTF-8 <> wchar. the code is rather ineficient right now.
+ - text edit: centered text for slider as input text so it matches typical positioning.
+ - text edit: flag to disable live update of the user buffer.
- text edit: field resize behavior - field could stretch when being edited? hover tooltip shows more text?
- text edit: add multi-line text edit
- tree: add treenode/treepush int variants? because (void*) cast from int warns on some platforms/settings
- settings: write more decent code to allow saving/loading new fields
- settings: api for per-tool simple persistent data (bool,int,float) in .ini file
- ! style: store rounded corners in texture to use 1 quad per corner (filled and wireframe).
- - style: checkbox: padding for "active" color should be a multiplier of the
+ ! style: store rounded corners in texture to use 1 quad per corner (filled and wireframe). so rounding have minor cost.
+ - style: checkbox: padding for "active" color should be a multiplier of the
- style: colorbox not always square?
- log: LogButtons() options for specifying depth and/or hiding depth slider
- log: have more control over the log scope (e.g. stop logging when leaving current tree node scope)
@@ -299,9 +308,9 @@
- misc: mark printf compiler attributes on relevant functions
- misc: provide a way to compile out the entire implementation while providing a dummy API (e.g. #define IMGUI_DUMMY_IMPL)
- misc: double-clicking on title bar to minimize isn't consistent, perhaps move to single-click on left-most collapse icon?
+ - style editor: have a more global HSV setter (e.g. alter hue on all elements). consider replacing active/hovered by offset in HSV space?
- style editor: color child window height expressed in multiple of line height.
- optimization/render: use indexed rendering to reduce vertex data cost (for remote/networked imgui)
- - optimization/render: move clip-rect to vertex data? would allow merging all commands
- optimization/render: merge command-lists with same clip-rect into one even if they aren't sequential? (as long as in-between clip rectangle don't overlap)?
- optimization: turn some the various stack vectors into statically-sized arrays
- optimization: better clipping for multi-component widgets
@@ -320,7 +329,7 @@
#include <new> // new (ptr)
#ifdef _MSC_VER
-#pragma warning (disable: 4505) // unreferenced local function has been removed
+#pragma warning (disable: 4505) // unreferenced local function has been removed (stb stuff)
#pragma warning (disable: 4996) // 'This function or variable may be unsafe': strcpy, strdup, sprintf, vsnprintf, sscanf, fopen
#endif
@@ -392,10 +401,14 @@ using namespace IMGUI_STB_NAMESPACE;
// Forward Declarations
//-------------------------------------------------------------------------
-static bool ButtonBehaviour(const ImGuiAabb& bb, const ImGuiID& id, bool* out_hovered, bool* out_held, bool allow_key_modifiers, bool repeat = false);
+struct ImGuiAabb;
+
+static bool ButtonBehaviour(const ImGuiAabb& bb, const ImGuiID& id, bool* out_hovered, bool* out_held, bool allow_key_modifiers, bool repeat = false, bool pressed_on_click = false);
static void LogText(const ImVec2& ref_pos, const char* text, const char* text_end = NULL);
-static void RenderText(ImVec2 pos, const char* text, const char* text_end = NULL, bool hide_text_after_hash = true, float wrap_width = 0.0f);
+static void RenderText(ImVec2 pos, const char* text, const char* text_end = NULL, bool hide_text_after_hash = true);
+static void RenderTextWrapped(ImVec2 pos, const char* text, const char* text_end, float wrap_width);
+static void RenderTextClipped(ImVec2 pos, const char* text, const char* text_end, const ImVec2* text_size_if_known, const ImVec2& clip_max);
static void RenderFrame(ImVec2 p_min, ImVec2 p_max, ImU32 fill_col, bool border = true, float rounding = 0.0f);
static void RenderCollapseTriangle(ImVec2 p_min, bool opened, float scale = 1.0f, bool shadow = false);
@@ -463,6 +476,7 @@ ImGuiStyle::ImGuiStyle()
WindowPadding = ImVec2(8,8); // Padding within a window
WindowMinSize = ImVec2(32,32); // Minimum window size
WindowRounding = 9.0f; // Radius of window corners rounding. Set to 0.0f to have rectangular windows
+ ChildWindowRounding = 0.0f; // Radius of child window corners rounding. Set to 0.0f to have rectangular windows
FramePadding = ImVec2(4,3); // Padding within a framed rectangle (used by most widgets)
FrameRounding = 0.0f; // Radius of frame corners rounding. Set to 0.0f to have rectangular frames (used by most widgets).
ItemSpacing = ImVec2(8,4); // Horizontal and vertical spacing between widgets/lines
@@ -476,6 +490,7 @@ ImGuiStyle::ImGuiStyle()
Colors[ImGuiCol_Text] = ImVec4(0.90f, 0.90f, 0.90f, 1.00f);
Colors[ImGuiCol_WindowBg] = ImVec4(0.00f, 0.00f, 0.00f, 1.00f);
+ Colors[ImGuiCol_ChildWindowBg] = ImVec4(0.00f, 0.00f, 0.00f, 0.00f);
Colors[ImGuiCol_Border] = ImVec4(1.00f, 1.00f, 1.00f, 1.00f);
Colors[ImGuiCol_BorderShadow] = ImVec4(0.00f, 0.00f, 0.00f, 0.60f);
Colors[ImGuiCol_FrameBg] = ImVec4(0.80f, 0.80f, 0.80f, 0.30f); // Background of checkbox, radio button, plot, slider, text input
@@ -496,7 +511,7 @@ ImGuiStyle::ImGuiStyle()
Colors[ImGuiCol_ButtonActive] = ImVec4(0.80f, 0.50f, 0.50f, 1.00f);
Colors[ImGuiCol_Header] = ImVec4(0.40f, 0.40f, 0.90f, 0.45f);
Colors[ImGuiCol_HeaderHovered] = ImVec4(0.45f, 0.45f, 0.90f, 0.80f);
- Colors[ImGuiCol_HeaderActive] = ImVec4(0.60f, 0.60f, 0.80f, 1.00f);
+ Colors[ImGuiCol_HeaderActive] = ImVec4(0.53f, 0.53f, 0.87f, 0.80f);
Colors[ImGuiCol_Column] = ImVec4(1.00f, 1.00f, 1.00f, 1.00f);
Colors[ImGuiCol_ColumnHovered] = ImVec4(0.60f, 0.40f, 0.40f, 1.00f);
Colors[ImGuiCol_ColumnActive] = ImVec4(0.80f, 0.50f, 0.50f, 1.00f);
@@ -539,7 +554,6 @@ ImGuiIO::ImGuiIO()
// User functions
RenderDrawListsFn = NULL;
MemAllocFn = malloc;
- MemReallocFn = realloc;
MemFreeFn = free;
GetClipboardTextFn = GetClipboardTextFn_DefaultImpl; // Platform dependent default implementations
SetClipboardTextFn = SetClipboardTextFn_DefaultImpl;
@@ -600,7 +614,8 @@ static inline float ImMin(float lhs, float rhs)
static inline float ImMax(float lhs, float rhs) { return lhs >= rhs ? lhs : rhs; }
static inline ImVec2 ImMin(const ImVec2& lhs, const ImVec2& rhs) { return ImVec2(ImMin(lhs.x,rhs.x), ImMin(lhs.y,rhs.y)); }
static inline ImVec2 ImMax(const ImVec2& lhs, const ImVec2& rhs) { return ImVec2(ImMax(lhs.x,rhs.x), ImMax(lhs.y,rhs.y)); }
-static inline float ImClamp(float f, float mn, float mx) { return (f < mn) ? mn : (f > mx) ? mx : f; }
+static inline int ImClamp(int v, int mn, int mx) { return (v < mn) ? mn : (v > mx) ? mx : v; }
+static inline float ImClamp(float v, float mn, float mx) { return (v < mn) ? mn : (v > mx) ? mx : v; }
static inline ImVec2 ImClamp(const ImVec2& f, const ImVec2& mn, ImVec2 mx) { return ImVec2(ImClamp(f.x,mn.x,mx.x), ImClamp(f.y,mn.y,mx.y)); }
static inline float ImSaturate(float f) { return (f < 0.0f) ? 0.0f : (f > 1.0f) ? 1.0f : f; }
static inline float ImLerp(float a, float b, float t) { return a + (b - a) * t; }
@@ -660,37 +675,37 @@ static const char* ImStristr(const char* haystack, const char* needle, const cha
}
// Pass data_size==0 for zero-terminated string
-static ImU32 ImCrc32(const void* data, size_t data_size, ImU32 seed = 0)
-{
+static ImU32 ImCrc32(const void* data, size_t data_size, ImU32 seed = 0)
+{
static ImU32 crc32_lut[256] = { 0 };
if (!crc32_lut[1])
{
const ImU32 polynomial = 0xEDB88320;
- for (ImU32 i = 0; i < 256; i++)
- {
- ImU32 crc = i;
- for (ImU32 j = 0; j < 8; j++)
- crc = (crc >> 1) ^ (ImU32(-int(crc & 1)) & polynomial);
- crc32_lut[i] = crc;
+ for (ImU32 i = 0; i < 256; i++)
+ {
+ ImU32 crc = i;
+ for (ImU32 j = 0; j < 8; j++)
+ crc = (crc >> 1) ^ (ImU32(-int(crc & 1)) & polynomial);
+ crc32_lut[i] = crc;
}
}
- ImU32 crc = ~seed;
+ ImU32 crc = ~seed;
const unsigned char* current = (const unsigned char*)data;
if (data_size > 0)
{
// Known size
- while (data_size--)
- crc = (crc >> 8) ^ crc32_lut[(crc & 0xFF) ^ *current++];
+ while (data_size--)
+ crc = (crc >> 8) ^ crc32_lut[(crc & 0xFF) ^ *current++];
}
else
{
// Zero-terminated string
while (unsigned char c = *current++)
- crc = (crc >> 8) ^ crc32_lut[(crc & 0xFF) ^ c];
+ crc = (crc >> 8) ^ crc32_lut[(crc & 0xFF) ^ c];
}
- return ~crc;
-}
+ return ~crc;
+}
static size_t ImFormatString(char* buf, size_t buf_size, const char* fmt, ...)
{
@@ -743,7 +758,7 @@ void ImGui::ColorConvertRGBtoHSV(float r, float g, float b, float& out_h, float&
// Convert hsv floats ([0-1],[0-1],[0-1]) to rgb floats ([0-1],[0-1],[0-1]), from Foley & van Dam p593
// also http://en.wikipedia.org/wiki/HSL_and_HSV
void ImGui::ColorConvertHSVtoRGB(float h, float s, float v, float& out_r, float& out_g, float& out_b)
-{
+{
if (s == 0.0f)
{
// gray
@@ -868,11 +883,11 @@ struct ImGuiDrawContext
bool LastItemHovered;
ImVector<ImGuiWindow*> ChildWindows;
ImVector<bool> AllowKeyboardFocus;
- ImVector<float> ItemWidth;
+ ImVector<float> ItemWidth; // 0.0: default, >0.0: width in pixels, <0.0: align xx pixels to the right of window
ImVector<float> TextWrapPos;
ImGuiColorEditMode ColorEditMode;
ImGuiStorage* StateStorage;
- int OpenNextNode;
+ int OpenNextNode; // FIXME: Reformulate this feature like SetNextWindowCollapsed() API
float ColumnsStartX; // Start position from left of window (increased by TreePush/TreePop, etc.)
float ColumnsOffsetX; // Offset to the current column (if ColumnsCurrent > 0). FIXME: This and the above should be a stack to allow use cases like Tree->Column->Tree. Need revamp columns API.
@@ -986,6 +1001,7 @@ struct ImGuiState
// Render
ImVector<ImDrawList*> RenderDrawLists;
+ ImVector<ImGuiWindow*> RenderSortedWindows;
// Widget state
ImGuiTextEditState InputTextState;
@@ -1032,7 +1048,8 @@ struct ImGuiState
}
};
-static ImGuiState GImGui;
+static ImGuiState GImDefaultState; // Internal state storage
+static ImGuiState* GImGui = &GImDefaultState; // We access everything through this pointer. NB: this pointer is always assumed to be != NULL
struct ImGuiWindow
{
@@ -1053,13 +1070,13 @@ struct ImGuiWindow
bool SkipItems; // == Visible && !Collapsed
int AutoFitFrames;
bool AutoFitOnlyGrows;
- int SetWindowPosAllowFlags; // bit ImGuiSetCondition_*** specify if SetWindowPos() call is allowed with this particular flag.
- int SetWindowSizeAllowFlags; // bit ImGuiSetCondition_*** specify if SetWindowSize() call is allowed with this particular flag.
- int SetWindowCollapsedAllowFlags; // bit ImGuiSetCondition_*** specify if SetWindowCollapsed() call is allowed with this particular flag.
+ int SetWindowPosAllowFlags; // bit ImGuiSetCondition_*** specify if SetWindowPos() call is allowed with this particular flag.
+ int SetWindowSizeAllowFlags; // bit ImGuiSetCondition_*** specify if SetWindowSize() call is allowed with this particular flag.
+ int SetWindowCollapsedAllowFlags; // bit ImGuiSetCondition_*** specify if SetWindowCollapsed() call is allowed with this particular flag.
ImGuiDrawContext DC;
ImVector<ImGuiID> IDStack;
- ImVector<ImVec4> ClipRectStack;
+ ImVector<ImVec4> ClipRectStack; // Scissoring / clipping rectangle. x1, y1, x2, y2.
int LastFrameDrawn;
float ItemWidthDefault;
ImGuiStorage StateStorage;
@@ -1087,32 +1104,35 @@ public:
void FocusItemUnregister();
ImGuiAabb Aabb() const { return ImGuiAabb(Pos, Pos+Size); }
- ImFont* Font() const { return GImGui.Font; }
- float FontSize() const { return GImGui.FontSize * FontWindowScale; }
+ ImFont* Font() const { return GImGui->Font; }
+ float FontSize() const { return GImGui->FontSize * FontWindowScale; }
ImVec2 CursorPos() const { return DC.CursorPos; }
- float TitleBarHeight() const { return (Flags & ImGuiWindowFlags_NoTitleBar) ? 0 : FontSize() + GImGui.Style.FramePadding.y * 2.0f; }
+ float TitleBarHeight() const { return (Flags & ImGuiWindowFlags_NoTitleBar) ? 0 : FontSize() + GImGui->Style.FramePadding.y * 2.0f; }
ImGuiAabb TitleBarAabb() const { return ImGuiAabb(Pos, Pos + ImVec2(SizeFull.x, TitleBarHeight())); }
- ImVec2 WindowPadding() const { return ((Flags & ImGuiWindowFlags_ChildWindow) && !(Flags & ImGuiWindowFlags_ShowBorders)) ? ImVec2(1,1) : GImGui.Style.WindowPadding; }
- ImU32 Color(ImGuiCol idx, float a=1.f) const { ImVec4 c = GImGui.Style.Colors[idx]; c.w *= GImGui.Style.Alpha * a; return ImGui::ColorConvertFloat4ToU32(c); }
- ImU32 Color(const ImVec4& col) const { ImVec4 c = col; c.w *= GImGui.Style.Alpha; return ImGui::ColorConvertFloat4ToU32(c); }
+ ImVec2 WindowPadding() const { return ((Flags & ImGuiWindowFlags_ChildWindow) && !(Flags & ImGuiWindowFlags_ShowBorders)) ? ImVec2(1,1) : GImGui->Style.WindowPadding; }
+ ImU32 Color(ImGuiCol idx, float a=1.f) const { ImVec4 c = GImGui->Style.Colors[idx]; c.w *= GImGui->Style.Alpha * a; return ImGui::ColorConvertFloat4ToU32(c); }
+ ImU32 Color(const ImVec4& col) const { ImVec4 c = col; c.w *= GImGui->Style.Alpha; return ImGui::ColorConvertFloat4ToU32(c); }
};
static ImGuiWindow* GetCurrentWindow()
{
- IM_ASSERT(GImGui.CurrentWindow != NULL); // ImGui::NewFrame() hasn't been called yet?
- GImGui.CurrentWindow->Accessed = true;
- return GImGui.CurrentWindow;
+ ImGuiState& g = *GImGui;
+ IM_ASSERT(g.CurrentWindow != NULL); // ImGui::NewFrame() hasn't been called yet?
+ g.CurrentWindow->Accessed = true;
+ return g.CurrentWindow;
}
-static void SetActiveId(ImGuiID id)
+static void SetActiveId(ImGuiID id)
{
- GImGui.ActiveId = id;
+ ImGuiState& g = *GImGui;
+ g.ActiveId = id;
}
static void RegisterAliveId(const ImGuiID& id)
{
- if (GImGui.ActiveId == id)
- GImGui.ActiveIdIsAlive = true;
+ ImGuiState& g = *GImGui;
+ if (g.ActiveId == id)
+ g.ActiveIdIsAlive = true;
}
//-----------------------------------------------------------------------------
@@ -1243,7 +1263,7 @@ void ImGuiTextFilter::Draw(const char* label, float width)
if (width < 0.0f)
{
ImVec2 label_size = ImGui::CalcTextSize(label, NULL, true);
- width = ImMax(window->Pos.x + ImGui::GetContentRegionMax().x - window->DC.CursorPos.x - (label_size.x + GImGui.Style.ItemSpacing.x*4), 10.0f);
+ width = ImMax(window->Pos.x + ImGui::GetContentRegionMax().x - window->DC.CursorPos.x - (label_size.x + GImGui->Style.ItemSpacing.x*4), 10.0f);
}
ImGui::PushItemWidth(width);
ImGui::InputText(label, InputBuf, IM_ARRAYSIZE(InputBuf));
@@ -1322,7 +1342,7 @@ bool ImGuiTextFilter::PassFilter(const char* val) const
//-----------------------------------------------------------------------------
-// On some platform vsnprintf() takes va_list by reference and modifies it.
+// On some platform vsnprintf() takes va_list by reference and modifies it.
// va_copy is the 'correct' way to copy a va_list but Visual Studio prior to 2013 doesn't have it.
#ifndef va_copy
#define va_copy(dest, src) (dest = src)
@@ -1363,7 +1383,7 @@ void ImGuiTextBuffer::append(const char* fmt, ...)
ImGuiWindow::ImGuiWindow(const char* name)
{
Name = ImStrdup(name);
- ID = GetID(name);
+ ID = GetID(name);
IDStack.push_back(ID);
PosFloat = Pos = ImVec2(0.0f, 0.0f);
@@ -1425,7 +1445,7 @@ ImGuiID ImGuiWindow::GetID(const void* ptr)
bool ImGuiWindow::FocusItemRegister(bool is_active, bool tab_stop)
{
- ImGuiState& g = GImGui;
+ ImGuiState& g = *GImGui;
ImGuiWindow* window = GetCurrentWindow();
const bool allow_keyboard_focus = window->DC.AllowKeyboardFocus.back();
@@ -1459,7 +1479,7 @@ void ImGuiWindow::FocusItemUnregister()
void ImGuiWindow::AddToRenderList()
{
- ImGuiState& g = GImGui;
+ ImGuiState& g = *GImGui;
if (!DrawList->commands.empty() && !DrawList->vtx_buffer.empty())
{
@@ -1470,7 +1490,7 @@ void ImGuiWindow::AddToRenderList()
for (size_t i = 0; i < DC.ChildWindows.size(); i++)
{
ImGuiWindow* child = DC.ChildWindows[i];
- if (child->Visible) // clipped childs may have been marked not Visible
+ if (child->Visible) // clipped children may have been marked not Visible
child->AddToRenderList();
}
}
@@ -1479,22 +1499,17 @@ void ImGuiWindow::AddToRenderList()
void* ImGui::MemAlloc(size_t sz)
{
- return GImGui.IO.MemAllocFn(sz);
+ return GImGui->IO.MemAllocFn(sz);
}
void ImGui::MemFree(void* ptr)
{
- return GImGui.IO.MemFreeFn(ptr);
+ return GImGui->IO.MemFreeFn(ptr);
}
-void* ImGui::MemRealloc(void* ptr, size_t sz)
-{
- return GImGui.IO.MemReallocFn(ptr, sz);
-}
-
static ImGuiIniData* FindWindowSettings(const char* name)
{
- ImGuiState& g = GImGui;
+ ImGuiState& g = *GImGui;
for (size_t i = 0; i != g.Settings.size(); i++)
{
ImGuiIniData* ini = g.Settings[i];
@@ -1512,7 +1527,7 @@ static ImGuiIniData* AddWindowSettings(const char* name)
ini->Collapsed = false;
ini->Pos = ImVec2(FLT_MAX,FLT_MAX);
ini->Size = ImVec2(0,0);
- GImGui.Settings.push_back(ini);
+ GImGui->Settings.push_back(ini);
return ini;
}
@@ -1520,7 +1535,7 @@ static ImGuiIniData* AddWindowSettings(const char* name)
// FIXME: Write something less rubbish
static void LoadSettings()
{
- ImGuiState& g = GImGui;
+ ImGuiState& g = *GImGui;
const char* filename = g.IO.IniFilename;
if (!filename)
return;
@@ -1537,7 +1552,7 @@ static void LoadSettings()
const char* line_end = line_start;
while (line_end < buf_end && *line_end != '\n' && *line_end != '\r')
line_end++;
-
+
if (line_start[0] == '[' && line_end > line_start && line_end[-1] == ']')
{
char name[64];
@@ -1566,7 +1581,7 @@ static void LoadSettings()
static void SaveSettings()
{
- ImGuiState& g = GImGui;
+ ImGuiState& g = *GImGui;
const char* filename = g.IO.IniFilename;
if (!filename)
return;
@@ -1605,25 +1620,45 @@ static void SaveSettings()
static void MarkSettingsDirty()
{
- ImGuiState& g = GImGui;
+ ImGuiState& g = *GImGui;
if (g.SettingsDirtyTimer <= 0.0f)
g.SettingsDirtyTimer = g.IO.IniSavingRate;
}
+// Internal state access - if you want to share ImGui state between modules (e.g. DLL) or allocate it yourself
+// Note that we still point to some static data and members (such as GFontAtlas), so the state instance you end up using will point to the static data within its module
+void* ImGui::GetInternalState()
+{
+ return GImGui;
+}
+
+size_t ImGui::GetInternalStateSize()
+{
+ return sizeof(ImGuiState);
+}
+
+void ImGui::SetInternalState(void* state, bool construct)
+{
+ if (construct)
+ new (state) ImGuiState();
+
+ GImGui = (ImGuiState*)state;
+}
+
ImGuiIO& ImGui::GetIO()
{
- return GImGui.IO;
+ return GImGui->IO;
}
ImGuiStyle& ImGui::GetStyle()
{
- return GImGui.Style;
+ return GImGui->Style;
}
void ImGui::NewFrame()
{
- ImGuiState& g = GImGui;
+ ImGuiState& g = *GImGui;
// Check user data
IM_ASSERT(g.IO.DeltaTime > 0.0f);
@@ -1702,10 +1737,25 @@ void ImGui::NewFrame()
else
g.HoveredRootWindow = FindHoveredWindow(g.IO.MousePos, true);
- // Are we using inputs? Tell user so they can capture/discard them.
- g.IO.WantCaptureMouse = (g.HoveredWindow != NULL) || (g.ActiveId != 0);
+ // Are we using inputs? Tell user so they can capture/discard the inputs away from the rest of their application.
+ // When clicking outside of a window we assume the click is owned by the application and won't request capture.
+ int mouse_earliest_button_down = -1;
+ for (int i = 0; i < IM_ARRAYSIZE(g.IO.MouseDown); i++)
+ {
+ if (g.IO.MouseClicked[i])
+ g.IO.MouseDownOwned[i] = (g.HoveredWindow != NULL);
+ if (g.IO.MouseDown[i])
+ if (mouse_earliest_button_down == -1 || g.IO.MouseClickedTime[mouse_earliest_button_down] > g.IO.MouseClickedTime[i])
+ mouse_earliest_button_down = i;
+ }
+ bool mouse_owned_by_application = mouse_earliest_button_down != -1 && !g.IO.MouseDownOwned[mouse_earliest_button_down];
+ g.IO.WantCaptureMouse = (!mouse_owned_by_application && g.HoveredWindow != NULL) || (g.ActiveId != 0);
g.IO.WantCaptureKeyboard = (g.ActiveId != 0);
+ // If mouse was first clicked outside of ImGui bounds we also cancel out hovering.
+ if (mouse_owned_by_application)
+ g.HoveredWindow = g.HoveredRootWindow = NULL;
+
// Scale & Scrolling
if (g.HoveredWindow && g.IO.MouseWheel != 0.0f)
{
@@ -1756,7 +1806,7 @@ void ImGui::NewFrame()
// No window should be open at the beginning of the frame.
// But in order to allow the user to call NewFrame() multiple times without calling Render(), we are doing an explicit clear.
- g.CurrentWindowStack.clear();
+ g.CurrentWindowStack.resize(0);
// Create implicit window - we will only render it if the user has added something to it.
ImGui::Begin("Debug", NULL, ImVec2(400,400));
@@ -1765,7 +1815,7 @@ void ImGui::NewFrame()
// NB: behaviour of ImGui after Shutdown() is not tested/guaranteed at the moment. This function is merely here to free heap allocations.
void ImGui::Shutdown()
{
- ImGuiState& g = GImGui;
+ ImGuiState& g = *GImGui;
if (!g.Initialized)
return;
@@ -1814,12 +1864,27 @@ void ImGui::Shutdown()
g.Initialized = false;
}
+// FIXME: Add a more explicit sort order in the window structure.
+static int ChildWindowComparer(const void* lhs, const void* rhs)
+{
+ const ImGuiWindow* a = *(const ImGuiWindow**)lhs;
+ const ImGuiWindow* b = *(const ImGuiWindow**)rhs;
+ if (int d = (a->Flags & ImGuiWindowFlags_Tooltip) - (b->Flags & ImGuiWindowFlags_Tooltip))
+ return d;
+ if (int d = (a->Flags & ImGuiWindowFlags_ComboBox) - (b->Flags & ImGuiWindowFlags_ComboBox))
+ return d;
+ return 0;
+}
+
static void AddWindowToSortedBuffer(ImGuiWindow* window, ImVector<ImGuiWindow*>& sorted_windows)
{
sorted_windows.push_back(window);
if (window->Visible)
{
- for (size_t i = 0; i < window->DC.ChildWindows.size(); i++)
+ const size_t count = window->DC.ChildWindows.size();
+ if (count > 1)
+ qsort(window->DC.ChildWindows.begin(), count, sizeof(ImGuiWindow*), ChildWindowComparer);
+ for (size_t i = 0; i < count; i++)
{
ImGuiWindow* child = window->DC.ChildWindows[i];
if (child->Visible)
@@ -1835,7 +1900,7 @@ static void PushClipRect(const ImVec4& clip_rect, bool clipped = true)
ImVec4 cr = clip_rect;
if (clipped && !window->ClipRectStack.empty())
{
- // Clip to new clip rect
+ // Clip with existing clip rect
const ImVec4 cur_cr = window->ClipRectStack.back();
cr = ImVec4(ImMax(cr.x, cur_cr.x), ImMax(cr.y, cur_cr.y), ImMin(cr.z, cur_cr.z), ImMin(cr.w, cur_cr.w));
}
@@ -1853,38 +1918,38 @@ static void PopClipRect()
void ImGui::Render()
{
- ImGuiState& g = GImGui;
+ ImGuiState& g = *GImGui;
IM_ASSERT(g.Initialized); // Forgot to call ImGui::NewFrame()
const bool first_render_of_the_frame = (g.FrameCountRendered != g.FrameCount);
g.FrameCountRendered = g.FrameCount;
-
+
if (first_render_of_the_frame)
{
// Hide implicit window if it hasn't been used
- IM_ASSERT(g.CurrentWindowStack.size() == 1); // Mismatched Begin/End
+ IM_ASSERT(g.CurrentWindowStack.size() == 1); // Mismatched Begin/End
if (g.CurrentWindow && !g.CurrentWindow->Accessed)
g.CurrentWindow->Visible = false;
ImGui::End();
- // Select window for move/focus when we're done with all our widgets (we only consider non-childs windows here)
+ // Select window for move/focus when we're done with all our widgets (we only consider non-child windows here)
if (g.ActiveId == 0 && g.HoveredId == 0 && g.HoveredRootWindow != NULL && g.IO.MouseClicked[0])
SetActiveId(g.HoveredRootWindow->GetID("#MOVE"));
// Sort the window list so that all child windows are after their parent
// We cannot do that on FocusWindow() because childs may not exist yet
- ImVector<ImGuiWindow*> sorted_windows;
- sorted_windows.reserve(g.Windows.size());
+ g.RenderSortedWindows.resize(0);
+ g.RenderSortedWindows.reserve(g.Windows.size());
for (size_t i = 0; i != g.Windows.size(); i++)
{
ImGuiWindow* window = g.Windows[i];
if (window->Flags & ImGuiWindowFlags_ChildWindow) // if a child is visible its parent will add it
if (window->Visible)
continue;
- AddWindowToSortedBuffer(window, sorted_windows);
+ AddWindowToSortedBuffer(window, g.RenderSortedWindows);
}
- IM_ASSERT(g.Windows.size() == sorted_windows.size()); // We done something wrong
- g.Windows.swap(sorted_windows);
+ IM_ASSERT(g.Windows.size() == g.RenderSortedWindows.size()); // we done something wrong
+ g.Windows.swap(g.RenderSortedWindows);
// Clear data for next frame
g.IO.MouseWheel = 0.0f;
@@ -1953,7 +2018,7 @@ static const char* FindTextDisplayEnd(const char* text, const char* text_end =
// Pass text data straight to log (without being displayed)
void ImGui::LogText(const char* fmt, ...)
{
- ImGuiState& g = GImGui;
+ ImGuiState& g = *GImGui;
if (!g.LogEnabled)
return;
@@ -1971,9 +2036,10 @@ void ImGui::LogText(const char* fmt, ...)
}
// Internal version that takes a position to decide on newline placement and pad items according to their depth.
+// We split text into individual lines to add current tree level padding
static void LogText(const ImVec2& ref_pos, const char* text, const char* text_end)
{
- ImGuiState& g = GImGui;
+ ImGuiState& g = *GImGui;
ImGuiWindow* window = GetCurrentWindow();
if (!text_end)
@@ -2030,16 +2096,16 @@ static float CalcWrapWidthForPos(const ImVec2& pos, float wrap_pos_x)
wrap_pos_x = ImGui::GetContentRegionMax().x;
if (wrap_pos_x > 0.0f)
wrap_pos_x += window->Pos.x; // wrap_pos_x is provided is window local space
-
+
const float wrap_width = wrap_pos_x > 0.0f ? ImMax(wrap_pos_x - pos.x, 0.00001f) : 0.0f;
return wrap_width;
}
-// Internal ImGui function to render text (called from ImGui::Text(), ImGui::TextUnformatted(), etc.)
-// RenderText() calls ImDrawList::AddText() calls ImBitmapFont::RenderText()
-static void RenderText(ImVec2 pos, const char* text, const char* text_end, bool hide_text_after_hash, float wrap_width)
+// Internal ImGui functions to render text
+// RenderText***() functions calls ImDrawList::AddText() calls ImBitmapFont::RenderText()
+static void RenderText(ImVec2 pos, const char* text, const char* text_end, bool hide_text_after_hash)
{
- ImGuiState& g = GImGui;
+ ImGuiState& g = *GImGui;
ImGuiWindow* window = GetCurrentWindow();
// Hide anything after a '##' string
@@ -2059,9 +2125,53 @@ static void RenderText(ImVec2 pos, const char* text, const char* text_end, bool
if (text_len > 0)
{
// Render
- window->DrawList->AddText(window->Font(), window->FontSize(), pos, window->Color(ImGuiCol_Text), text, text + text_len, wrap_width);
+ window->DrawList->AddText(window->Font(), window->FontSize(), pos, window->Color(ImGuiCol_Text), text, text_display_end);
- // Log as text. We split text into individual lines to add current tree level padding
+ // Log as text
+ if (g.LogEnabled)
+ LogText(pos, text, text_display_end);
+ }
+}
+
+static void RenderTextWrapped(ImVec2 pos, const char* text, const char* text_end, float wrap_width)
+{
+ ImGuiState& g = *GImGui;
+ ImGuiWindow* window = GetCurrentWindow();
+
+ if (!text_end)
+ text_end = text + strlen(text); // FIXME-OPT
+
+ const int text_len = (int)(text_end - text);
+ if (text_len > 0)
+ {
+ // Render
+ window->DrawList->AddText(window->Font(), window->FontSize(), pos, window->Color(ImGuiCol_Text), text, text_end, wrap_width);
+
+ // Log as text
+ if (g.LogEnabled)
+ LogText(pos, text, text_end);
+ }
+}
+
+static void RenderTextClipped(ImVec2 pos, const char* text, const char* text_end, const ImVec2* text_size_if_known, const ImVec2& clip_max)
+{
+ ImGuiState& g = *GImGui;
+ ImGuiWindow* window = GetCurrentWindow();
+
+ // Hide anything after a '##' string
+ const char* text_display_end = FindTextDisplayEnd(text, text_end);
+ const int text_len = (int)(text_display_end - text);
+ if (text_len > 0)
+ {
+ const ImVec2 text_size = text_size_if_known ? *text_size_if_known : ImGui::CalcTextSize(text, text_display_end, false, 0.0f);
+
+ // Perform CPU side clipping for single clipped element to avoid using scissor state
+ const bool need_clipping = (pos.x + text_size.x >= clip_max.x) || (pos.y + text_size.y >= clip_max.y);
+
+ // Render
+ window->DrawList->AddText(window->Font(), window->FontSize(), pos, window->Color(ImGuiCol_Text), text, text_display_end, 0.0f, need_clipping ? &clip_max : NULL);
+
+ // Log as text
if (g.LogEnabled)
LogText(pos, text, text_display_end);
}
@@ -2104,14 +2214,14 @@ static void RenderCollapseTriangle(ImVec2 p_min, bool opened, float scale, bool
b = center + ImVec2(-0.500f,0.866f)*r;
c = center + ImVec2(-0.500f,-0.866f)*r;
}
-
+
if (shadow && (window->Flags & ImGuiWindowFlags_ShowBorders) != 0)
window->DrawList->AddTriangleFilled(a+ImVec2(2,2), b+ImVec2(2,2), c+ImVec2(2,2), window->Color(ImGuiCol_BorderShadow));
window->DrawList->AddTriangleFilled(a, b, c, window->Color(ImGuiCol_Border));
}
// Calculate text size. Text can be multi-line. Optionally ignore text after a ## marker.
-// CalcTextSize("") should return ImVec2(0.0f, GImGui.FontSize)
+// CalcTextSize("") should return ImVec2(0.0f, GImGui->FontSize)
ImVec2 ImGui::CalcTextSize(const char* text, const char* text_end, bool hide_text_after_double_hash, float wrap_width)
{
ImGuiWindow* window = GetCurrentWindow();
@@ -2127,7 +2237,7 @@ ImVec2 ImGui::CalcTextSize(const char* text, const char* text_end, bool hide_tex
ImVec2 text_size = font->CalcTextSizeA(font_size, FLT_MAX, wrap_width, text, text_display_end, NULL);
// Cancel out character spacing for the last character of a line (it is baked into glyph->XAdvance field)
- const float font_scale = font_size / font->FontSize;
+ const float font_scale = font_size / font->FontSize;
const float character_spacing_x = 1.0f * font_scale;
if (text_size.x > 0.0f)
text_size.x -= character_spacing_x;
@@ -2135,10 +2245,48 @@ ImVec2 ImGui::CalcTextSize(const char* text, const char* text_end, bool hide_tex
return text_size;
}
+// Helper to calculate coarse clipping of large list of evenly sized items.
+// If you are displaying thousands of items and you have a random access to the list, you can perform clipping yourself to save on CPU.
+// {
+// float item_height = ImGui::GetTextLineHeightWithSpacing();
+// int display_start, display_end;
+// ImGui::CalcListClipping(count, item_height, &display_start, &display_end); // calculate how many to clip/display
+// ImGui::SetCursorPosY(ImGui::GetCursorPosY() + (display_start) * item_height); // advance cursor
+// for (int i = display_start; i < display_end; i++) // display only visible items
+// // TODO: display visible item
+// ImGui::SetCursorPosY(ImGui::GetCursorPosY() + (count - display_end) * item_height); // advance cursor
+// }
+void ImGui::CalcListClipping(int items_count, float items_height, int* out_items_display_start, int* out_items_display_end)
+{
+ ImGuiState& g = *GImGui;
+ ImGuiWindow* window = GetCurrentWindow();
+
+ if (g.LogEnabled)
+ {
+ // If logging is active, do not perform any clipping
+ *out_items_display_start = 0;
+ *out_items_display_end = items_count;
+ return;
+ }
+
+ const ImVec2 pos = window->DC.CursorPos;
+ const ImVec4 clip_rect = window->ClipRectStack.back();
+ const float clip_y1 = clip_rect.y;
+ const float clip_y2 = clip_rect.w;
+
+ int start = (int)((clip_y1 - pos.y) / items_height);
+ int end = (int)((clip_y2 - pos.y) / items_height);
+ start = ImClamp(start, 0, items_count);
+ end = ImClamp(end + 1, start, items_count);
+
+ *out_items_display_start = start;
+ *out_items_display_end = end;
+}
+
// Find window given position, search front-to-back
static ImGuiWindow* FindHoveredWindow(ImVec2 pos, bool excluding_childs)
{
- ImGuiState& g = GImGui;
+ ImGuiState& g = *GImGui;
for (int i = (int)g.Windows.size()-1; i >= 0; i--)
{
ImGuiWindow* window = g.Windows[(size_t)i];
@@ -2158,7 +2306,7 @@ static ImGuiWindow* FindHoveredWindow(ImVec2 pos, bool excluding_childs)
// NB- Expand the aabb to be generous on imprecise inputs systems (g.Style.TouchExtraPadding)
static bool IsMouseHoveringBox(const ImGuiAabb& box)
{
- ImGuiState& g = GImGui;
+ ImGuiState& g = *GImGui;
ImGuiWindow* window = GetCurrentWindow();
// Clip
@@ -2181,14 +2329,14 @@ bool ImGui::IsMouseHoveringBox(const ImVec2& box_min, const ImVec2& box_max)
bool ImGui::IsMouseHoveringWindow()
{
- ImGuiState& g = GImGui;
+ ImGuiState& g = *GImGui;
ImGuiWindow* window = GetCurrentWindow();
return g.HoveredWindow == window;
}
bool ImGui::IsMouseHoveringAnyWindow()
{
- ImGuiState& g = GImGui;
+ ImGuiState& g = *GImGui;
return g.HoveredWindow != NULL;
}
@@ -2199,14 +2347,14 @@ bool ImGui::IsPosHoveringAnyWindow(const ImVec2& pos)
static bool IsKeyPressedMap(ImGuiKey key, bool repeat)
{
- ImGuiState& g = GImGui;
+ ImGuiState& g = *GImGui;
const int key_index = g.IO.KeyMap[key];
return ImGui::IsKeyPressed(key_index, repeat);
}
bool ImGui::IsKeyPressed(int key_index, bool repeat)
{
- ImGuiState& g = GImGui;
+ ImGuiState& g = *GImGui;
IM_ASSERT(key_index >= 0 && key_index < IM_ARRAYSIZE(g.IO.KeysDown));
const float t = g.IO.KeysDownTime[key_index];
if (t == 0.0f)
@@ -2224,7 +2372,7 @@ bool ImGui::IsKeyPressed(int key_index, bool repeat)
bool ImGui::IsMouseClicked(int button, bool repeat)
{
- ImGuiState& g = GImGui;
+ ImGuiState& g = *GImGui;
IM_ASSERT(button >= 0 && button < IM_ARRAYSIZE(g.IO.MouseDown));
const float t = g.IO.MouseDownTime[button];
if (t == 0.0f)
@@ -2242,14 +2390,14 @@ bool ImGui::IsMouseClicked(int button, bool repeat)
bool ImGui::IsMouseDoubleClicked(int button)
{
- ImGuiState& g = GImGui;
+ ImGuiState& g = *GImGui;
IM_ASSERT(button >= 0 && button < IM_ARRAYSIZE(g.IO.MouseDown));
return g.IO.MouseDoubleClicked[button];
}
ImVec2 ImGui::GetMousePos()
{
- return GImGui.IO.MousePos;
+ return GImGui->IO.MousePos;
}
bool ImGui::IsItemHovered()
@@ -2260,7 +2408,7 @@ bool ImGui::IsItemHovered()
bool ImGui::IsItemActive()
{
- ImGuiState& g = GImGui;
+ ImGuiState& g = *GImGui;
if (g.ActiveId)
{
ImGuiWindow* window = GetCurrentWindow();
@@ -2284,7 +2432,7 @@ ImVec2 ImGui::GetItemBoxMax()
// Tooltip is stored and turned into a BeginTooltip()/EndTooltip() sequence at the end of the frame. Each call override previous value.
void ImGui::SetTooltipV(const char* fmt, va_list args)
{
- ImGuiState& g = GImGui;
+ ImGuiState& g = *GImGui;
ImFormatStringV(g.Tooltip, IM_ARRAYSIZE(g.Tooltip), fmt, args);
}
@@ -2298,17 +2446,17 @@ void ImGui::SetTooltip(const char* fmt, ...)
float ImGui::GetTime()
{
- return GImGui.Time;
+ return GImGui->Time;
}
int ImGui::GetFrameCount()
{
- return GImGui.FrameCount;
+ return GImGui->FrameCount;
}
void ImGui::BeginTooltip()
{
- ImGuiState& g = GImGui;
+ ImGuiState& g = *GImGui;
ImGuiWindowFlags window_flags = ImGuiWindowFlags_NoTitleBar|ImGuiWindowFlags_NoMove|ImGuiWindowFlags_NoResize|ImGuiWindowFlags_NoSavedSettings|ImGuiWindowFlags_AlwaysAutoResize|ImGuiWindowFlags_Tooltip;
ImGui::Begin("##Tooltip", NULL, ImVec2(0,0), g.Style.Colors[ImGuiCol_TooltipBg].w, window_flags);
}
@@ -2319,9 +2467,16 @@ void ImGui::EndTooltip()
ImGui::End();
}
+void ImGui::BeginChild(ImGuiID id, ImVec2 size, bool border, ImGuiWindowFlags extra_flags)
+{
+ char str_id[32];
+ ImFormatString(str_id, IM_ARRAYSIZE(str_id), "child_%x", id);
+ ImGui::BeginChild(str_id, size, border, extra_flags);
+}
+
void ImGui::BeginChild(const char* str_id, ImVec2 size, bool border, ImGuiWindowFlags extra_flags)
{
- ImGuiState& g = GImGui;
+ ImGuiState& g = *GImGui;
ImGuiWindow* window = GetCurrentWindow();
ImGuiWindowFlags flags = ImGuiWindowFlags_NoTitleBar|ImGuiWindowFlags_NoMove|ImGuiWindowFlags_NoResize|ImGuiWindowFlags_NoSavedSettings|ImGuiWindowFlags_ChildWindow;
@@ -2347,7 +2502,7 @@ void ImGui::BeginChild(const char* str_id, ImVec2 size, bool border, ImGuiWindow
char title[256];
ImFormatString(title, IM_ARRAYSIZE(title), "%s.%s", window->Name, str_id);
- const float alpha = (flags & ImGuiWindowFlags_ComboBox) ? 1.0f : 0.0f;
+ const float alpha = 1.0f;
ImGui::Begin(title, NULL, size, alpha, flags);
if (!(window->Flags & ImGuiWindowFlags_ShowBorders))
@@ -2371,16 +2526,33 @@ void ImGui::EndChild()
sz.x = 0;
if (window->Flags & ImGuiWindowFlags_ChildWindowAutoFitY)
sz.y = 0;
-
+
ImGui::End();
ItemSize(sz);
}
}
+// Helper to create a child window / scrolling region that looks like a normal widget frame.
+void ImGui::BeginChildFrame(ImGuiID id, const ImVec2& size)
+{
+ ImGuiState& g = *GImGui;
+ const ImGuiStyle& style = g.Style;
+ ImGui::PushStyleColor(ImGuiCol_ChildWindowBg, style.Colors[ImGuiCol_FrameBg]);
+ ImGui::PushStyleVar(ImGuiStyleVar_ChildWindowRounding, style.FrameRounding);
+ ImGui::BeginChild(id, size);
+}
+
+void ImGui::EndChildFrame()
+{
+ ImGui::EndChild();
+ ImGui::PopStyleVar();
+ ImGui::PopStyleColor();
+}
+
static ImGuiWindow* FindWindowByName(const char* name)
{
// FIXME-OPT: Consider optimizing this (e.g. sorted hashes to window pointers)
- ImGuiState& g = GImGui;
+ ImGuiState& g = *GImGui;
for (size_t i = 0; i != g.Windows.size(); i++)
if (strcmp(g.Windows[i]->Name, name) == 0)
return g.Windows[i];
@@ -2389,7 +2561,7 @@ static ImGuiWindow* FindWindowByName(const char* name)
static ImGuiWindow* CreateNewWindow(const char* name, ImVec2 size, ImGuiWindowFlags flags)
{
- ImGuiState& g = GImGui;
+ ImGuiState& g = *GImGui;
// Create window the first time
ImGuiWindow* window = (ImGuiWindow*)ImGui::MemAlloc(sizeof(ImGuiWindow));
@@ -2435,7 +2607,7 @@ static ImGuiWindow* CreateNewWindow(const char* name, ImVec2 size, ImGuiWindowFl
return window;
}
-// Push a new ImGui window to add widgets to.
+// Push a new ImGui window to add widgets to.
// - A default window called "Debug" is automatically stacked at the beginning of every frame.
// - This can be called multiple times during the frame with the same window name to append content to the same window.
// - The window name is used as a unique identifier to preserve window information across frames (and save rudimentary information to the .ini file). Note that you can use ## to append unique data that isn't displayed, e.g. "My window##1" will use "My window##1" as unique window ID but display "My window" to the user.
@@ -2444,7 +2616,7 @@ static ImGuiWindow* CreateNewWindow(const char* name, ImVec2 size, ImGuiWindowFl
// - Passing non-zero 'size' is roughly equivalent to calling SetNextWindowSize(size, ImGuiSetCondition_FirstUseEver) prior to calling Begin().
bool ImGui::Begin(const char* name, bool* p_opened, ImVec2 size, float fill_alpha, ImGuiWindowFlags flags)
{
- ImGuiState& g = GImGui;
+ ImGuiState& g = *GImGui;
const ImGuiStyle& style = g.Style;
IM_ASSERT(g.Initialized); // Forgot to call ImGui::NewFrame()
IM_ASSERT(name != NULL); // Must pass a name
@@ -2612,7 +2784,7 @@ bool ImGui::Begin(const char* name, bool* p_opened, ImVec2 size, float fill_alph
// Collapse window by double-clicking on title bar
if (!(window->Flags & ImGuiWindowFlags_NoTitleBar))
{
- if (g.HoveredWindow == window && IsMouseHoveringBox(title_bar_aabb) && g.IO.MouseDoubleClicked[0])
+ if (!(window->Flags & ImGuiWindowFlags_NoCollapse) && g.HoveredWindow == window && IsMouseHoveringBox(title_bar_aabb) && g.IO.MouseDoubleClicked[0])
{
window->Collapsed = !window->Collapsed;
if (!(window->Flags & ImGuiWindowFlags_NoSavedSettings))
@@ -2625,15 +2797,16 @@ bool ImGui::Begin(const char* name, bool* p_opened, ImVec2 size, float fill_alph
window->Collapsed = false;
}
+ const float window_rounding = (window->Flags & ImGuiWindowFlags_ChildWindow) ? style.ChildWindowRounding : style.WindowRounding;
if (window->Collapsed)
{
// Draw title bar only
window->Size = title_bar_aabb.GetSize();
- window->DrawList->AddRectFilled(title_bar_aabb.GetTL(), title_bar_aabb.GetBR(), window->Color(ImGuiCol_TitleBgCollapsed), style.WindowRounding);
+ window->DrawList->AddRectFilled(title_bar_aabb.GetTL(), title_bar_aabb.GetBR(), window->Color(ImGuiCol_TitleBgCollapsed), window_rounding);
if (window->Flags & ImGuiWindowFlags_ShowBorders)
{
- window->DrawList->AddRect(title_bar_aabb.GetTL()+ImVec2(1,1), title_bar_aabb.GetBR()+ImVec2(1,1), window->Color(ImGuiCol_BorderShadow), style.WindowRounding);
- window->DrawList->AddRect(title_bar_aabb.GetTL(), title_bar_aabb.GetBR(), window->Color(ImGuiCol_Border), style.WindowRounding);
+ window->DrawList->AddRect(title_bar_aabb.GetTL()+ImVec2(1,1), title_bar_aabb.GetBR()+ImVec2(1,1), window->Color(ImGuiCol_BorderShadow), window_rounding);
+ window->DrawList->AddRect(title_bar_aabb.GetTL(), title_bar_aabb.GetBR(), window->Color(ImGuiCol_Border), window_rounding);
}
}
else
@@ -2696,32 +2869,36 @@ bool ImGui::Begin(const char* name, bool* p_opened, ImVec2 size, float fill_alph
title_bar_aabb = window->TitleBarAabb();
}
- // Title bar + Window box
+ // Scrollbar
+ window->ScrollbarY = (window->SizeContentsFit.y > window->Size.y) && !(window->Flags & ImGuiWindowFlags_NoScrollbar);
+
+ // Window background
if (fill_alpha > 0.0f)
{
if ((window->Flags & ImGuiWindowFlags_ComboBox) != 0)
- window->DrawList->AddRectFilled(window->Pos, window->Pos+window->Size, window->Color(ImGuiCol_ComboBg, fill_alpha), 0);
+ window->DrawList->AddRectFilled(window->Pos, window->Pos+window->Size, window->Color(ImGuiCol_ComboBg, fill_alpha), window_rounding);
else if ((window->Flags & ImGuiWindowFlags_Tooltip) != 0)
- window->DrawList->AddRectFilled(window->Pos, window->Pos+window->Size, window->Color(ImGuiCol_TooltipBg, fill_alpha), style.WindowRounding);
+ window->DrawList->AddRectFilled(window->Pos, window->Pos+window->Size, window->Color(ImGuiCol_TooltipBg, fill_alpha), window_rounding);
+ else if ((window->Flags & ImGuiWindowFlags_ChildWindow) != 0)
+ window->DrawList->AddRectFilled(window->Pos, window->Pos+window->Size-ImVec2(window->ScrollbarY?style.ScrollBarWidth:0.0f,0.0f), window->Color(ImGuiCol_ChildWindowBg, fill_alpha), window_rounding, window->ScrollbarY ? (1|8) : (0xF));
else
- window->DrawList->AddRectFilled(window->Pos, window->Pos+window->Size, window->Color(ImGuiCol_WindowBg, fill_alpha), style.WindowRounding);
+ window->DrawList->AddRectFilled(window->Pos, window->Pos+window->Size, window->Color(ImGuiCol_WindowBg, fill_alpha), window_rounding);
}
+ // Title bar
if (!(window->Flags & ImGuiWindowFlags_NoTitleBar))
- window->DrawList->AddRectFilled(title_bar_aabb.GetTL(), title_bar_aabb.GetBR(), window->Color(ImGuiCol_TitleBg), style.WindowRounding, 1|2);
+ window->DrawList->AddRectFilled(title_bar_aabb.GetTL(), title_bar_aabb.GetBR(), window->Color(ImGuiCol_TitleBg), window_rounding, 1|2);
// Borders
if (window->Flags & ImGuiWindowFlags_ShowBorders)
{
- const float rounding = (window->Flags & ImGuiWindowFlags_ComboBox) ? 0.0f : style.WindowRounding;
- window->DrawList->AddRect(window->Pos+ImVec2(1,1), window->Pos+window->Size+ImVec2(1,1), window->Color(ImGuiCol_BorderShadow), rounding);
- window->DrawList->AddRect(window->Pos, window->Pos+window->Size, window->Color(ImGuiCol_Border), rounding);
+ window->DrawList->AddRect(window->Pos+ImVec2(1,1), window->Pos+window->Size+ImVec2(1,1), window->Color(ImGuiCol_BorderShadow), window_rounding);
+ window->DrawList->AddRect(window->Pos, window->Pos+window->Size, window->Color(ImGuiCol_Border), window_rounding);
if (!(window->Flags & ImGuiWindowFlags_NoTitleBar))
window->DrawList->AddLine(title_bar_aabb.GetBL(), title_bar_aabb.GetBR(), window->Color(ImGuiCol_Border));
}
// Scrollbar
- window->ScrollbarY = (window->SizeContentsFit.y > window->Size.y) && !(window->Flags & ImGuiWindowFlags_NoScrollbar);
if (window->ScrollbarY)
{
ImGuiAabb scrollbar_bb(window->Aabb().Max.x - style.ScrollBarWidth, title_bar_aabb.Max.y+1, window->Aabb().Max.x, window->Aabb().Max.y-1);
@@ -2743,7 +2920,7 @@ bool ImGui::Begin(const char* name, bool* p_opened, ImVec2 size, float fill_alph
{
g.HoveredId = scrollbar_id;
const float pos_y_norm = ImSaturate((g.IO.MousePos.y - (scrollbar_bb.Min.y + grab_size_y*0.5f)) / (scrollbar_bb.GetHeight() - grab_size_y)) * (1.0f - grab_size_y_norm);
- window->ScrollY = pos_y_norm * window->SizeContentsFit.y;
+ window->ScrollY = (float)(int)(pos_y_norm * window->SizeContentsFit.y);
window->NextScrollY = window->ScrollY;
}
}
@@ -2752,7 +2929,7 @@ bool ImGui::Begin(const char* name, bool* p_opened, ImVec2 size, float fill_alph
const float pos_y_norm = ImSaturate(window->ScrollY / ImMax(0.0f, window->SizeContentsFit.y));
const ImU32 grab_col = window->Color(held ? ImGuiCol_ScrollbarGrabActive : hovered ? ImGuiCol_ScrollbarGrabHovered : ImGuiCol_ScrollbarGrab);
window->DrawList->AddRectFilled(
- ImVec2(scrollbar_bb.Min.x, ImLerp(scrollbar_bb.Min.y, scrollbar_bb.Max.y, pos_y_norm)),
+ ImVec2(scrollbar_bb.Min.x, ImLerp(scrollbar_bb.Min.y, scrollbar_bb.Max.y, pos_y_norm)),
ImVec2(scrollbar_bb.Max.x, ImLerp(scrollbar_bb.Min.y, scrollbar_bb.Max.y, pos_y_norm + grab_size_y_norm)), grab_col);
}
@@ -2760,7 +2937,7 @@ bool ImGui::Begin(const char* name, bool* p_opened, ImVec2 size, float fill_alph
// (after the input handling so we don't have a frame of latency)
if (!(window->Flags & ImGuiWindowFlags_NoResize))
{
- const float r = style.WindowRounding;
+ const float r = window_rounding;
const ImVec2 br = window->Aabb().GetBR();
if (r == 0.0f)
{
@@ -2785,7 +2962,7 @@ bool ImGui::Begin(const char* name, bool* p_opened, ImVec2 size, float fill_alph
window->DC.CurrentLineHeight = window->DC.PrevLineHeight = 0.0f;
window->DC.LogLineHeight = window->DC.CursorPos.y - 9999.0f;
window->DC.ChildWindows.resize(0);
- window->DC.ItemWidth.resize(0);
+ window->DC.ItemWidth.resize(0);
window->DC.ItemWidth.push_back(window->ItemWidthDefault);
window->DC.AllowKeyboardFocus.resize(0);
window->DC.AllowKeyboardFocus.push_back(true);
@@ -2808,19 +2985,19 @@ bool ImGui::Begin(const char* name, bool* p_opened, ImVec2 size, float fill_alph
// Title bar
if (!(window->Flags & ImGuiWindowFlags_NoTitleBar))
{
- RenderCollapseTriangle(window->Pos + style.FramePadding, !window->Collapsed, 1.0f, true);
if (p_opened != NULL)
CloseWindowButton(p_opened);
+ ImVec2 text_min = window->Pos + style.FramePadding;
+ if (!(window->Flags & ImGuiWindowFlags_NoCollapse))
+ {
+ RenderCollapseTriangle(window->Pos + style.FramePadding, !window->Collapsed, 1.0f, true);
+ text_min.x += window->FontSize() + style.ItemInnerSpacing.x;
+ }
+
const ImVec2 text_size = CalcTextSize(name, NULL, true);
- const ImVec2 text_min = window->Pos + style.FramePadding + ImVec2(window->FontSize() + style.ItemInnerSpacing.x, 0.0f);
- const ImVec2 text_max = window->Pos + ImVec2(window->Size.x - (p_opened ? (title_bar_aabb.GetHeight()-3) : style.FramePadding.x), style.FramePadding.y + text_size.y);
- const bool clip_title = text_size.x > (text_max.x - text_min.x); // only push a clip rectangle if we need to, because it may turn into a separate draw call
- if (clip_title)
- PushClipRect(ImVec4(text_min.x, text_min.y, text_max.x, text_max.y));
- RenderText(text_min, name);
- if (clip_title)
- PopClipRect();
+ const ImVec2 text_max = window->Pos + ImVec2(window->Size.x - (p_opened ? (title_bar_aabb.GetHeight()-3) : style.FramePadding.x), style.FramePadding.y*2 + text_size.y);
+ RenderTextClipped(text_min, name, NULL, &text_size, text_max);
}
}
@@ -2859,7 +3036,7 @@ bool ImGui::Begin(const char* name, bool* p_opened, ImVec2 size, float fill_alph
void ImGui::End()
{
- ImGuiState& g = GImGui;
+ ImGuiState& g = *GImGui;
ImGuiWindow* window = g.CurrentWindow;
ImGui::Columns(1, "#CloseColumns");
@@ -2880,7 +3057,7 @@ void ImGui::End()
// Moving window to front of display (which happens to be back of our sorted list)
static void FocusWindow(ImGuiWindow* window)
{
- ImGuiState& g = GImGui;
+ ImGuiState& g = *GImGui;
g.FocusedWindow = window;
if (g.Windows.back() == window)
@@ -2898,8 +3075,7 @@ static void FocusWindow(ImGuiWindow* window)
void ImGui::PushItemWidth(float item_width)
{
ImGuiWindow* window = GetCurrentWindow();
- item_width = (float)(int)item_width;
- window->DC.ItemWidth.push_back(item_width > 0.0f ? item_width : window->ItemWidthDefault);
+ window->DC.ItemWidth.push_back(item_width == 0.0f ? window->ItemWidthDefault : item_width);
}
void ImGui::PopItemWidth()
@@ -2908,15 +3084,25 @@ void ImGui::PopItemWidth()
window->DC.ItemWidth.pop_back();
}
-float ImGui::GetItemWidth()
+float ImGui::CalcItemWidth()
{
ImGuiWindow* window = GetCurrentWindow();
- return window->DC.ItemWidth.back();
+ float w = window->DC.ItemWidth.back();
+ if (w < 0.0f)
+ {
+ // Align to a right-side limit. We include 1 frame padding in the calculation because this is how the width is always used (we add 2 frame padding to it), but we could move that responsibility to the widget as well.
+ ImGuiState& g = *GImGui;
+ w = -w;
+ float width_to_right_edge = window->Pos.x + ImGui::GetContentRegionMax().x - window->DC.CursorPos.x;
+ w = ImMax(1.0f, width_to_right_edge - w - g.Style.FramePadding.x * 2.0f);
+ }
+ w = (float)(int)w;
+ return w;
}
static void SetFont(ImFont* font)
{
- ImGuiState& g = GImGui;
+ ImGuiState& g = *GImGui;
IM_ASSERT(font && font->IsLoaded());
IM_ASSERT(font->Scale > 0.0f);
@@ -2929,7 +3115,7 @@ static void SetFont(ImFont* font)
void ImGui::PushFont(ImFont* font)
{
- ImGuiState& g = GImGui;
+ ImGuiState& g = *GImGui;
if (!font)
font = g.IO.Fonts->Fonts[0];
@@ -2941,7 +3127,7 @@ void ImGui::PushFont(ImFont* font)
void ImGui::PopFont()
{
- ImGuiState& g = GImGui;
+ ImGuiState& g = *GImGui;
g.CurrentWindow->DrawList->PopTextureID();
g.FontStack.pop_back();
@@ -2974,7 +3160,7 @@ void ImGui::PopTextWrapPos()
void ImGui::PushStyleColor(ImGuiCol idx, const ImVec4& col)
{
- ImGuiState& g = GImGui;
+ ImGuiState& g = *GImGui;
ImGuiColMod backup;
backup.Col = idx;
@@ -2985,7 +3171,7 @@ void ImGui::PushStyleColor(ImGuiCol idx, const ImVec4& col)
void ImGui::PopStyleColor(int count)
{
- ImGuiState& g = GImGui;
+ ImGuiState& g = *GImGui;
while (count > 0)
{
@@ -2998,11 +3184,12 @@ void ImGui::PopStyleColor(int count)
static float* GetStyleVarFloatAddr(ImGuiStyleVar idx)
{
- ImGuiState& g = GImGui;
+ ImGuiState& g = *GImGui;
switch (idx)
{
case ImGuiStyleVar_Alpha: return &g.Style.Alpha;
case ImGuiStyleVar_WindowRounding: return &g.Style.WindowRounding;
+ case ImGuiStyleVar_ChildWindowRounding: return &g.Style.ChildWindowRounding;
case ImGuiStyleVar_FrameRounding: return &g.Style.FrameRounding;
case ImGuiStyleVar_TreeNodeSpacing: return &g.Style.TreeNodeSpacing;
}
@@ -3011,7 +3198,7 @@ static float* GetStyleVarFloatAddr(ImGuiStyleVar idx)
static ImVec2* GetStyleVarVec2Addr(ImGuiStyleVar idx)
{
- ImGuiState& g = GImGui;
+ ImGuiState& g = *GImGui;
switch (idx)
{
case ImGuiStyleVar_WindowPadding: return &g.Style.WindowPadding;
@@ -3024,7 +3211,7 @@ static ImVec2* GetStyleVarVec2Addr(ImGuiStyleVar idx)
void ImGui::PushStyleVar(ImGuiStyleVar idx, float val)
{
- ImGuiState& g = GImGui;
+ ImGuiState& g = *GImGui;
float* pvar = GetStyleVarFloatAddr(idx);
IM_ASSERT(pvar != NULL); // Called function with wrong-type? Variable is not a float.
@@ -3038,7 +3225,7 @@ void ImGui::PushStyleVar(ImGuiStyleVar idx, float val)
void ImGui::PushStyleVar(ImGuiStyleVar idx, const ImVec2& val)
{
- ImGuiState& g = GImGui;
+ ImGuiState& g = *GImGui;
ImVec2* pvar = GetStyleVarVec2Addr(idx);
IM_ASSERT(pvar != NULL); // Called function with wrong-type? Varialble is not a ImVec2.
@@ -3051,7 +3238,7 @@ void ImGui::PushStyleVar(ImGuiStyleVar idx, const ImVec2& val)
void ImGui::PopStyleVar(int count)
{
- ImGuiState& g = GImGui;
+ ImGuiState& g = *GImGui;
while (count > 0)
{
@@ -3072,6 +3259,7 @@ const char* ImGui::GetStyleColName(ImGuiCol idx)
{
case ImGuiCol_Text: return "Text";
case ImGuiCol_WindowBg: return "WindowBg";
+ case ImGuiCol_ChildWindowBg: return "ChildWindowBg";
case ImGuiCol_Border: return "Border";
case ImGuiCol_BorderShadow: return "BorderShadow";
case ImGuiCol_FrameBg: return "FrameBg";
@@ -3115,7 +3303,7 @@ const char* ImGui::GetStyleColName(ImGuiCol idx)
bool ImGui::GetWindowIsFocused()
{
- ImGuiState& g = GImGui;
+ ImGuiState& g = *GImGui;
ImGuiWindow* window = GetCurrentWindow();
return g.FocusedWindow == window;
}
@@ -3192,21 +3380,21 @@ void ImGui::SetWindowCollapsed(bool collapsed, ImGuiSetCondition cond)
void ImGui::SetNextWindowPos(const ImVec2& pos, ImGuiSetCondition cond)
{
- ImGuiState& g = GImGui;
+ ImGuiState& g = *GImGui;
g.SetNextWindowPosVal = pos;
g.SetNextWindowPosCond = cond ? cond : ImGuiSetCondition_Always;
}
void ImGui::SetNextWindowSize(const ImVec2& size, ImGuiSetCondition cond)
{
- ImGuiState& g = GImGui;
+ ImGuiState& g = *GImGui;
g.SetNextWindowSizeVal = size;
g.SetNextWindowSizeCond = cond ? cond : ImGuiSetCondition_Always;
}
void ImGui::SetNextWindowCollapsed(bool collapsed, ImGuiSetCondition cond)
{
- ImGuiState& g = GImGui;
+ ImGuiState& g = *GImGui;
g.SetNextWindowCollapsedVal = collapsed;
g.SetNextWindowCollapsedCond = cond ? cond : ImGuiSetCondition_Always;
}
@@ -3214,20 +3402,18 @@ void ImGui::SetNextWindowCollapsed(bool collapsed, ImGuiSetCondition cond)
ImVec2 ImGui::GetContentRegionMax()
{
ImGuiWindow* window = GetCurrentWindow();
-
- ImVec2 m = window->Size - window->WindowPadding();
+ ImVec2 mx = window->Size - window->WindowPadding();
if (window->DC.ColumnsCount != 1)
{
- m.x = GetColumnOffset(window->DC.ColumnsCurrent + 1);
- m.x -= GImGui.Style.WindowPadding.x;
+ mx.x = ImGui::GetColumnOffset(window->DC.ColumnsCurrent + 1);
+ mx.x -= GImGui->Style.WindowPadding.x;
}
else
{
if (window->ScrollbarY)
- m.x -= GImGui.Style.ScrollBarWidth;
+ mx.x -= GImGui->Style.ScrollBarWidth;
}
-
- return m;
+ return mx;
}
ImVec2 ImGui::GetWindowContentRegionMin()
@@ -3241,7 +3427,7 @@ ImVec2 ImGui::GetWindowContentRegionMax()
ImGuiWindow* window = GetCurrentWindow();
ImVec2 m = window->Size - window->WindowPadding();
if (window->ScrollbarY)
- m.x -= GImGui.Style.ScrollBarWidth;
+ m.x -= GImGui->Style.ScrollBarWidth;
return m;
}
@@ -3251,9 +3437,9 @@ float ImGui::GetTextLineHeight()
return window->FontSize();
}
-float ImGui::GetTextLineSpacing()
+float ImGui::GetTextLineHeightWithSpacing()
{
- ImGuiState& g = GImGui;
+ ImGuiState& g = *GImGui;
ImGuiWindow* window = GetCurrentWindow();
return window->FontSize() + g.Style.ItemSpacing.y;
}
@@ -3290,22 +3476,35 @@ ImVec2 ImGui::GetCursorPos()
return window->DC.CursorPos - window->Pos;
}
+float ImGui::GetCursorPosX()
+{
+ return ImGui::GetCursorPos().x;
+}
+
+float ImGui::GetCursorPosY()
+{
+ return ImGui::GetCursorPos().y;
+}
+
void ImGui::SetCursorPos(const ImVec2& pos)
{
ImGuiWindow* window = GetCurrentWindow();
window->DC.CursorPos = window->Pos + pos;
+ window->SizeContentsFit = ImMax(window->SizeContentsFit, pos + ImVec2(0.0f, window->ScrollY));
}
void ImGui::SetCursorPosX(float x)
{
ImGuiWindow* window = GetCurrentWindow();
window->DC.CursorPos.x = window->Pos.x + x;
+ window->SizeContentsFit.x = ImMax(window->SizeContentsFit.x, x);
}
void ImGui::SetCursorPosY(float y)
{
ImGuiWindow* window = GetCurrentWindow();
window->DC.CursorPos.y = window->Pos.y + y;
+ window->SizeContentsFit.y = ImMax(window->SizeContentsFit.y, y + window->ScrollY);
}
ImVec2 ImGui::GetCursorScreenPos()
@@ -3396,7 +3595,7 @@ void ImGui::TextWrapped(const char* fmt, ...)
void ImGui::TextUnformatted(const char* text, const char* text_end)
{
- ImGuiState& g = GImGui;
+ ImGuiState& g = *GImGui;
ImGuiWindow* window = GetCurrentWindow();
if (window->SkipItems)
return;
@@ -3412,8 +3611,8 @@ void ImGui::TextUnformatted(const char* text, const char* text_end)
{
// Long text!
// Perform manual coarse clipping to optimize for long multi-line text
- // From this point we will only compute the width of lines that are visible.
- // Optimization only available when word-wrapping is disabled.
+ // From this point we will only compute the width of lines that are visible. Optimization only available when word-wrapping is disabled.
+ // We also don't vertically center the text within the line full height, which is unlikely to matter because we are likely the biggest and only item on the line.
const char* line = text;
const float line_height = ImGui::GetTextLineHeight();
const ImVec2 start_pos = window->DC.CursorPos;
@@ -3490,15 +3689,14 @@ void ImGui::TextUnformatted(const char* text, const char* text_end)
if (!ItemAdd(bb, NULL))
return;
- // Render
- // We don't hide text after ## in this end-user function.
- RenderText(bb.Min, text_begin, text_end, false, wrap_width);
+ // Render (we don't hide text after ## in this end-user function)
+ RenderTextWrapped(bb.Min, text_begin, text_end, wrap_width);
}
}
void ImGui::AlignFirstTextHeightToWidgets()
{
- ImGuiState& g = GImGui;
+ ImGuiState& g = *GImGui;
ImGuiWindow* window = GetCurrentWindow();
if (window->SkipItems)
return;
@@ -3511,16 +3709,16 @@ void ImGui::AlignFirstTextHeightToWidgets()
// Add a label+text combo aligned to other label+value widgets
void ImGui::LabelTextV(const char* label, const char* fmt, va_list args)
{
- ImGuiState& g = GImGui;
+ ImGuiState& g = *GImGui;
ImGuiWindow* window = GetCurrentWindow();
if (window->SkipItems)
return;
const ImGuiStyle& style = g.Style;
- const float w = window->DC.ItemWidth.back();
+ const float w = ImGui::CalcItemWidth();
static char buf[1024];
- const char* text_begin = &buf[0];
- const char* text_end = text_begin + ImFormatStringV(buf, IM_ARRAYSIZE(buf), fmt, args);
+ const char* value_text_begin = &buf[0];
+ const char* value_text_end = value_text_begin + ImFormatStringV(buf, IM_ARRAYSIZE(buf), fmt, args);
const ImVec2 text_size = CalcTextSize(label, NULL, true);
const ImGuiAabb value_bb(window->DC.CursorPos, window->DC.CursorPos + ImVec2(w + style.FramePadding.x*2, text_size.y));
@@ -3530,7 +3728,7 @@ void ImGui::LabelTextV(const char* label, const char* fmt, va_list args)
return;
// Render
- RenderText(value_bb.Min, text_begin, text_end);
+ RenderTextClipped(value_bb.Min, value_text_begin, value_text_end, NULL, value_bb.Max);
RenderText(ImVec2(value_bb.Max.x + style.ItemInnerSpacing.x, value_bb.Min.y), label);
}
@@ -3544,7 +3742,7 @@ void ImGui::LabelText(const char* label, const char* fmt, ...)
static bool IsHovered(const ImGuiAabb& bb, const ImGuiID& id)
{
- ImGuiState& g = GImGui;
+ ImGuiState& g = *GImGui;
if (g.HoveredId == 0)
{
ImGuiWindow* window = GetCurrentWindow();
@@ -3554,9 +3752,9 @@ static bool IsHovered(const ImGuiAabb& bb, const ImGuiID& id)
return false;
}
-static bool ButtonBehaviour(const ImGuiAabb& bb, const ImGuiID& id, bool* out_hovered, bool* out_held, bool allow_key_modifiers, bool repeat)
+static bool ButtonBehaviour(const ImGuiAabb& bb, const ImGuiID& id, bool* out_hovered, bool* out_held, bool allow_key_modifiers, bool repeat, bool pressed_on_click)
{
- ImGuiState& g = GImGui;
+ ImGuiState& g = *GImGui;
ImGuiWindow* window = GetCurrentWindow();
const bool hovered = IsHovered(bb, id);
@@ -3568,7 +3766,15 @@ static bool ButtonBehaviour(const ImGuiAabb& bb, const ImGuiID& id, bool* out_ho
{
if (g.IO.MouseClicked[0])
{
- SetActiveId(id);
+ if (pressed_on_click)
+ {
+ pressed = true;
+ SetActiveId(0);
+ }
+ else
+ {
+ SetActiveId(id);
+ }
FocusWindow(window);
}
else if (repeat && g.ActiveId && ImGui::IsMouseClicked(0, true))
@@ -3601,7 +3807,7 @@ static bool ButtonBehaviour(const ImGuiAabb& bb, const ImGuiID& id, bool* out_ho
bool ImGui::Button(const char* label, const ImVec2& size_arg, bool repeat_when_held)
{
- ImGuiState& g = GImGui;
+ ImGuiState& g = *GImGui;
ImGuiWindow* window = GetCurrentWindow();
if (window->SkipItems)
return false;
@@ -3611,7 +3817,6 @@ bool ImGui::Button(const char* label, const ImVec2& size_arg, bool repeat_when_h
const ImVec2 text_size = CalcTextSize(label, NULL, true);
const ImVec2 size(size_arg.x != 0.0f ? size_arg.x : text_size.x, size_arg.y != 0.0f ? size_arg.y : text_size.y);
-
const ImGuiAabb bb(window->DC.CursorPos, window->DC.CursorPos + size + style.FramePadding*2.0f);
ItemSize(bb);
if (!ItemAdd(bb, &id))
@@ -3624,12 +3829,8 @@ bool ImGui::Button(const char* label, const ImVec2& size_arg, bool repeat_when_h
const ImU32 col = window->Color((hovered && held) ? ImGuiCol_ButtonActive : hovered ? ImGuiCol_ButtonHovered : ImGuiCol_Button);
RenderFrame(bb.Min, bb.Max, col, true, style.FrameRounding);
- if (size.x < text_size.x || size.y < text_size.y)
- PushClipRect(ImVec4(bb.Min.x+style.FramePadding.x, bb.Min.y+style.FramePadding.y, bb.Max.x, bb.Max.y-style.FramePadding.y)); // Allow extra to draw over the horizontal padding to make it visible that text doesn't fit
- const ImVec2 off = ImVec2(ImMax(0.0f, size.x - text_size.x) * 0.5f, ImMax(0.0f, size.y - text_size.y) * 0.5f);
- RenderText(bb.Min + style.FramePadding + off, label);
- if (size.x < text_size.x || size.y < text_size.y)
- PopClipRect();
+ const ImVec2 off = ImVec2(ImMax(0.0f, size.x - text_size.x) * 0.5f, ImMax(0.0f, size.y - text_size.y) * 0.5f); // Center (only applies if we explicitly gave a size bigger than the text size, which isn't the common path)
+ RenderTextClipped(bb.Min + style.FramePadding + off, label, NULL, &text_size, bb.Max); // Render clip (only applies if we explicitly gave a size smaller than the text size, which isn't the commmon path)
return pressed;
}
@@ -3637,7 +3838,7 @@ bool ImGui::Button(const char* label, const ImVec2& size_arg, bool repeat_when_h
// Small buttons fits within text without additional spacing.
bool ImGui::SmallButton(const char* label)
{
- ImGuiState& g = GImGui;
+ ImGuiState& g = *GImGui;
ImGuiWindow* window = GetCurrentWindow();
if (window->SkipItems)
return false;
@@ -3740,9 +3941,9 @@ void ImGui::Image(ImTextureID user_texture_id, const ImVec2& size, const ImVec2&
// frame_padding = 0: no framing
// frame_padding > 0: set framing size
// The color used are the button colors.
-bool ImGui::ImageButton(ImTextureID user_texture_id, const ImVec2& size, const ImVec2& uv0, const ImVec2& uv1, int frame_padding, const ImVec4& bg_col)
+bool ImGui::ImageButton(ImTextureID user_texture_id, const ImVec2& size, const ImVec2& uv0, const ImVec2& uv1, int frame_padding, const ImVec4& bg_col, const ImVec4& tint_col)
{
- ImGuiState& g = GImGui;
+ ImGuiState& g = *GImGui;
ImGuiWindow* window = GetCurrentWindow();
if (window->SkipItems)
return false;
@@ -3757,7 +3958,7 @@ bool ImGui::ImageButton(ImTextureID user_texture_id, const ImVec2& size, const I
const ImVec2 padding = (frame_padding >= 0) ? ImVec2((float)frame_padding, (float)frame_padding) : style.FramePadding;
const ImGuiAabb bb(window->DC.CursorPos, window->DC.CursorPos + size + padding*2);
- const ImGuiAabb image_bb(window->DC.CursorPos + padding, window->DC.CursorPos + padding + size);
+ const ImGuiAabb image_bb(window->DC.CursorPos + padding, window->DC.CursorPos + padding + size);
ItemSize(bb);
if (!ItemAdd(bb, &id))
return false;
@@ -3771,7 +3972,7 @@ bool ImGui::ImageButton(ImTextureID user_texture_id, const ImVec2& size, const I
RenderFrame(bb.Min, bb.Max, col);
if (bg_col.w > 0.0f)
window->DrawList->AddRectFilled(image_bb.Min, image_bb.Max, window->Color(bg_col));
- window->DrawList->AddImage(user_texture_id, image_bb.Min, image_bb.Max, uv0, uv1);
+ window->DrawList->AddImage(user_texture_id, image_bb.Min, image_bb.Max, uv0, uv1, window->Color(tint_col));
return pressed;
}
@@ -3779,7 +3980,7 @@ bool ImGui::ImageButton(ImTextureID user_texture_id, const ImVec2& size, const I
// Start logging ImGui output to TTY
void ImGui::LogToTTY(int max_depth)
{
- ImGuiState& g = GImGui;
+ ImGuiState& g = *GImGui;
ImGuiWindow* window = GetCurrentWindow();
if (g.LogEnabled)
return;
@@ -3794,7 +3995,7 @@ void ImGui::LogToTTY(int max_depth)
// Start logging ImGui output to given file
void ImGui::LogToFile(int max_depth, const char* filename)
{
- ImGuiState& g = GImGui;
+ ImGuiState& g = *GImGui;
ImGuiWindow* window = GetCurrentWindow();
if (g.LogEnabled)
return;
@@ -3817,7 +4018,7 @@ void ImGui::LogToFile(int max_depth, const char* filename)
void ImGui::LogToClipboard(int max_depth)
{
ImGuiWindow* window = GetCurrentWindow();
- ImGuiState& g = GImGui;
+ ImGuiState& g = *GImGui;
if (g.LogEnabled)
return;
@@ -3830,7 +4031,7 @@ void ImGui::LogToClipboard(int max_depth)
void ImGui::LogFinish()
{
- ImGuiState& g = GImGui;
+ ImGuiState& g = *GImGui;
if (!g.LogEnabled)
return;
@@ -3855,11 +4056,11 @@ void ImGui::LogFinish()
// Helper to display logging buttons
void ImGui::LogButtons()
{
- ImGuiState& g = GImGui;
+ ImGuiState& g = *GImGui;
ImGui::PushID("LogButtons");
const bool log_to_tty = ImGui::Button("Log To TTY");
- ImGui::SameLine();
+ ImGui::SameLine();
const bool log_to_file = ImGui::Button("Log To File");
ImGui::SameLine();
const bool log_to_clipboard = ImGui::Button("Log To Clipboard");
@@ -3883,7 +4084,7 @@ void ImGui::LogButtons()
bool ImGui::CollapsingHeader(const char* label, const char* str_id, const bool display_frame, const bool default_open)
{
- ImGuiState& g = GImGui;
+ ImGuiState& g = *GImGui;
ImGuiWindow* window = GetCurrentWindow();
if (window->SkipItems)
return false;
@@ -3929,7 +4130,7 @@ bool ImGui::CollapsingHeader(const char* label, const char* str_id, const bool d
// When logging is enabled, if automatically expand tree nodes (but *NOT* collapsing headers.. seems like sensible behaviour).
// NB- If we are above max depth we still allow manually opened nodes to be logged.
- if (!display_frame)
+ if (!display_frame)
if (g.LogEnabled && window->DC.TreeDepth < g.LogAutoExpandMaxDepth)
opened = true;
@@ -3981,11 +4182,11 @@ bool ImGui::CollapsingHeader(const char* label, const char* str_id, const bool d
// Text with a little bullet aligned to the typical tree node.
void ImGui::BulletTextV(const char* fmt, va_list args)
{
- ImGuiState& g = GImGui;
+ ImGuiState& g = *GImGui;
ImGuiWindow* window = GetCurrentWindow();
if (window->SkipItems)
return;
-
+
const ImGuiStyle& style = g.Style;
static char buf[1024];
@@ -4142,7 +4343,7 @@ static void ApplyNumericalTextInput(const char* buf, float *v)
float ref_v = *v;
if (op)
- if (sscanf(GImGui.InputTextState.InitialText, "%f", &ref_v) < 1)
+ if (sscanf(GImGui->InputTextState.InitialText, "%f", &ref_v) < 1)
return;
float op_v = 0.0f;
@@ -4167,14 +4368,14 @@ static void ApplyNumericalTextInput(const char* buf, float *v)
// Adjust display_format to decorate the value with a prefix or a suffix.
bool ImGui::SliderFloat(const char* label, float* v, float v_min, float v_max, const char* display_format, float power)
{
- ImGuiState& g = GImGui;
+ ImGuiState& g = *GImGui;
ImGuiWindow* window = GetCurrentWindow();
if (window->SkipItems)
return false;
const ImGuiStyle& style = g.Style;
const ImGuiID id = window->GetID(label);
- const float w = window->DC.ItemWidth.back();
+ const float w = ImGui::CalcItemWidth();
if (!display_format)
display_format = "%.3f";
@@ -4303,7 +4504,7 @@ bool ImGui::SliderFloat(const char* label, float* v, float v_min, float v_max, c
if (!is_unbound)
{
const float normalized_pos = ImClamp((g.IO.MousePos.x - slider_effective_x1) / slider_effective_w, 0.0f, 1.0f);
-
+
// Linear slider
//float new_value = ImLerp(v_min, v_max, normalized_pos);
@@ -4407,13 +4608,13 @@ bool ImGui::SliderInt(const char* label, int* v, int v_min, int v_max, const cha
// Add multiple sliders on 1 line for compact edition of multiple components
static bool SliderFloatN(const char* label, float v[3], int components, float v_min, float v_max, const char* display_format, float power)
{
- ImGuiState& g = GImGui;
+ ImGuiState& g = *GImGui;
ImGuiWindow* window = GetCurrentWindow();
if (window->SkipItems)
return false;
const ImGuiStyle& style = g.Style;
- const float w_full = window->DC.ItemWidth.back();
+ const float w_full = ImGui::CalcItemWidth();
const float w_item_one = ImMax(1.0f, (float)(int)((w_full - (style.FramePadding.x*2.0f + style.ItemInnerSpacing.x)*(components-1)) / (float)components));
const float w_item_last = ImMax(1.0f, (float)(int)(w_full - (w_item_one + style.FramePadding.x*2.0f + style.ItemInnerSpacing.x)*(components-1)));
@@ -4457,13 +4658,13 @@ bool ImGui::SliderFloat4(const char* label, float v[4], float v_min, float v_max
static bool SliderIntN(const char* label, int v[3], int components, int v_min, int v_max, const char* display_format)
{
- ImGuiState& g = GImGui;
+ ImGuiState& g = *GImGui;
ImGuiWindow* window = GetCurrentWindow();
if (window->SkipItems)
return false;
const ImGuiStyle& style = g.Style;
- const float w_full = window->DC.ItemWidth.back();
+ const float w_full = ImGui::CalcItemWidth();
const float w_item_one = ImMax(1.0f, (float)(int)((w_full - (style.FramePadding.x*2.0f + style.ItemInnerSpacing.x)*(components-1)) / (float)components));
const float w_item_last = ImMax(1.0f, (float)(int)(w_full - (w_item_one + style.FramePadding.x*2.0f + style.ItemInnerSpacing.x)*(components-1)));
@@ -4513,7 +4714,7 @@ enum ImGuiPlotType
static void Plot(ImGuiPlotType plot_type, const char* label, float (*values_getter)(void* data, int idx), void* data, int values_count, int values_offset, const char* overlay_text, float scale_min, float scale_max, ImVec2 graph_size)
{
- ImGuiState& g = GImGui;
+ ImGuiState& g = *GImGui;
ImGuiWindow* window = GetCurrentWindow();
if (window->SkipItems)
return;
@@ -4522,7 +4723,7 @@ static void Plot(ImGuiPlotType plot_type, const char* label, float (*values_gett
const ImVec2 text_size = ImGui::CalcTextSize(label, NULL, true);
if (graph_size.x == 0.0f)
- graph_size.x = window->DC.ItemWidth.back();
+ graph_size.x = ImGui::CalcItemWidth();
if (graph_size.y == 0.0f)
graph_size.y = text_size.y;
@@ -4563,7 +4764,7 @@ static void Plot(ImGuiPlotType plot_type, const char* label, float (*values_gett
const float t = ImClamp((g.IO.MousePos.x - graph_bb.Min.x) / (graph_bb.Max.x - graph_bb.Min.x), 0.0f, 0.9999f);
const int v_idx = (int)(t * (values_count + ((plot_type == ImGuiPlotType_Lines) ? -1 : 0)));
IM_ASSERT(v_idx >= 0 && v_idx < values_count);
-
+
const float v0 = values_getter(data, (v_idx + values_offset) % values_count);
const float v1 = values_getter(data, (v_idx + 1 + values_offset) % values_count);
if (plot_type == ImGuiPlotType_Lines)
@@ -4646,7 +4847,7 @@ void ImGui::PlotHistogram(const char* label, float (*values_getter)(void* data,
bool ImGui::Checkbox(const char* label, bool* v)
{
- ImGuiState& g = GImGui;
+ ImGuiState& g = *GImGui;
ImGuiWindow* window = GetCurrentWindow();
if (window->SkipItems)
return false;
@@ -4704,7 +4905,7 @@ bool ImGui::CheckboxFlags(const char* label, unsigned int* flags, unsigned int f
bool ImGui::RadioButton(const char* label, bool active)
{
- ImGuiState& g = GImGui;
+ ImGuiState& g = *GImGui;
ImGuiWindow* window = GetCurrentWindow();
if (window->SkipItems)
return false;
@@ -4835,9 +5036,9 @@ namespace IMGUI_STB_NAMESPACE
#endif
void ImGuiTextEditState::OnKeyPressed(int key)
-{
- stb_textedit_key(this, &StbState, key);
- CursorAnimReset();
+{
+ stb_textedit_key(this, &StbState, key);
+ CursorAnimReset();
}
void ImGuiTextEditState::UpdateScrollOffset()
@@ -4846,7 +5047,7 @@ void ImGuiTextEditState::UpdateScrollOffset()
const float scroll_x_increment = Width * 0.25f;
const float cursor_offset_x = Font->CalcTextSizeW(FontSize, FLT_MAX, Text, Text+StbState.cursor, NULL).x;
if (ScrollX > cursor_offset_x)
- ScrollX = ImMax(0.0f, cursor_offset_x - scroll_x_increment);
+ ScrollX = ImMax(0.0f, cursor_offset_x - scroll_x_increment);
else if (ScrollX < cursor_offset_x - Width)
ScrollX = cursor_offset_x - Width + scroll_x_increment;
}
@@ -4902,7 +5103,7 @@ void ImGuiTextEditState::RenderTextScrolledClipped(ImFont* font, float font_size
const float clip_end = (text_end[0] != '\0' && text_end > text_start) ? symbol_w : 0.0f;
// Draw text
- RenderText(pos+ImVec2(clip_begin,0), text_start+(clip_begin>0.0f?1:0), text_end-(clip_end>0.0f?1:0), false);//, &text_params_with_clipping);
+ RenderText(pos+ImVec2(clip_begin,0), text_start+(clip_begin>0.0f?1:0), text_end-(clip_end>0.0f?1:0), false);
// Draw the clip symbol
const char s[2] = {symbol_c,'\0'};
@@ -4914,13 +5115,13 @@ void ImGuiTextEditState::RenderTextScrolledClipped(ImFont* font, float font_size
bool ImGui::InputFloat(const char* label, float *v, float step, float step_fast, int decimal_precision, ImGuiInputTextFlags extra_flags)
{
- ImGuiState& g = GImGui;
+ ImGuiState& g = *GImGui;
ImGuiWindow* window = GetCurrentWindow();
if (window->SkipItems)
return false;
const ImGuiStyle& style = g.Style;
- const float w = window->DC.ItemWidth.back();
+ const float w = ImGui::CalcItemWidth();
const ImVec2 text_size = CalcTextSize(label, NULL, true);
const ImGuiAabb frame_bb(window->DC.CursorPos, window->DC.CursorPos + ImVec2(w, text_size.y) + style.FramePadding*2.0f);
@@ -5026,6 +5227,9 @@ static bool InputTextFilterCharacter(ImWchar c, ImGuiInputTextFlags flags)
if (c < 128 && c != ' ' && !isprint((int)(c & 0xFF)))
return true;
+ if (c >= 0xE000 && c <= 0xF8FF) // Filter private Unicode range. I don't imagine anybody would want to input them. GLFW on OSX seems to send private characters for special keys like arrow keys.
+ return true;
+
if (flags & ImGuiInputTextFlags_CharsDecimal)
if (!(c >= '0' && c <= '9') && (c != '.') && (c != '-') && (c != '+') && (c != '*') && (c != '/'))
return true;
@@ -5040,7 +5244,7 @@ static bool InputTextFilterCharacter(ImWchar c, ImGuiInputTextFlags flags)
// Edit a string of text
bool ImGui::InputText(const char* label, char* buf, size_t buf_size, ImGuiInputTextFlags flags, void (*callback)(ImGuiTextEditCallbackData*), void* user_data)
{
- ImGuiState& g = GImGui;
+ ImGuiState& g = *GImGui;
ImGuiWindow* window = GetCurrentWindow();
if (window->SkipItems)
return false;
@@ -5049,7 +5253,7 @@ bool ImGui::InputText(const char* label, char* buf, size_t buf_size, ImGuiInputT
const ImGuiStyle& style = g.Style;
const ImGuiID id = window->GetID(label);
- const float w = window->DC.ItemWidth.back();
+ const float w = ImGui::CalcItemWidth();
const ImVec2 text_size = CalcTextSize(label, NULL, true);
const ImGuiAabb frame_bb(window->DC.CursorPos, window->DC.CursorPos + ImVec2(w, text_size.y) + style.FramePadding*2.0f);
@@ -5081,7 +5285,7 @@ bool ImGui::InputText(const char* label, char* buf, size_t buf_size, ImGuiInputT
ImTextStrFromUtf8(edit_state.Text, IM_ARRAYSIZE(edit_state.Text), buf, NULL);
edit_state.ScrollX = 0.0f;
edit_state.Width = w;
- stb_textedit_initialize_state(&edit_state.StbState, true);
+ stb_textedit_initialize_state(&edit_state.StbState, true);
edit_state.CursorAnimReset();
edit_state.LastCursorPos = ImVec2(-1.f,-1.f);
@@ -5110,7 +5314,7 @@ bool ImGui::InputText(const char* label, char* buf, size_t buf_size, ImGuiInputT
edit_state.BufSize = buf_size < IM_ARRAYSIZE(edit_state.Text) ? buf_size : IM_ARRAYSIZE(edit_state.Text);
edit_state.Font = window->Font();
edit_state.FontSize = window->FontSize();
-
+
const float mx = g.IO.MousePos.x - frame_bb.Min.x - style.FramePadding.x;
const float my = window->FontSize()*0.5f; // Flatten mouse because we are doing a single-line edit
@@ -5286,7 +5490,7 @@ bool ImGui::InputText(const char* label, char* buf, size_t buf_size, ImGuiInputT
}
}
}
-
+
RenderFrame(frame_bb.Min, frame_bb.Max, window->Color(ImGuiCol_FrameBg), true, style.FrameRounding);
const ImVec2 font_off_up = ImVec2(0.0f,window->FontSize()+1.0f); // FIXME: those offsets are part of the style or font API
@@ -5315,7 +5519,7 @@ bool ImGui::InputText(const char* label, char* buf, size_t buf_size, ImGuiInputT
// Draw blinking cursor
if (g.InputTextState.CursorIsVisible())
window->DrawList->AddRect(cursor_pos - font_off_up + ImVec2(0,2), cursor_pos + font_off_dn - ImVec2(0,3), window->Color(ImGuiCol_Text));
-
+
// Notify OS of text input position
if (io.ImeSetInputScreenPosFn && ImLengthSqr(edit_state.LastCursorPos - cursor_pos) > 0.0001f)
io.ImeSetInputScreenPosFn((int)cursor_pos.x - 1, (int)(cursor_pos.y - window->FontSize())); // -1 x offset so that Windows IME can cover our cursor. Bit of an extra nicety.
@@ -5333,13 +5537,13 @@ bool ImGui::InputText(const char* label, char* buf, size_t buf_size, ImGuiInputT
static bool InputFloatN(const char* label, float* v, int components, int decimal_precision)
{
- ImGuiState& g = GImGui;
+ ImGuiState& g = *GImGui;
ImGuiWindow* window = GetCurrentWindow();
if (window->SkipItems)
return false;
const ImGuiStyle& style = g.Style;
- const float w_full = window->DC.ItemWidth.back();
+ const float w_full = ImGui::CalcItemWidth();
const float w_item_one = ImMax(1.0f, (float)(int)((w_full - (style.FramePadding.x*2.0f + style.ItemInnerSpacing.x) * (components-1)) / (float)components));
const float w_item_last = ImMax(1.0f, (float)(int)(w_full - (w_item_one + style.FramePadding.x*2.0f + style.ItemInnerSpacing.x) * (components-1)));
@@ -5381,7 +5585,7 @@ bool ImGui::InputFloat4(const char* label, float v[4], int decimal_precision)
return InputFloatN(label, v, 4, decimal_precision);
}
-static bool Combo_ArrayGetter(void* data, int idx, const char** out_text)
+static bool Items_ArrayGetter(void* data, int idx, const char** out_text)
{
const char** items = (const char**)data;
if (out_text)
@@ -5389,16 +5593,9 @@ static bool Combo_ArrayGetter(void* data, int idx, const char** out_text)
return true;
}
-// Combo box helper allowing to pass an array of strings.
-bool ImGui::Combo(const char* label, int* current_item, const char** items, int items_count, int popup_height_items)
-{
- const bool value_changed = Combo(label, current_item, Combo_ArrayGetter, (void*)items, items_count, popup_height_items);
- return value_changed;
-}
-
-static bool Combo_StringListGetter(void* data, int idx, const char** out_text)
+static bool Items_SingleStringGetter(void* data, int idx, const char** out_text)
{
- // FIXME-OPT: we could precompute the indices to fasten this. But only 1 active combo means the waste is limited.
+ // FIXME-OPT: we could pre-compute the indices to fasten this. But only 1 active combo means the waste is limited.
const char* items_separated_by_zeros = (const char*)data;
int items_count = 0;
const char* p = items_separated_by_zeros;
@@ -5416,31 +5613,38 @@ static bool Combo_StringListGetter(void* data, int idx, const char** out_text)
return true;
}
+// Combo box helper allowing to pass an array of strings.
+bool ImGui::Combo(const char* label, int* current_item, const char** items, int items_count, int height_in_items)
+{
+ const bool value_changed = Combo(label, current_item, Items_ArrayGetter, (void*)items, items_count, height_in_items);
+ return value_changed;
+}
+
// Combo box helper allowing to pass all items in a single string.
-bool ImGui::Combo(const char* label, int* current_item, const char* items_separated_by_zeros, int popup_height_items)
+bool ImGui::Combo(const char* label, int* current_item, const char* items_separated_by_zeros, int height_in_items)
{
int items_count = 0;
- const char* p = items_separated_by_zeros;
+ const char* p = items_separated_by_zeros; // FIXME-OPT: Avoid computing this
while (*p)
{
p += strlen(p) + 1;
items_count++;
}
- bool value_changed = Combo(label, current_item, Combo_StringListGetter, (void*)items_separated_by_zeros, items_count, popup_height_items);
+ bool value_changed = Combo(label, current_item, Items_SingleStringGetter, (void*)items_separated_by_zeros, items_count, height_in_items);
return value_changed;
}
// Combo box function.
-bool ImGui::Combo(const char* label, int* current_item, bool (*items_getter)(void*, int, const char**), void* data, int items_count, int popup_height_items)
+bool ImGui::Combo(const char* label, int* current_item, bool (*items_getter)(void*, int, const char**), void* data, int items_count, int height_in_items)
{
- ImGuiState& g = GImGui;
+ ImGuiState& g = *GImGui;
ImGuiWindow* window = GetCurrentWindow();
if (window->SkipItems)
return false;
const ImGuiStyle& style = g.Style;
const ImGuiID id = window->GetID(label);
- const float w = window->DC.ItemWidth.back();
+ const float w = ImGui::CalcItemWidth();
const ImVec2 text_size = CalcTextSize(label, NULL, true);
const ImGuiAabb frame_bb(window->DC.CursorPos, window->DC.CursorPos + ImVec2(w, text_size.y) + style.FramePadding*2.0f);
@@ -5453,6 +5657,7 @@ bool ImGui::Combo(const char* label, int* current_item, bool (*items_getter)(voi
const bool hovered = IsHovered(frame_bb, id);
bool value_changed = false;
+ const ImGuiAabb value_bb(frame_bb.Min, frame_bb.Max - ImVec2(arrow_size, 0.0f));
RenderFrame(frame_bb.Min, frame_bb.Max, window->Color(ImGuiCol_FrameBg), true, style.FrameRounding);
RenderFrame(ImVec2(frame_bb.Max.x-arrow_size, frame_bb.Min.y), frame_bb.Max, window->Color(hovered ? ImGuiCol_ButtonHovered : ImGuiCol_Button), true, style.FrameRounding); // FIXME-ROUNDING
RenderCollapseTriangle(ImVec2(frame_bb.Max.x-arrow_size, frame_bb.Min.y) + style.FramePadding, true);
@@ -5461,7 +5666,7 @@ bool ImGui::Combo(const char* label, int* current_item, bool (*items_getter)(voi
{
const char* item_text;
if (items_getter(data, *current_item, &item_text))
- RenderText(frame_bb.Min + style.FramePadding, item_text, NULL, false);
+ RenderTextClipped(frame_bb.Min + style.FramePadding, item_text, NULL, NULL, value_bb.Max);
}
// Empty text doesn't add padding
@@ -5484,65 +5689,49 @@ bool ImGui::Combo(const char* label, int* current_item, bool (*items_getter)(voi
FocusWindow(window);
}
}
-
+
if (g.ActiveComboID == id)
{
+ // Size default to hold ~7 items
+ if (height_in_items < 0)
+ height_in_items = 7;
+
const ImVec2 backup_pos = ImGui::GetCursorPos();
const float popup_off_x = 0.0f;//style.ItemInnerSpacing.x;
- const float popup_height = (text_size.y + style.ItemSpacing.y) * ImMin(items_count, popup_height_items) + style.WindowPadding.y;
+ const float popup_height = (text_size.y + style.ItemSpacing.y) * ImMin(items_count, height_in_items) + style.WindowPadding.y;
const ImGuiAabb popup_aabb(ImVec2(frame_bb.Min.x+popup_off_x, frame_bb.Max.y), ImVec2(frame_bb.Max.x+popup_off_x, frame_bb.Max.y + popup_height));
ImGui::SetCursorPos(popup_aabb.Min - window->Pos);
const ImGuiWindowFlags flags = ImGuiWindowFlags_ComboBox | ((window->Flags & ImGuiWindowFlags_ShowBorders) ? ImGuiWindowFlags_ShowBorders : 0);
ImGui::BeginChild("#ComboBox", popup_aabb.GetSize(), false, flags);
- ImGuiWindow* child_window = GetCurrentWindow();
ImGui::Spacing();
bool combo_item_active = false;
- combo_item_active |= (g.ActiveId == child_window->GetID("#SCROLLY"));
+ combo_item_active |= (g.ActiveId == GetCurrentWindow()->GetID("#SCROLLY"));
// Display items
- for (int item_idx = 0; item_idx < items_count; item_idx++)
+ for (int i = 0; i < items_count; i++)
{
- const float item_h = child_window->FontSize();
- const float spacing_up = (float)(int)(style.ItemSpacing.y/2);
- const float spacing_dn = style.ItemSpacing.y - spacing_up;
- const ImGuiAabb item_aabb(ImVec2(popup_aabb.Min.x, child_window->DC.CursorPos.y - spacing_up), ImVec2(popup_aabb.Max.x, child_window->DC.CursorPos.y + item_h + spacing_dn));
- const ImGuiID item_id = child_window->GetID((void*)(intptr_t)item_idx);
-
- bool item_hovered, item_held;
- bool item_pressed = ButtonBehaviour(item_aabb, item_id, &item_hovered, &item_held, true);
- bool item_selected = (item_idx == *current_item);
-
- if (item_hovered || item_selected)
- {
- const ImU32 col = window->Color((item_held && item_hovered) ? ImGuiCol_HeaderActive : item_hovered ? ImGuiCol_HeaderHovered : ImGuiCol_Header);
- RenderFrame(item_aabb.Min, item_aabb.Max, col, false);
- }
-
+ ImGui::PushID((void*)(intptr_t)i);
+ const bool item_selected = (i == *current_item);
const char* item_text;
- if (!items_getter(data, item_idx, &item_text))
+ if (!items_getter(data, i, &item_text))
item_text = "*Unknown item*";
- ImGui::TextUnformatted(item_text);
-
- if (item_selected)
- {
- if (menu_toggled)
- ImGui::SetScrollPosHere();
- }
- if (item_pressed)
+ if (ImGui::Selectable(item_text, item_selected))
{
SetActiveId(0);
g.ActiveComboID = 0;
value_changed = true;
- *current_item = item_idx;
+ *current_item = i;
}
-
- combo_item_active |= (g.ActiveId == item_id);
+ if (item_selected && menu_toggled)
+ ImGui::SetScrollPosHere();
+ combo_item_active |= ImGui::IsItemActive();
+ ImGui::PopID();
}
ImGui::EndChild();
ImGui::SetCursorPos(backup_pos);
-
+
if (!combo_item_active && g.ActiveId != 0)
g.ActiveComboID = 0;
}
@@ -5552,10 +5741,146 @@ bool ImGui::Combo(const char* label, int* current_item, bool (*items_getter)(voi
return value_changed;
}
+// Tip: pass an empty label (e.g. "##dummy") then you can use the space to draw other text or image.
+// But you need to make sure the ID is unique, e.g. enclose calls in PushID/PopID.
+bool ImGui::Selectable(const char* label, bool selected, const ImVec2& size_arg)
+{
+ ImGuiState& g = *GImGui;
+ ImGuiWindow* window = GetCurrentWindow();
+ if (window->SkipItems)
+ return false;
+
+ const ImGuiStyle& style = g.Style;
+ const ImGuiID id = window->GetID(label);
+ const ImVec2 text_size = CalcTextSize(label, NULL, true);
+
+ const float w = window->Pos.x + ImGui::GetContentRegionMax().x - window->DC.CursorPos.x;
+ const ImVec2 size(size_arg.x != 0.0f ? size_arg.x : w, size_arg.y != 0.0f ? size_arg.y : text_size.y);
+ const ImGuiAabb bb(window->DC.CursorPos, window->DC.CursorPos + size);
+ ItemSize(bb);
+
+ // Selectables are meant to be tightly packed together. So for both rendering and collision we extend to compensate for spacing.
+ ImGuiAabb bb_with_spacing = bb;
+ const float spacing_L = (float)(int)(style.ItemSpacing.x * 0.5f);
+ const float spacing_U = (float)(int)(style.ItemSpacing.y * 0.5f);
+ const float spacing_R = style.ItemSpacing.x - spacing_L;
+ const float spacing_D = style.ItemSpacing.y - spacing_U;
+ bb_with_spacing.Min.x -= spacing_L;
+ bb_with_spacing.Min.y -= spacing_U;
+ bb_with_spacing.Max.x += spacing_R;
+ bb_with_spacing.Max.y += spacing_D;
+ if (!ItemAdd(bb_with_spacing, &id))
+ return false;
+
+ bool hovered, held;
+ bool pressed = ButtonBehaviour(bb_with_spacing, id, &hovered, &held, true, false, false);
+
+ // Render
+ if (hovered || selected)
+ {
+ const ImU32 col = window->Color((held && hovered) ? ImGuiCol_HeaderActive : hovered ? ImGuiCol_HeaderHovered : ImGuiCol_Header);
+ RenderFrame(bb_with_spacing.Min, bb_with_spacing.Max, col, false, style.FrameRounding);
+ }
+
+ //const ImVec2 off = ImVec2(ImMax(0.0f, size.x - text_size.x) * 0.5f, ImMax(0.0f, size.y - text_size.y) * 0.5f);
+ RenderTextClipped(bb.Min, label, NULL, &text_size, bb_with_spacing.Max);
+
+ return pressed;
+}
+
+bool ImGui::Selectable(const char* label, bool* p_selected, const ImVec2& size_arg)
+{
+ if (ImGui::Selectable(label, *p_selected, size_arg))
+ {
+ *p_selected = !*p_selected;
+ return true;
+ }
+ return false;
+}
+
+// Helper to calculate the size of a listbox and display a label on the right.
+// Tip: To have a list filling the entire window width, PushItemWidth(-1) and pass an empty label "##empty"
+bool ImGui::ListBoxHeader(const char* label, const ImVec2& size_arg)
+{
+ ImGuiWindow* window = GetCurrentWindow();
+ if (window->SkipItems)
+ return false;
+
+ const ImGuiStyle& style = ImGui::GetStyle();
+ const ImGuiID id = ImGui::GetID(label);
+ const ImVec2 label_size = ImGui::CalcTextSize(label, NULL, true);
+
+ // Size default to hold ~7 items. Fractional number of items helps seeing that we can scroll down/up without looking at scrollbar.
+ ImVec2 size;
+ size.x = (size_arg.x != 0.0f) ? size_arg.x : ImGui::CalcItemWidth() + style.FramePadding.x * 2.0f;
+ size.y = (size_arg.y != 0.0f) ? size_arg.y : ImGui::GetTextLineHeightWithSpacing() * 7.4f + style.ItemSpacing.y;
+ const ImVec2 frame_size = ImVec2(size.x, ImMax(size.y, label_size.y));
+ const ImGuiAabb frame_bb(window->DC.CursorPos, window->DC.CursorPos + frame_size);
+
+ if (label_size.x > 0)
+ RenderText(ImVec2(frame_bb.Max.x + style.ItemInnerSpacing.x, frame_bb.Min.y + style.FramePadding.y), label);
+
+ ImGui::BeginChildFrame(id, frame_bb.GetSize());
+ return true;
+}
+
+bool ImGui::ListBoxHeader(const char* label, int items_count, int height_in_items)
+{
+ // Size default to hold ~7 items. Fractional number of items helps seeing that we can scroll down/up without looking at scrollbar.
+ // However we don't add +0.40f if items_count <= height_in_items. It is slightly dodgy, because it means a dynamic list of items will make the widget resize occasionally when it crosses that size.
+ // I am expecting that someone will come and complain about this behavior in a remote future, then we can advise on a better solution.
+ if (height_in_items < 0)
+ height_in_items = ImMin(items_count, 7);
+ float height_in_items_f = height_in_items < items_count ? (height_in_items + 0.40f) : (height_in_items + 0.00f);
+
+ // We include ItemSpacing.y so that a list sized for the exact number of items doesn't make a scrollbar appears. We could also enforce that by passing a flag to BeginChild().
+ ImVec2 size;
+ size.x = 0.0f;
+ size.y = ImGui::GetTextLineHeightWithSpacing() * height_in_items_f + ImGui::GetStyle().ItemSpacing.y;
+ return ImGui::ListBoxHeader(label, size);
+}
+
+void ImGui::ListBoxFooter()
+{
+ ImGui::EndChildFrame();
+}
+
+bool ImGui::ListBox(const char* label, int* current_item, const char** items, int items_count, int height_items)
+{
+ const bool value_changed = ListBox(label, current_item, Items_ArrayGetter, (void*)items, items_count, height_items);
+ return value_changed;
+}
+
+bool ImGui::ListBox(const char* label, int* current_item, bool (*items_getter)(void*, int, const char**), void* data, int items_count, int height_in_items)
+{
+ if (!ImGui::ListBoxHeader(label, items_count, height_in_items))
+ return false;
+
+ bool value_changed = false;
+ for (int i = 0; i < items_count; i++)
+ {
+ const bool item_selected = (i == *current_item);
+ const char* item_text;
+ if (!items_getter(data, i, &item_text))
+ item_text = "*Unknown item*";
+
+ ImGui::PushID(i);
+ if (ImGui::Selectable(item_text, item_selected))
+ {
+ *current_item = i;
+ value_changed = true;
+ }
+ ImGui::PopID();
+ }
+
+ ImGui::ListBoxFooter();
+ return value_changed;
+}
+
// A little colored square. Return true when clicked.
bool ImGui::ColorButton(const ImVec4& col, bool small_height, bool outline_border)
{
- ImGuiState& g = GImGui;
+ ImGuiState& g = *GImGui;
ImGuiWindow* window = GetCurrentWindow();
if (window->SkipItems)
return false;
@@ -5602,14 +5927,14 @@ bool ImGui::ColorEdit3(const char* label, float col[3])
// Use CTRL-Click to input value and TAB to go to next item.
bool ImGui::ColorEdit4(const char* label, float col[4], bool alpha)
{
- ImGuiState& g = GImGui;
+ ImGuiState& g = *GImGui;
ImGuiWindow* window = GetCurrentWindow();
if (window->SkipItems)
return false;
const ImGuiStyle& style = g.Style;
const ImGuiID id = window->GetID(label);
- const float w_full = window->DC.ItemWidth.back();
+ const float w_full = ImGui::CalcItemWidth();
const float square_sz = (window->FontSize() + style.FramePadding.x * 2.0f);
ImGuiColorEditMode edit_mode = window->DC.ColorEditMode;
@@ -5681,7 +6006,7 @@ bool ImGui::ColorEdit4(const char* label, float col[4], bool alpha)
value_changed |= ImGui::InputText("##Text", buf, IM_ARRAYSIZE(buf), ImGuiInputTextFlags_CharsHexadecimal);
ImGui::PopItemWidth();
char* p = buf;
- while (*p == '#' || *p == ' ' || *p == '\t')
+ while (*p == '#' || *p == ' ' || *p == '\t')
p++;
// Treat at unsigned (%X is unsigned)
@@ -5785,7 +6110,7 @@ void ImGui::Spacing()
// Advance cursor given item size.
static void ItemSize(ImVec2 size, ImVec2* adjust_vertical_offset)
{
- ImGuiState& g = GImGui;
+ ImGuiState& g = *GImGui;
ImGuiWindow* window = GetCurrentWindow();
if (window->SkipItems)
return;
@@ -5804,14 +6129,14 @@ static void ItemSize(ImVec2 size, ImVec2* adjust_vertical_offset)
window->DC.CurrentLineHeight = 0.0f;
}
-static void ItemSize(const ImGuiAabb& aabb, ImVec2* adjust_start_offset)
-{
- ItemSize(aabb.GetSize(), adjust_start_offset);
+static void ItemSize(const ImGuiAabb& aabb, ImVec2* adjust_start_offset)
+{
+ ItemSize(aabb.GetSize(), adjust_start_offset);
}
static bool IsClipped(const ImGuiAabb& bb)
{
- ImGuiState& g = GImGui;
+ ImGuiState& g = *GImGui;
ImGuiWindow* window = GetCurrentWindow();
if (!bb.Overlaps(ImGuiAabb(window->ClipRectStack.back())) && !g.LogEnabled)
@@ -5846,11 +6171,11 @@ static bool ItemAdd(const ImGuiAabb& bb, const ImGuiID* id)
// spacing_w >= 0 : enforce spacing
void ImGui::SameLine(int column_x, int spacing_w)
{
- ImGuiState& g = GImGui;
+ ImGuiState& g = *GImGui;
ImGuiWindow* window = GetCurrentWindow();
if (window->SkipItems)
return;
-
+
float x, y;
if (column_x != 0)
{
@@ -5870,7 +6195,7 @@ void ImGui::SameLine(int column_x, int spacing_w)
void ImGui::NextColumn()
{
- ImGuiState& g = GImGui;
+ ImGuiState& g = *GImGui;
ImGuiWindow* window = GetCurrentWindow();
if (window->SkipItems)
return;
@@ -5900,9 +6225,10 @@ void ImGui::NextColumn()
}
}
+// FIMXE-OPT: This is called too often. We need to cache offset for active columns set.
float ImGui::GetColumnOffset(int column_index)
{
- ImGuiState& g = GImGui;
+ ImGuiState& g = *GImGui;
ImGuiWindow* window = GetCurrentWindow();
if (column_index < 0)
column_index = window->DC.ColumnsCurrent;
@@ -5918,7 +6244,7 @@ float ImGui::GetColumnOffset(int column_index)
void ImGui::SetColumnOffset(int column_index, float offset)
{
- ImGuiState& g = GImGui;
+ ImGuiState& g = *GImGui;
ImGuiWindow* window = GetCurrentWindow();
if (column_index < 0)
column_index = window->DC.ColumnsCurrent;
@@ -5951,7 +6277,7 @@ static void PushColumnClipRect(int column_index)
void ImGui::Columns(int columns_count, const char* id, bool border)
{
- ImGuiState& g = GImGui;
+ ImGuiState& g = *GImGui;
ImGuiWindow* window = GetCurrentWindow();
if (window->SkipItems)
return;
@@ -5975,7 +6301,7 @@ void ImGui::Columns(int columns_count, const char* id, bool border)
for (int i = 1; i < window->DC.ColumnsCount; i++)
{
float x = window->Pos.x + GetColumnOffset(i);
-
+
const ImGuiID column_id = window->DC.ColumnsSetID + ImGuiID(i);
const ImGuiAabb column_aabb(ImVec2(x-4,y1),ImVec2(x+4,y2));
@@ -6019,7 +6345,7 @@ void ImGui::Columns(int columns_count, const char* id, bool border)
void ImGui::TreePush(const char* str_id)
{
- ImGuiState& g = GImGui;
+ ImGuiState& g = *GImGui;
ImGuiWindow* window = GetCurrentWindow();
window->DC.ColumnsStartX += g.Style.TreeNodeSpacing;
window->DC.CursorPos.x = window->Pos.x + window->DC.ColumnsStartX + window->DC.ColumnsOffsetX;
@@ -6029,7 +6355,7 @@ void ImGui::TreePush(const char* str_id)
void ImGui::TreePush(const void* ptr_id)
{
- ImGuiState& g = GImGui;
+ ImGuiState& g = *GImGui;
ImGuiWindow* window = GetCurrentWindow();
window->DC.ColumnsStartX += g.Style.TreeNodeSpacing;
window->DC.CursorPos.x = window->Pos.x + window->DC.ColumnsStartX + window->DC.ColumnsOffsetX;
@@ -6039,7 +6365,7 @@ void ImGui::TreePush(const void* ptr_id)
void ImGui::TreePop()
{
- ImGuiState& g = GImGui;
+ ImGuiState& g = *GImGui;
ImGuiWindow* window = GetCurrentWindow();
window->DC.ColumnsStartX -= g.Style.TreeNodeSpacing;
window->DC.CursorPos.x = window->Pos.x + window->DC.ColumnsStartX + window->DC.ColumnsOffsetX;
@@ -6151,6 +6477,7 @@ void ImDrawList::UpdateClipRect()
}
}
+// Scissoring. The values in clip_rect are x1, y1, x2, y2.
void ImDrawList::PushClipRect(const ImVec4& clip_rect)
{
clip_rect_stack.push_back(clip_rect);
@@ -6206,7 +6533,7 @@ void ImDrawList::AddVtx(const ImVec2& pos, ImU32 col)
{
vtx_write->pos = pos;
vtx_write->col = col;
- vtx_write->uv = GImGui.FontTexUvWhitePixel;
+ vtx_write->uv = GImGui->FontTexUvWhitePixel;
vtx_write++;
}
@@ -6261,7 +6588,7 @@ void ImDrawList::AddArc(const ImVec2& center, float rad, ImU32 col, int a_min, i
}
circle_vtx_builds = true;
}
-
+
if (tris)
{
ReserveVertices((unsigned int)(a_max-a_min) * 3);
@@ -6341,7 +6668,7 @@ void ImDrawList::AddRectFilled(const ImVec2& a, const ImVec2& b, ImU32 col, floa
AddVtx(ImVec2(a.x+r,a.y), col);
AddVtx(ImVec2(b.x-r,b.y), col);
AddVtx(ImVec2(a.x+r,b.y), col);
-
+
float top_y = (rounding_corners & 1) ? a.y+r : a.y;
float bot_y = (rounding_corners & 8) ? b.y-r : b.y;
AddVtx(ImVec2(a.x,top_y), col);
@@ -6412,7 +6739,7 @@ void ImDrawList::AddCircleFilled(const ImVec2& centre, float radius, ImU32 col,
}
}
-void ImDrawList::AddText(ImFont* font, float font_size, const ImVec2& pos, ImU32 col, const char* text_begin, const char* text_end, float wrap_width)
+void ImDrawList::AddText(ImFont* font, float font_size, const ImVec2& pos, ImU32 col, const char* text_begin, const char* text_end, float wrap_width, const ImVec2* cpu_clip_max)
{
if ((col >> 24) == 0)
return;
@@ -6428,7 +6755,7 @@ void ImDrawList::AddText(ImFont* font, float font_size, const ImVec2& pos, ImU32
const size_t vtx_begin = vtx_buffer.size();
ReserveVertices(vtx_count_max);
- font->RenderText(font_size, pos, col, clip_rect_stack.back(), text_begin, text_end, vtx_write, wrap_width);
+ font->RenderText(font_size, pos, col, clip_rect_stack.back(), text_begin, text_end, vtx_write, wrap_width, cpu_clip_max);
// give back unused vertices
vtx_buffer.resize((size_t)(vtx_write - &vtx_buffer.front()));
@@ -6516,7 +6843,7 @@ void ImFontAtlas::ClearTexData()
void ImFontAtlas::Clear()
{
- ClearInputData();
+ ClearInputData();
ClearTexData();
for (size_t i = 0; i < Fonts.size(); i++)
{
@@ -6655,7 +6982,7 @@ bool ImFontAtlas::Build()
IM_ASSERT(data.OutFont && !data.OutFont->IsLoaded());
const int font_offset = stbtt_GetFontOffsetForIndex((unsigned char*)data.TTFData, data.FontNo);
IM_ASSERT(font_offset >= 0);
- if (!stbtt_InitFont(&data.FontInfo, (unsigned char*)data.TTFData, font_offset))
+ if (!stbtt_InitFont(&data.FontInfo, (unsigned char*)data.TTFData, font_offset))
return false;
if (!data.GlyphRanges)
@@ -6678,8 +7005,8 @@ bool ImFontAtlas::Build()
// Pack our extra data rectangle first, so it will be on the upper-left corner of our texture (UV will have small values).
stbrp_rect extra_rect;
- extra_rect.w = (int)TEX_ATLAS_SIZE.x;
- extra_rect.h = (int)TEX_ATLAS_SIZE.y;
+ extra_rect.w = (stbrp_coord)TEX_ATLAS_SIZE.x;
+ extra_rect.h = (stbrp_coord)TEX_ATLAS_SIZE.y;
stbrp_pack_rects((stbrp_context*)spc.pack_info, &extra_rect, 1);
TexExtraDataPos = ImVec2(extra_rect.x, extra_rect.y);
@@ -6900,7 +7227,7 @@ const ImWchar* ImFontAtlas::GetGlyphRangesJapanese()
{
// Store the 1946 ideograms code points as successive offsets from the initial unicode codepoint 0x4E00. Each offset has an implicit +1.
// This encoding helps us reduce the source code size.
- static const short offsets_from_0x4E00[] =
+ static const short offsets_from_0x4E00[] =
{
-1,0,1,3,0,0,0,0,1,0,5,1,1,0,7,4,6,10,0,1,9,9,7,1,3,19,1,10,7,1,0,1,0,5,1,0,6,4,2,6,0,0,12,6,8,0,3,5,0,1,0,9,0,0,8,1,1,3,4,5,13,0,0,8,2,17,
4,3,1,1,9,6,0,0,0,2,1,3,2,22,1,9,11,1,13,1,3,12,0,5,9,2,0,6,12,5,3,12,4,1,2,16,1,1,4,6,5,3,0,6,13,15,5,12,8,14,0,0,6,15,3,6,0,18,8,1,6,14,1,
@@ -6941,7 +7268,7 @@ const ImWchar* ImFontAtlas::GetGlyphRangesJapanese()
0x0020, 0x00FF, // Basic Latin + Latin Supplement
0x3040, 0x309F, // Hiragana, Katakana
0xFF00, 0xFFEF, // Half-width characters
- 0,
+ 0,
};
if (!ranges_unpacked)
{
@@ -7007,7 +7334,7 @@ static int ImTextCharFromUtf8(unsigned int* out_char, const char* in_text, const
*out_char = c;
return 1;
}
- if ((*str & 0xe0) == 0xc0)
+ if ((*str & 0xe0) == 0xc0)
{
if (in_text_end && in_text_end - (const char*)str < 2) return -1;
if (*str < 0xc2) return -1;
@@ -7017,7 +7344,7 @@ static int ImTextCharFromUtf8(unsigned int* out_char, const char* in_text, const
*out_char = c;
return 2;
}
- if ((*str & 0xf0) == 0xe0)
+ if ((*str & 0xf0) == 0xe0)
{
if (in_text_end && in_text_end - (const char*)str < 3) return -1;
if (*str == 0xe0 && (str[1] < 0xa0 || str[1] > 0xbf)) return -1;
@@ -7030,7 +7357,7 @@ static int ImTextCharFromUtf8(unsigned int* out_char, const char* in_text, const
*out_char = c;
return 3;
}
- if ((*str & 0xf8) == 0xf0)
+ if ((*str & 0xf8) == 0xf0)
{
if (in_text_end && in_text_end - (const char*)str < 4) return -1;
if (*str > 0xf4) return -1;
@@ -7088,13 +7415,13 @@ static int ImTextCharToUtf8(char* buf, size_t buf_size, unsigned int c)
{
size_t i = 0;
size_t n = buf_size;
- if (c < 0x80)
+ if (c < 0x80)
{
if (i+1 > n) return 0;
buf[i++] = (char)c;
return 1;
- }
- else if (c < 0x800)
+ }
+ else if (c < 0x800)
{
if (i+2 > n) return 0;
buf[i++] = (char)(0xc0 + (c >> 6));
@@ -7104,8 +7431,8 @@ static int ImTextCharToUtf8(char* buf, size_t buf_size, unsigned int c)
else if (c >= 0xdc00 && c < 0xe000)
{
return 0;
- }
- else if (c >= 0xd800 && c < 0xdc00)
+ }
+ else if (c >= 0xd800 && c < 0xdc00)
{
if (i+4 > n) return 0;
buf[i++] = (char)(0xf0 + (c >> 18));
@@ -7287,7 +7614,7 @@ ImVec2 ImFont::CalcTextSizeA(float size, float max_width, float wrap_width, cons
unsigned int c;
const int bytes_count = ImTextCharFromUtf8(&c, s, text_end);
s += bytes_count > 0 ? bytes_count : 1;
-
+
if (c == '\n')
{
text_size.x = ImMax(text_size.x, line_width);
@@ -7295,7 +7622,7 @@ ImVec2 ImFont::CalcTextSizeA(float size, float max_width, float wrap_width, cons
line_width = 0.0f;
continue;
}
-
+
float char_width = 0.0f;
if (const Glyph* glyph = FindGlyph((unsigned short)c))
char_width = glyph->XAdvance * scale;
@@ -7342,7 +7669,7 @@ ImVec2 ImFont::CalcTextSizeW(float size, float max_width, const ImWchar* text_be
line_width = 0.0f;
continue;
}
-
+
float char_width = 0.0f;
if (const Glyph* glyph = FindGlyph((unsigned short)c))
char_width = glyph->XAdvance * scale;
@@ -7366,7 +7693,7 @@ ImVec2 ImFont::CalcTextSizeW(float size, float max_width, const ImWchar* text_be
return text_size;
}
-void ImFont::RenderText(float size, ImVec2 pos, ImU32 col, const ImVec4& clip_rect_ref, const char* text_begin, const char* text_end, ImDrawVert*& out_vertices, float wrap_width) const
+void ImFont::RenderText(float size, ImVec2 pos, ImU32 col, const ImVec4& clip_rect_ref, const char* text_begin, const char* text_end, ImDrawVert*& out_vertices, float wrap_width, const ImVec2* cpu_clip_max) const
{
if (!text_end)
text_end = text_begin + strlen(text_begin);
@@ -7381,7 +7708,12 @@ void ImFont::RenderText(float size, ImVec2 pos, ImU32 col, const ImVec4& clip_re
const bool word_wrap_enabled = (wrap_width > 0.0f);
const char* word_wrap_eol = NULL;
- const ImVec4 clip_rect = clip_rect_ref;
+ ImVec4 clip_rect = clip_rect_ref;
+ if (cpu_clip_max)
+ {
+ clip_rect.z = ImMin(clip_rect.z, cpu_clip_max->x);
+ clip_rect.w = ImMin(clip_rect.w, cpu_clip_max->y);
+ }
float x = pos.x;
float y = pos.y;
@@ -7433,37 +7765,54 @@ void ImFont::RenderText(float size, ImVec2 pos, ImU32 col, const ImVec4& clip_re
if (c != ' ' && c != '\t')
{
// Clipping on Y is more likely
- const float y1 = (float)(y + glyph->YOffset * scale);
- const float y2 = (float)(y1 + glyph->Height * scale);
+ float y1 = (float)(y + glyph->YOffset * scale);
+ float y2 = (float)(y1 + glyph->Height * scale);
if (y1 <= clip_rect.w && y2 >= clip_rect.y)
{
- const float x1 = (float)(x + glyph->XOffset * scale);
- const float x2 = (float)(x1 + glyph->Width * scale);
+ float x1 = (float)(x + glyph->XOffset * scale);
+ float x2 = (float)(x1 + glyph->Width * scale);
if (x1 <= clip_rect.z && x2 >= clip_rect.x)
{
// Render a character
- const float u0 = glyph->U0;
- const float v0 = glyph->V0;
- const float u1 = glyph->U1;
- const float v1 = glyph->V1;
+ float u1 = glyph->U0;
+ float v1 = glyph->V0;
+ float u2 = glyph->U1;
+ float v2 = glyph->V1;
+
+ // CPU side clipping used to fit text in their frame when the frame is too small. Only does clipping for axis aligned quad and in the "max" direction (bottom-right)
+ if (cpu_clip_max)
+ {
+ if (x2 > cpu_clip_max->x)
+ {
+ const float clip_tx = (cpu_clip_max->x - x1) / (x2 - x1);
+ x2 = cpu_clip_max->x;
+ u2 = u1 + clip_tx * (u2 - u1);
+ }
+ if (y2 > cpu_clip_max->y)
+ {
+ const float clip_ty = (cpu_clip_max->y - y1) / (y2 - y1);
+ y2 = cpu_clip_max->y;
+ v2 = v1 + clip_ty * (v2 - v1);
+ }
+ }
out_vertices[0].pos = ImVec2(x1, y1);
- out_vertices[0].uv = ImVec2(u0, v0);
+ out_vertices[0].uv = ImVec2(u1, v1);
out_vertices[0].col = col;
out_vertices[1].pos = ImVec2(x2, y1);
- out_vertices[1].uv = ImVec2(u1, v0);
+ out_vertices[1].uv = ImVec2(u2, v1);
out_vertices[1].col = col;
out_vertices[2].pos = ImVec2(x2, y2);
- out_vertices[2].uv = ImVec2(u1, v1);
+ out_vertices[2].uv = ImVec2(u2, v2);
out_vertices[2].col = col;
out_vertices[3] = out_vertices[0];
out_vertices[4] = out_vertices[2];
out_vertices[5].pos = ImVec2(x1, y2);
- out_vertices[5].uv = ImVec2(u0, v1);
+ out_vertices[5].uv = ImVec2(u1, v2);
out_vertices[5].col = col;
out_vertices += 6;
@@ -7494,15 +7843,15 @@ static const char* GetClipboardTextFn_DefaultImpl()
ImGui::MemFree(buf_local);
buf_local = NULL;
}
- if (!OpenClipboard(NULL))
+ if (!OpenClipboard(NULL))
return NULL;
- HANDLE buf_handle = GetClipboardData(CF_TEXT);
+ HANDLE buf_handle = GetClipboardData(CF_TEXT);
if (buf_handle == NULL)
return NULL;
if (char* buf_global = (char*)GlobalLock(buf_handle))
buf_local = ImStrdup(buf_global);
- GlobalUnlock(buf_handle);
- CloseClipboard();
+ GlobalUnlock(buf_handle);
+ CloseClipboard();
return buf_local;
}
@@ -7513,13 +7862,13 @@ static void SetClipboardTextFn_DefaultImpl(const char* text)
return;
const char* text_end = text + strlen(text);
const int buf_length = (int)(text_end - text) + 1;
- HGLOBAL buf_handle = GlobalAlloc(GMEM_MOVEABLE, (SIZE_T)buf_length * sizeof(char));
+ HGLOBAL buf_handle = GlobalAlloc(GMEM_MOVEABLE, (SIZE_T)buf_length * sizeof(char));
if (buf_handle == NULL)
return;
- char* buf_global = (char *)GlobalLock(buf_handle);
+ char* buf_global = (char *)GlobalLock(buf_handle);
memcpy(buf_global, text, (size_t)(text_end - text));
buf_global[text_end - text] = 0;
- GlobalUnlock(buf_handle);
+ GlobalUnlock(buf_handle);
EmptyClipboard();
SetClipboardData(CF_TEXT, buf_handle);
CloseClipboard();
@@ -7530,21 +7879,22 @@ static void SetClipboardTextFn_DefaultImpl(const char* text)
// Local ImGui-only clipboard implementation, if user hasn't defined better clipboard handlers
static const char* GetClipboardTextFn_DefaultImpl()
{
- return GImGui.PrivateClipboard;
+ return GImGui->PrivateClipboard;
}
// Local ImGui-only clipboard implementation, if user hasn't defined better clipboard handlers
static void SetClipboardTextFn_DefaultImpl(const char* text)
{
- if (GImGui.PrivateClipboard)
+ ImGuiState& g = *GImGui;
+ if (g.PrivateClipboard)
{
- ImGui::MemFree(GImGui.PrivateClipboard);
- GImGui.PrivateClipboard = NULL;
+ ImGui::MemFree(g.PrivateClipboard);
+ g.PrivateClipboard = NULL;
}
const char* text_end = text + strlen(text);
- GImGui.PrivateClipboard = (char*)ImGui::MemAlloc((size_t)(text_end - text) + 1);
- memcpy(GImGui.PrivateClipboard, text, (size_t)(text_end - text));
- GImGui.PrivateClipboard[(size_t)(text_end - text)] = 0;
+ g.PrivateClipboard = (char*)ImGui::MemAlloc((size_t)(text_end - text) + 1);
+ memcpy(g.PrivateClipboard, text, (size_t)(text_end - text));
+ g.PrivateClipboard[(size_t)(text_end - text)] = 0;
}
#endif
@@ -7555,7 +7905,7 @@ static void SetClipboardTextFn_DefaultImpl(const char* text)
void ImGui::ShowUserGuide()
{
- ImGuiState& g = GImGui;
+ ImGuiState& g = *GImGui;
ImGui::BulletText("Double-click on title bar to collapse window.");
ImGui::BulletText("Click and drag on lower right corner to resize window.");
@@ -7579,7 +7929,7 @@ void ImGui::ShowUserGuide()
void ImGui::ShowStyleEditor(ImGuiStyle* ref)
{
- ImGuiState& g = GImGui;
+ ImGuiState& g = *GImGui;
ImGuiStyle& style = g.Style;
const ImGuiStyle def; // Default style
@@ -7600,6 +7950,7 @@ void ImGui::ShowStyleEditor(ImGuiStyle* ref)
ImGui::SliderFloat("Alpha", &style.Alpha, 0.20f, 1.0f, "%.2f"); // Not exposing zero here so user doesn't "lose" the UI. But application code could have a toggle to switch between zero and non-zero.
ImGui::SliderFloat2("WindowPadding", (float*)&style.WindowPadding, 0.0f, 20.0f, "%.0f");
ImGui::SliderFloat("WindowRounding", &style.WindowRounding, 0.0f, 16.0f, "%.0f");
+ ImGui::SliderFloat("ChildWindowRounding", &style.ChildWindowRounding, 0.0f, 16.0f, "%.0f");
ImGui::SliderFloat2("FramePadding", (float*)&style.FramePadding, 0.0f, 20.0f, "%.0f");
ImGui::SliderFloat("FrameRounding", &style.FrameRounding, 0.0f, 16.0f, "%.0f");
ImGui::SliderFloat2("ItemSpacing", (float*)&style.ItemSpacing, 0.0f, 20.0f, "%.0f");
@@ -7687,10 +8038,18 @@ void ImGui::ShowTestWindow(bool* opened)
static bool no_resize = false;
static bool no_move = false;
static bool no_scrollbar = false;
+ static bool no_collapse = false;
static float fill_alpha = 0.65f;
- const ImGuiWindowFlags layout_flags = (no_titlebar ? ImGuiWindowFlags_NoTitleBar : 0) | (no_border ? 0 : ImGuiWindowFlags_ShowBorders) | (no_resize ? ImGuiWindowFlags_NoResize : 0) | (no_move ? ImGuiWindowFlags_NoMove : 0) | (no_scrollbar ? ImGuiWindowFlags_NoScrollbar : 0);
- if (!ImGui::Begin("ImGui Test", opened, ImVec2(550,680), fill_alpha, layout_flags))
+ // Demonstrate the various window flags. Typically you would just use the default.
+ ImGuiWindowFlags window_flags = 0;
+ if (no_titlebar) window_flags |= ImGuiWindowFlags_NoTitleBar;
+ if (!no_border) window_flags |= ImGuiWindowFlags_ShowBorders;
+ if (no_resize) window_flags |= ImGuiWindowFlags_NoResize;
+ if (no_move) window_flags |= ImGuiWindowFlags_NoMove;
+ if (no_scrollbar) window_flags |= ImGuiWindowFlags_NoScrollbar;
+ if (no_collapse) window_flags |= ImGuiWindowFlags_NoCollapse;
+ if (!ImGui::Begin("ImGui Test", opened, ImVec2(550,680), fill_alpha, window_flags))
{
// Early out if the window is collapsed, as an optimization.
ImGui::End();
@@ -7701,6 +8060,8 @@ void ImGui::ShowTestWindow(bool* opened)
ImGui::Text("ImGui says hello.");
//ImGui::Text("MousePos (%g, %g)", ImGui::GetIO().MousePos.x, ImGui::GetIO().MousePos.y);
//ImGui::Text("MouseWheel %d", ImGui::GetIO().MouseWheel);
+ //ImGui::Text("WantCaptureMouse: %d", ImGui::GetIO().WantCaptureMouse);
+ //ImGui::Text("WantCaptureKeyboard: %d", ImGui::GetIO().WantCaptureKeyboard);
ImGui::Spacing();
if (ImGui::CollapsingHeader("Help"))
@@ -7713,9 +8074,10 @@ void ImGui::ShowTestWindow(bool* opened)
{
ImGui::Checkbox("no titlebar", &no_titlebar); ImGui::SameLine(150);
ImGui::Checkbox("no border", &no_border); ImGui::SameLine(300);
- ImGui::Checkbox("no resize", &no_resize);
+ ImGui::Checkbox("no resize", &no_resize);
ImGui::Checkbox("no move", &no_move); ImGui::SameLine(150);
- ImGui::Checkbox("no scrollbar", &no_scrollbar);
+ ImGui::Checkbox("no scrollbar", &no_scrollbar); ImGui::SameLine(300);
+ ImGui::Checkbox("no collapse", &no_collapse);
ImGui::SliderFloat("fill alpha", &fill_alpha, 0.0f, 1.0f);
if (ImGui::TreeNode("Style"))
@@ -7763,7 +8125,7 @@ void ImGui::ShowTestWindow(bool* opened)
if (ImGui::Button("Button")) { printf("Clicked\n"); a ^= 1; }
if (a)
{
- ImGui::SameLine();
+ ImGui::SameLine();
ImGui::Text("Thanks for clicking me!");
}
@@ -7841,6 +8203,16 @@ void ImGui::ShowTestWindow(bool* opened)
ImGui::TreePop();
}
+ if (ImGui::TreeNode("Clipping"))
+ {
+ static ImVec2 size(80, 20);
+ ImGui::TextWrapped("On a per-widget basis we are occasionally clipping text if it won't fit in its frame.");
+ ImGui::SliderFloat2("size", (float*)&size, 5.0f, 200.0f);
+ ImGui::Button("Line 1 hello\nLine 2 clip me!", size);
+ ImGui::TextWrapped("Otherwise we are doing coarser clipping + passing a scissor rectangle to the renderer. The system is designed to try minimizing both execution and rendering cost.");
+ ImGui::TreePop();
+ }
+
if (ImGui::TreeNode("Images"))
{
ImGui::TextWrapped("Below we are displaying the font texture (which is the only texture we have access to in this demo). Use the 'ImTextureID' type as storage to pass pointers or identifier to your own texture data. Hover the texture for a zoomed view!");
@@ -7878,6 +8250,47 @@ void ImGui::ShowTestWindow(bool* opened)
ImGui::TreePop();
}
+ if (ImGui::TreeNode("Selectables"))
+ {
+ if (ImGui::TreeNode("Basic"))
+ {
+ static bool selected[3] = { false, true, false };
+ ImGui::Selectable("1. I am selectable", &selected[0]);
+ ImGui::Selectable("2. I am selectable", &selected[1]);
+ ImGui::Text("3. I am normal text");
+ ImGui::Selectable("4. I am selectable", &selected[2]);
+ ImGui::TreePop();
+ }
+ if (ImGui::TreeNode("Rendering more text into the same block"))
+ {
+ static bool selected[3] = { false, false, false };
+ ImGui::Selectable("main.c", &selected[0]); ImGui::SameLine(300); ImGui::Text(" 2,345 bytes");
+ ImGui::Selectable("Hello.cpp", &selected[1]); ImGui::SameLine(300); ImGui::Text("12,345 bytes");
+ ImGui::Selectable("Hello.h", &selected[2]); ImGui::SameLine(300); ImGui::Text(" 2,345 bytes");
+ ImGui::TreePop();
+ }
+ if (ImGui::TreeNode("Grid"))
+ {
+ static bool selected[16] = { true, false, false, false, false, true, false, false, false, false, true, false, false, false, false, true };
+ for (int i = 0; i < 16; i++)
+ {
+ ImGui::PushID(i);
+ if (ImGui::Selectable("Me", &selected[i], ImVec2(50,50)))
+ {
+ int x = i % 4, y = i / 4;
+ if (x > 0) selected[i - 1] ^= 1;
+ if (x < 3) selected[i + 1] ^= 1;
+ if (y > 0) selected[i - 4] ^= 1;
+ if (y < 3) selected[i + 4] ^= 1;
+ }
+ if ((i % 4) < 3) ImGui::SameLine();
+ ImGui::PopID();
+ }
+ ImGui::TreePop();
+ }
+ ImGui::TreePop();
+ }
+
static bool check = true;
ImGui::Checkbox("checkbox", &check);
@@ -7974,6 +8387,14 @@ void ImGui::ShowTestWindow(bool* opened)
static float col2[4] = { 0.4f,0.7f,0.0f,0.5f };
ImGui::ColorEdit3("color 1", col1);
ImGui::ColorEdit4("color 2", col2);
+
+ const char* listbox_items[] = { "Apple", "Banana", "Cherry", "Kiwi", "Mango", "Orange", "Pineapple", "Strawberry", "Watermelon" };
+ static int listbox_item_current = 1;
+ ImGui::ListBox("listbox\n(single select)", &listbox_item_current, listbox_items, IM_ARRAYSIZE(listbox_items), 4);
+
+ //ImGui::PushItemWidth(-1);
+ //ImGui::ListBox("##listbox2", &listbox_item_current2, listbox_items, IM_ARRAYSIZE(listbox_items), 4);
+ //ImGui::PopItemWidth();
}
if (ImGui::CollapsingHeader("Graphs widgets"))
@@ -7982,19 +8403,19 @@ void ImGui::ShowTestWindow(bool* opened)
ImGui::PlotLines("Frame Times", arr, IM_ARRAYSIZE(arr));
static bool pause;
- static ImVector<float> values; if (values.empty()) { values.resize(100); memset(&values.front(), 0, values.size()*sizeof(float)); }
- static size_t values_offset = 0;
- if (!pause)
- {
+ static ImVector<float> values; if (values.empty()) { values.resize(100); memset(&values.front(), 0, values.size()*sizeof(float)); }
+ static size_t values_offset = 0;
+ if (!pause)
+ {
// create dummy data at fixed 60 hz rate
static float refresh_time = -1.0f;
if (ImGui::GetTime() > refresh_time + 1.0f/60.0f)
{
refresh_time = ImGui::GetTime();
static float phase = 0.0f;
- values[values_offset] = cosf(phase);
- values_offset = (values_offset+1)%values.size();
- phase += 0.10f*values_offset;
+ values[values_offset] = cosf(phase);
+ values_offset = (values_offset+1)%values.size();
+ phase += 0.10f*values_offset;
}
}
ImGui::PlotLines("Frame Times", &values.front(), (int)values.size(), (int)values_offset, "avg 0.0", -1.0f, 1.0f, ImVec2(0,70));
@@ -8049,7 +8470,7 @@ void ImGui::ShowTestWindow(bool* opened)
ImGui::Text("Without border");
static int line = 50;
bool goto_line = ImGui::Button("Goto");
- ImGui::SameLine();
+ ImGui::SameLine();
ImGui::PushItemWidth(100);
goto_line |= ImGui::InputInt("##Line", &line, 0, 0, ImGuiInputTextFlags_EnterReturnsTrue);
ImGui::PopItemWidth();
@@ -8066,6 +8487,7 @@ void ImGui::ShowTestWindow(bool* opened)
ImGui::SameLine();
+ ImGui::PushStyleVar(ImGuiStyleVar_ChildWindowRounding, 5.0f);
ImGui::BeginChild("Sub2", ImVec2(0,300), true);
ImGui::Text("With border");
ImGui::Columns(2);
@@ -8078,6 +8500,7 @@ void ImGui::ShowTestWindow(bool* opened)
ImGui::Button(buf);
}
ImGui::EndChild();
+ ImGui::PopStyleVar();
}
if (ImGui::CollapsingHeader("Columns"))
@@ -8111,17 +8534,17 @@ void ImGui::ShowTestWindow(bool* opened)
// Create multiple items in a same cell because switching to next column
static int e = 0;
- ImGui::Text("Hello");
+ ImGui::Text("Hello");
ImGui::Button("Banana");
- ImGui::RadioButton("radio a", &e, 0);
+ ImGui::RadioButton("radio a", &e, 0);
ImGui::NextColumn();
- ImGui::Text("ImGui");
+ ImGui::Text("ImGui");
ImGui::Button("Apple");
ImGui::RadioButton("radio b", &e, 1);
ImGui::Text("An extra line here.");
ImGui::NextColumn();
-
+
ImGui::Text("World!");
ImGui::Button("Corniflower");
ImGui::RadioButton("radio c", &e, 2);
@@ -8143,7 +8566,13 @@ void ImGui::ShowTestWindow(bool* opened)
ImGui::Columns(1);
ImGui::Separator();
-
+
+ ImGui::Columns(2, "tree items");
+ if (ImGui::TreeNode("Hello")) { ImGui::BulletText("World"); ImGui::TreePop(); } ImGui::NextColumn();
+ if (ImGui::TreeNode("Bonjour")) { ImGui::BulletText("Monde"); ImGui::TreePop(); }
+ ImGui::Columns(1);
+ ImGui::Separator();
+
ImGui::Columns(2, "word wrapping");
ImGui::TextWrapped("The quick brown fox jumps over the lazy dog.");
ImGui::Text("Hello Left");
@@ -8227,11 +8656,11 @@ void ImGui::ShowTestWindow(bool* opened)
bool focus_3 = ImGui::Button("Focus on 3");
int has_focus = 0;
static char buf[128] = "click on a button to set focus";
-
+
if (focus_1) ImGui::SetKeyboardFocusHere();
ImGui::InputText("1", buf, IM_ARRAYSIZE(buf));
if (ImGui::IsItemActive()) has_focus = 1;
-
+
if (focus_2) ImGui::SetKeyboardFocusHere();
ImGui::InputText("2", buf, IM_ARRAYSIZE(buf));
if (ImGui::IsItemActive()) has_focus = 2;
@@ -8243,7 +8672,7 @@ void ImGui::ShowTestWindow(bool* opened)
ImGui::PopAllowKeyboardFocus();
if (has_focus)
ImGui::Text("Item with focus: %d", has_focus);
- else
+ else
ImGui::Text("Item with focus: <none>");
ImGui::TreePop();
}
@@ -8304,7 +8733,7 @@ static void ShowExampleAppFixedOverlay(bool* opened)
ImGui::SetWindowPos(ImVec2(10,10));
ImGui::Text("Simple overlay\non the top-left side of the screen.");
ImGui::Separator();
- ImGui::Text("Mouse Position: (%.1f,%.1f)", ImGui::GetIO().MousePos.x, ImGui::GetIO().MousePos.y);
+ ImGui::Text("Mouse Position: (%.1f,%.1f)", ImGui::GetIO().MousePos.x, ImGui::GetIO().MousePos.y);
ImGui::End();
}
@@ -8333,7 +8762,7 @@ static void ShowExampleAppCustomRendering(bool* opened)
// Here we are using InvisibleButton() as a convenience to 1) advance the cursor and 2) allows us to use IsItemHovered()
// However you can draw directly and poll mouse/keyboard by yourself. You can manipulate the cursor using GetCursorPos() and SetCursorPos().
- // If you only use the ImDrawList API, you can notify the owner window of its extends by using SetCursorPos(max) followed by an empty Text("") statement.
+ // If you only use the ImDrawList API, you can notify the owner window of its extends by using SetCursorPos(max).
ImVec2 canvas_pos = ImGui::GetCursorScreenPos(); // ImDrawList API uses screen coordinates!
ImVec2 canvas_size = ImVec2(ImMax(50.0f,ImGui::GetWindowContentRegionMax().x-ImGui::GetCursorPos().x), ImMax(50.0f,ImGui::GetWindowContentRegionMax().y-ImGui::GetCursorPos().y)); // Resize canvas what's available
draw_list->AddRect(canvas_pos, ImVec2(canvas_pos.x + canvas_size.x, canvas_pos.y + canvas_size.y), 0xFFFFFFFF);
@@ -8391,14 +8820,14 @@ struct ExampleAppConsole
~ExampleAppConsole()
{
ClearLog();
- for (size_t i = 0; i < Items.size(); i++)
- ImGui::MemFree(History[i]);
+ for (size_t i = 0; i < Items.size(); i++)
+ ImGui::MemFree(History[i]);
}
void ClearLog()
{
- for (size_t i = 0; i < Items.size(); i++)
- ImGui::MemFree(Items[i]);
+ for (size_t i = 0; i < Items.size(); i++)
+ ImGui::MemFree(Items[i]);
Items.clear();
ScrollToBottom = true;
}
@@ -8428,8 +8857,8 @@ struct ExampleAppConsole
// TODO: display from bottom
// TODO: clip manually
- if (ImGui::SmallButton("Add Dummy Text")) AddLog("some text\nsome more text\ndisplay very important message here!\n"); ImGui::SameLine();
- if (ImGui::SmallButton("Add Dummy Error")) AddLog("[error] something went wrong"); ImGui::SameLine();
+ if (ImGui::SmallButton("Add Dummy Text")) { AddLog("%d some text", Items.size()); AddLog("some more text"); AddLog("display very important message here!"); } ImGui::SameLine();
+ if (ImGui::SmallButton("Add Dummy Error")) AddLog("[error] something went wrong"); ImGui::SameLine();
if (ImGui::SmallButton("Clear")) ClearLog();
ImGui::Separator();
@@ -8441,9 +8870,9 @@ struct ExampleAppConsole
ImGui::Separator();
// Display every line as a separate entry so we can change their color or add custom widgets. If you only want raw text you can use ImGui::TextUnformatted(log.begin(), log.end());
- // NB- if you have lots of text this approach may be too inefficient. You can seek and display only the lines that are on display using a technique similar to what TextUnformatted() does,
- // or faster if your entries are already stored into a table.
- ImGui::BeginChild("ScrollingRegion", ImVec2(0,-ImGui::GetTextLineSpacing()*2));
+ // NB- if you have thousands of entries this approach may be too inefficient. You can seek and display only the lines that are visible - CalcListClipping() is a helper to compute this information.
+ // If your items are of variable size you may want to implement code similar to what CalcListClipping() does. Or split your data into fixed height items to allow random-seeking into your list.
+ ImGui::BeginChild("ScrollingRegion", ImVec2(0,-ImGui::GetTextLineHeightWithSpacing()*2));
ImGui::PushStyleVar(ImGuiStyleVar_ItemSpacing, ImVec2(4,1)); // Tighten spacing
for (size_t i = 0; i < Items.size(); i++)
{
@@ -8637,9 +9066,11 @@ static void ShowExampleAppLongText(bool* opened)
return;
}
+ static int test_type = 0;
static ImGuiTextBuffer log;
static int lines = 0;
ImGui::Text("Printing unusually long amount of text.");
+ ImGui::Combo("Test type", &test_type, "Single call to TextUnformatted()\0Multiple calls to Text(), clipped manually\0Multiple calls to Text(), not clipped");
ImGui::Text("Buffer contents: %d lines, %d bytes", lines, log.size());
if (ImGui::Button("Clear")) { log.clear(); lines = 0; }
ImGui::SameLine();
@@ -8650,9 +9081,32 @@ static void ShowExampleAppLongText(bool* opened)
lines += 1000;
}
ImGui::BeginChild("Log");
- ImGui::TextUnformatted(log.begin(), log.end());
+ switch (test_type)
+ {
+ case 0:
+ // Single call to TextUnformatted() with a big buffer
+ ImGui::TextUnformatted(log.begin(), log.end());
+ break;
+ case 1:
+ // Multiple calls to Text(), manually coarsely clipped - demonstrate how to use the CalcListClipping() helper.
+ ImGui::PushStyleVar(ImGuiStyleVar_ItemSpacing, ImVec2(0,0));
+ int display_start, display_end;
+ ImGui::CalcListClipping(lines, ImGui::GetTextLineHeight(), &display_start, &display_end);
+ ImGui::SetCursorPosY(ImGui::GetCursorPosY() + (display_start) * ImGui::GetTextLineHeight());
+ for (int i = display_start; i < display_end; i++)
+ ImGui::Text("%i The quick brown fox jumps over the lazy dog\n", i);
+ ImGui::SetCursorPosY(ImGui::GetCursorPosY() + (lines - display_end) * ImGui::GetTextLineHeight());
+ ImGui::PopStyleVar();
+ break;
+ case 2:
+ // Multiple calls to Text(), not clipped
+ ImGui::PushStyleVar(ImGuiStyleVar_ItemSpacing, ImVec2(0,0));
+ for (int i = 0; i < lines; i++)
+ ImGui::Text("%i The quick brown fox jumps over the lazy dog\n", i);
+ ImGui::PopStyleVar();
+ break;
+ }
ImGui::EndChild();
-
ImGui::End();
}
@@ -8748,7 +9202,7 @@ static unsigned int stb_adler32(unsigned int adler32, unsigned char *buffer, uns
buflen -= blocklen;
blocklen = 5552;
}
- return (s2 << 16) + s1;
+ return (unsigned int)(s2 << 16) + (unsigned int)s1;
}
static unsigned int stb_decompress(unsigned char *output, unsigned char *i, unsigned int length)
@@ -8764,7 +9218,7 @@ static unsigned int stb_decompress(unsigned char *output, unsigned char *i, unsi
i += 16;
stb__dout = output;
- while (1) {
+ for (;;) {
unsigned char *old_i = i;
i = stb_decompress_token(i);
if (i == old_i) {
@@ -8779,7 +9233,7 @@ static unsigned int stb_decompress(unsigned char *output, unsigned char *i, unsi
return 0;
}
}
- assert(stb__dout <= output + olen);
+ assert(stb__dout <= output + olen);
if (stb__dout > output + olen)
return 0;
}
@@ -8788,206 +9242,206 @@ static unsigned int stb_decompress(unsigned char *output, unsigned char *i, unsi
static const unsigned int proggy_clean_ttf_compressed_size = 9583;
static const unsigned int proggy_clean_ttf_compressed_data[9584/4] =
{
- 0x0000bc57, 0x00000000, 0xf8a00000, 0x00000400, 0x00010037, 0x000c0000, 0x00030080, 0x2f534f40, 0x74eb8832, 0x01000090, 0x2c158248, 0x616d634e,
- 0x23120270, 0x03000075, 0x241382a0, 0x74766352, 0x82178220, 0xfc042102, 0x02380482, 0x66796c67, 0x5689af12, 0x04070000, 0x80920000, 0x64616568,
- 0xd36691d7, 0xcc201b82, 0x36210382, 0x27108268, 0xc3014208, 0x04010000, 0x243b0f82, 0x78746d68, 0x807e008a, 0x98010000, 0x06020000, 0x61636f6c,
- 0xd8b0738c, 0x82050000, 0x0402291e, 0x7078616d, 0xda00ae01, 0x28201f82, 0x202c1082, 0x656d616e, 0x96bb5925, 0x84990000, 0x9e2c1382, 0x74736f70,
- 0xef83aca6, 0x249b0000, 0xd22c3382, 0x70657270, 0x12010269, 0xf4040000, 0x08202f82, 0x012ecb84, 0x553c0000, 0x0f5fd5e9, 0x0300f53c, 0x00830008,
- 0x7767b722, 0x002b3f82, 0xa692bd00, 0xfe0000d7, 0x83800380, 0x21f1826f, 0x00850002, 0x41820120, 0x40fec026, 0x80030000, 0x05821083, 0x07830120,
- 0x0221038a, 0x24118200, 0x90000101, 0x82798200, 0x00022617, 0x00400008, 0x2009820a, 0x82098276, 0x82002006, 0x9001213b, 0x0223c883, 0x828a02bc,
- 0x858f2010, 0xc5012507, 0x00023200, 0x04210083, 0x91058309, 0x6c412b03, 0x40007374, 0xac200000, 0x00830008, 0x01000523, 0x834d8380, 0x80032103,
- 0x012101bf, 0x23b88280, 0x00800000, 0x0b830382, 0x07820120, 0x83800021, 0x88012001, 0x84002009, 0x2005870f, 0x870d8301, 0x2023901b, 0x83199501,
- 0x82002015, 0x84802000, 0x84238267, 0x88002027, 0x8561882d, 0x21058211, 0x13880000, 0x01800022, 0x05850d85, 0x0f828020, 0x03208384, 0x03200582,
- 0x47901b84, 0x1b850020, 0x1f821d82, 0x3f831d88, 0x3f410383, 0x84058405, 0x210982cd, 0x09830000, 0x03207789, 0xf38a1384, 0x01203782, 0x13872384,
- 0x0b88c983, 0x0d898f84, 0x00202982, 0x23900383, 0x87008021, 0x83df8301, 0x86118d03, 0x863f880d, 0x8f35880f, 0x2160820f, 0x04830300, 0x1c220382,
- 0x05820100, 0x4c000022, 0x09831182, 0x04001c24, 0x11823000, 0x0800082e, 0x00000200, 0xff007f00, 0xffffac20, 0x00220982, 0x09848100, 0xdf216682,
- 0x843586d5, 0x06012116, 0x04400684, 0xa58120d7, 0x00b127d8, 0x01b88d01, 0x2d8685ff, 0xc100c621, 0xf4be0801, 0x9e011c01, 0x88021402, 0x1403fc02,
- 0x9c035803, 0x1404de03, 0x50043204, 0xa2046204, 0x66051605, 0x1206bc05, 0xd6067406, 0x7e073807, 0x4e08ec07, 0x96086c08, 0x1009d008, 0x88094a09,
- 0x800a160a, 0x560b040b, 0x2e0cc80b, 0xea0c820c, 0xa40d5e0d, 0x500eea0d, 0x280f960e, 0x1210b00f, 0xe0107410, 0xb6115211, 0x6e120412, 0x4c13c412,
- 0xf613ac13, 0xae145814, 0x4015ea14, 0xa6158015, 0x1216b815, 0xc6167e16, 0x8e173417, 0x5618e017, 0xee18ba18, 0x96193619, 0x481ad419, 0xf01a9c1a,
- 0xc81b5c1b, 0x4c1c041c, 0xea1c961c, 0x921d2a1d, 0x401ed21d, 0xe01e8e1e, 0x761f241f, 0xa61fa61f, 0x01821020, 0x8a202e34, 0xc820b220, 0x74211421,
- 0xee219821, 0x86226222, 0x01820c23, 0x83238021, 0x23983c01, 0x24d823b0, 0x244a2400, 0x24902468, 0x250625ae, 0x25822560, 0x26f825f8, 0x82aa2658,
- 0xd8be0801, 0x9a274027, 0x68280a28, 0x0e29a828, 0xb8292029, 0x362af829, 0x602a602a, 0x2a2b022b, 0xac2b5e2b, 0x202ce62b, 0x9a2c342c, 0x5c2d282d,
- 0xaa2d782d, 0x262ee82d, 0x262fa62e, 0xf42fb62f, 0xc8305e30, 0xb4313e31, 0x9e321e32, 0x82331e33, 0x5c34ee33, 0x3a35ce34, 0xd4358635, 0x72362636,
- 0x7637e636, 0x3a38d837, 0x1239a638, 0xae397439, 0x9a3a2e3a, 0x7c3b063b, 0x3a3ce83b, 0x223d963c, 0xec3d863d, 0xc63e563e, 0x9a3f2a3f, 0x6a401240,
- 0x3641d040, 0x0842a241, 0x7a424042, 0xf042b842, 0xcc436243, 0x8a442a44, 0x5845ee44, 0xe245b645, 0xb4465446, 0x7a471447, 0x5448da47, 0x4049c648,
- 0x15462400, 0x034d0808, 0x0b000700, 0x13000f00, 0x1b001700, 0x23001f00, 0x2b002700, 0x33002f00, 0x3b003700, 0x43003f00, 0x4b004700, 0x53004f00,
- 0x5b005700, 0x63005f00, 0x6b006700, 0x73006f00, 0x7b007700, 0x83007f00, 0x8b008700, 0x00008f00, 0x15333511, 0x20039631, 0x20178205, 0xd3038221,
- 0x20739707, 0x25008580, 0x028080fc, 0x05be8080, 0x04204a85, 0x05ce0685, 0x0107002a, 0x02000080, 0x00000400, 0x250d8b41, 0x33350100, 0x03920715,
- 0x13820320, 0x858d0120, 0x0e8d0320, 0xff260d83, 0x00808000, 0x54820106, 0x04800223, 0x845b8c80, 0x41332059, 0x078b068f, 0x82000121, 0x82fe2039,
- 0x84802003, 0x83042004, 0x23598a0e, 0x00180000, 0x03210082, 0x42ab9080, 0x73942137, 0x2013bb41, 0x8f978205, 0x2027a39b, 0x20b68801, 0x84b286fd,
- 0x91c88407, 0x41032011, 0x11a51130, 0x15000027, 0x80ff8000, 0x11af4103, 0x841b0341, 0x8bd983fd, 0x9be99bc9, 0x8343831b, 0x21f1821f, 0xb58300ff,
- 0x0f84e889, 0xf78a0484, 0x8000ff22, 0x0020eeb3, 0x14200082, 0x2130ef41, 0xeb431300, 0x4133200a, 0xd7410ecb, 0x9a07200b, 0x2027871b, 0x21238221,
- 0xe7828080, 0xe784fd20, 0xe8848020, 0xfe808022, 0x08880d85, 0xba41fd20, 0x82248205, 0x85eab02a, 0x008022e7, 0x2cd74200, 0x44010021, 0xd34406eb,
- 0x44312013, 0xcf8b0eef, 0x0d422f8b, 0x82332007, 0x0001212f, 0x8023cf82, 0x83000180, 0x820583de, 0x830682d4, 0x820020d4, 0x82dc850a, 0x20e282e9,
- 0xb2ff85fe, 0x010327e9, 0x02000380, 0x0f440400, 0x0c634407, 0x68825982, 0x85048021, 0x260a825d, 0x010b0000, 0x4400ff00, 0x2746103f, 0x08d74209,
- 0x4d440720, 0x0eaf4406, 0xc3441d20, 0x23078406, 0xff800002, 0x04845b83, 0x8d05b241, 0x1781436f, 0x6b8c87a5, 0x1521878e, 0x06474505, 0x01210783,
- 0x84688c00, 0x8904828e, 0x441e8cf7, 0x0b270cff, 0x80008000, 0x45030003, 0xfb430fab, 0x080f4107, 0x410bf942, 0xd34307e5, 0x070d4207, 0x80800123,
- 0x205d85fe, 0x849183fe, 0x20128404, 0x82809702, 0x00002217, 0x41839a09, 0x6b4408cf, 0x0733440f, 0x3b460720, 0x82798707, 0x97802052, 0x0000296f,
- 0xff800004, 0x01800100, 0x0021ef89, 0x0a914625, 0x410a4d41, 0x00250ed4, 0x00050000, 0x056d4280, 0x210a7b46, 0x21481300, 0x46ed8512, 0x00210bd1,
- 0x89718202, 0x21738877, 0x2b850001, 0x00220582, 0x87450a00, 0x0ddb4606, 0x41079b42, 0x9d420c09, 0x0b09420b, 0x8d820720, 0x9742fc84, 0x42098909,
- 0x00241e0f, 0x00800014, 0x0b47da82, 0x0833442a, 0x49078d41, 0x2f450f13, 0x42278f17, 0x01200751, 0x22063742, 0x44808001, 0x20450519, 0x88068906,
- 0x83fe2019, 0x4203202a, 0x1a941a58, 0x00820020, 0xe7a40e20, 0x420ce146, 0x854307e9, 0x0fcb4713, 0xff20a182, 0xfe209b82, 0x0c867f8b, 0x0021aea4,
- 0x219fa40f, 0x7d41003b, 0x07194214, 0xbf440520, 0x071d4206, 0x6941a590, 0x80802309, 0x028900ff, 0xa9a4b685, 0xc5808021, 0x449b82ab, 0x152007eb,
- 0x42134d46, 0x61440a15, 0x051e4208, 0x222b0442, 0x47001100, 0xfd412913, 0x17194714, 0x410f5b41, 0x02220773, 0x09428080, 0x21a98208, 0xd4420001,
- 0x481c840d, 0x00232bc9, 0x42120000, 0xe74c261b, 0x149d4405, 0x07209d87, 0x410db944, 0x14421c81, 0x42fd2005, 0x80410bd2, 0x203d8531, 0x06874100,
- 0x48256f4a, 0xcb420c95, 0x13934113, 0x44075d44, 0x044c0855, 0x00ff2105, 0xfe228185, 0x45448000, 0x22c5b508, 0x410c0000, 0x7b412087, 0x1bb74514,
- 0x32429c85, 0x0a574805, 0x21208943, 0x8ba01300, 0x440dfb4e, 0x77431437, 0x245b4113, 0x200fb145, 0x41108ffe, 0x80203562, 0x00200082, 0x46362b42,
- 0x1742178d, 0x4527830f, 0x0f830b2f, 0x4a138146, 0x802409a1, 0xfe8000ff, 0x94419982, 0x09294320, 0x04000022, 0x49050f4f, 0xcb470a63, 0x48032008,
- 0x2b48067b, 0x85022008, 0x82638338, 0x00002209, 0x05af4806, 0x900e9f49, 0x84c5873f, 0x214285bd, 0x064900ff, 0x0c894607, 0x00000023, 0x4903820a,
- 0x714319f3, 0x0749410c, 0x8a07a145, 0x02152507, 0xfe808000, 0x74490386, 0x8080211b, 0x0c276f82, 0x00018000, 0x48028003, 0x2b2315db, 0x43002f00,
- 0x6f82142f, 0x44011521, 0x93510da7, 0x20e68508, 0x06494d80, 0x8e838020, 0x06821286, 0x124bff20, 0x25f3830c, 0x03800080, 0xe74a0380, 0x207b8715,
- 0x876b861d, 0x4a152007, 0x07870775, 0xf6876086, 0x8417674a, 0x0a0021f2, 0x431c9743, 0x8d421485, 0x200b830b, 0x06474d03, 0x71828020, 0x04510120,
- 0x42da8606, 0x1f831882, 0x001a0022, 0xff4d0082, 0x0b0f532c, 0x0d449b94, 0x4e312007, 0x074f12e7, 0x0bf3490b, 0xbb412120, 0x413f820a, 0xef490857,
- 0x80002313, 0xe2830001, 0x6441fc20, 0x8b802006, 0x00012108, 0xfd201582, 0x492c9b48, 0x802014ff, 0x51084347, 0x0f4327f3, 0x17bf4a14, 0x201b7944,
- 0x06964201, 0x134ffe20, 0x20d6830b, 0x25d78280, 0xfd800002, 0x05888000, 0x9318dc41, 0x21d282d4, 0xdb481800, 0x0dff542a, 0x45107743, 0xe14813f5,
- 0x0f034113, 0x83135d45, 0x47b28437, 0xe4510e73, 0x21f58e06, 0x2b8400fd, 0x1041fcac, 0x08db4b0b, 0x421fdb41, 0xdf4b18df, 0x011d210a, 0x420af350,
- 0x6e8308af, 0xac85cb86, 0x1e461082, 0x82b7a407, 0x411420a3, 0xa34130ab, 0x178f4124, 0x41139741, 0x86410d93, 0x82118511, 0x057243d8, 0x8941d9a4,
- 0x3093480c, 0x4a13474f, 0xfb5016a9, 0x07ad4108, 0x4a0f9d42, 0xfe200fad, 0x4708aa41, 0x83482dba, 0x288f4d06, 0xb398c3bb, 0x44267b41, 0xb34439d7,
- 0x0755410f, 0x200ebb45, 0x0f5f4215, 0x20191343, 0x06df5301, 0xf04c0220, 0x2ba64d07, 0x82050841, 0x430020ce, 0xa78f3627, 0x5213ff42, 0x2f970bc1,
- 0x4305ab55, 0xa084111b, 0x450bac45, 0x5f4238b8, 0x010c2106, 0x0220ed82, 0x441bb344, 0x875010af, 0x0737480f, 0x490c5747, 0x0c840c03, 0x4c204b42,
- 0x8ba905d7, 0x8b948793, 0x510c0c51, 0xfb4b24b9, 0x1b174107, 0x5709d74c, 0xd1410ca5, 0x079d480f, 0x201ff541, 0x06804780, 0x7d520120, 0x80002205,
- 0x20a983fe, 0x47bb83fe, 0x1b8409b4, 0x81580220, 0x4e00202c, 0x4f41282f, 0x0eab4f17, 0x57471520, 0x0e0f4808, 0x8221e041, 0x3e1b4a8b, 0x4407175d,
- 0x1b4b071f, 0x4a0f8b07, 0x174a0703, 0x0ba5411b, 0x430fb141, 0x0120057b, 0xfc20dd82, 0x4a056047, 0xf4850c0c, 0x01221982, 0x02828000, 0x1a5d088b,
- 0x20094108, 0x8c0e3941, 0x4900200e, 0x7744434f, 0x200b870b, 0x0e4b5a33, 0x2b41f78b, 0x8b138307, 0x0b9f450b, 0x2406f741, 0xfd808001, 0x09475a00,
- 0x84000121, 0x5980200e, 0x85450e5d, 0x832c8206, 0x4106831e, 0x00213814, 0x28b34810, 0x410c2f4b, 0x5f4a13d7, 0x0b2b4113, 0x6e43a883, 0x11174b05,
- 0x4b066a45, 0xcc470541, 0x5000202b, 0xcb472f4b, 0x44b59f0f, 0xc5430b5b, 0x0d654907, 0x21065544, 0xd6828080, 0xfe201982, 0x8230ec4a, 0x120025c2,
- 0x80ff8000, 0x4128d74d, 0x3320408b, 0x410a9f50, 0xdb822793, 0x822bd454, 0x61134b2e, 0x410b214a, 0xad4117c9, 0x0001211f, 0x4206854f, 0x4b430596,
- 0x06bb5530, 0x2025cf46, 0x0ddd5747, 0x500ea349, 0x0f840fa7, 0x5213c153, 0x634e08d1, 0x0bbe4809, 0x59316e4d, 0x5b50053f, 0x203f6323, 0x5117eb46,
- 0x94450a63, 0x246e410a, 0x63410020, 0x0bdb5f2f, 0x4233ab44, 0x39480757, 0x112d4a07, 0x7241118f, 0x000e2132, 0x9f286f41, 0x0f8762c3, 0x33350723,
- 0x094e6415, 0x2010925f, 0x067252fe, 0xd0438020, 0x63a68225, 0x11203a4f, 0x480e6360, 0x5748131f, 0x079b521f, 0x200e2f43, 0x864b8315, 0x113348e7,
- 0x85084e48, 0x06855008, 0x5880fd21, 0x7c420925, 0x0c414824, 0x37470c86, 0x1b8b422b, 0x5b0a8755, 0x23410c21, 0x0b83420b, 0x5a082047, 0xf482067f,
- 0xa80b4c47, 0x0c0021cf, 0x20207b42, 0x0fb74100, 0x420b8744, 0xeb43076f, 0x0f6f420b, 0x4261fe20, 0x439aa00c, 0x215034e3, 0x0ff9570f, 0x4b1f2d5d,
- 0x2d5d0c6f, 0x09634d0b, 0x1f51b8a0, 0x620f200c, 0xaf681e87, 0x24f94d07, 0x4e0f4945, 0xfe200c05, 0x22139742, 0x57048080, 0x23950c20, 0x97601585,
- 0x4813201f, 0xad620523, 0x200f8f0f, 0x9e638f15, 0x00002181, 0x41342341, 0x0f930f0b, 0x210b4b62, 0x978f0001, 0xfe200f84, 0x8425c863, 0x2704822b,
- 0x80000a00, 0x00038001, 0x610e9768, 0x834514bb, 0x0bc3430f, 0x2107e357, 0x80848080, 0x4400fe21, 0x2e410983, 0x00002a1a, 0x00000700, 0x800380ff,
- 0x0fdf5800, 0x59150021, 0xd142163d, 0x0c02410c, 0x01020025, 0x65800300, 0x00240853, 0x1d333501, 0x15220382, 0x35420001, 0x44002008, 0x376406d7,
- 0x096f6b19, 0x480bc142, 0x8f4908a7, 0x211f8b1f, 0x9e830001, 0x0584fe20, 0x4180fd21, 0x11850910, 0x8d198259, 0x000021d4, 0x5a08275d, 0x275d1983,
- 0x06d9420e, 0x9f08b36a, 0x0f7d47b5, 0x8d8a2f8b, 0x4c0e0b57, 0xe7410e17, 0x42d18c1a, 0xb351087a, 0x1ac36505, 0x4b4a2f20, 0x0b9f450d, 0x430beb53,
- 0xa7881015, 0xa5826a83, 0x80200f82, 0x86185a65, 0x4100208e, 0x176c3367, 0x0fe7650b, 0x4a17ad4b, 0x0f4217ed, 0x112e4206, 0x41113a42, 0xf7423169,
- 0x0cb34737, 0x560f8b46, 0xa75407e5, 0x5f01200f, 0x31590c48, 0x80802106, 0x42268841, 0x0020091e, 0x4207ef64, 0x69461df7, 0x138d4114, 0x820f5145,
- 0x53802090, 0xff200529, 0xb944b183, 0x417e8505, 0x00202561, 0x15210082, 0x42378200, 0x9b431cc3, 0x004f220d, 0x0dd54253, 0x4213f149, 0x7d41133b,
- 0x42c9870b, 0x802010f9, 0x420b2c42, 0x8f441138, 0x267c4408, 0x600cb743, 0x8f4109d3, 0x05ab701d, 0x83440020, 0x3521223f, 0x0b794733, 0xfb62fe20,
- 0x4afd2010, 0xaf410ae7, 0x25ce8525, 0x01080000, 0x7b6b0000, 0x0973710b, 0x82010021, 0x49038375, 0x33420767, 0x052c4212, 0x58464b85, 0x41fe2005,
- 0x50440c27, 0x000c2209, 0x1cb36b80, 0x9b06df44, 0x0f93566f, 0x52830220, 0xfe216e8d, 0x200f8200, 0x0fb86704, 0xb057238d, 0x050b5305, 0x7217eb47,
- 0xbd410b6b, 0x0f214610, 0x871f9956, 0x1e91567e, 0x2029b741, 0x20008200, 0x18b7410a, 0x27002322, 0x41095543, 0x0f8f0fb3, 0x41000121, 0x889d111c,
- 0x14207b82, 0x00200382, 0x73188761, 0x475013a7, 0x6e33200c, 0x234e0ea3, 0x9b138313, 0x08e54d17, 0x9711094e, 0x2ee74311, 0x4908875e, 0xd75d1f1f,
- 0x19ab5238, 0xa2084d48, 0x63a7a9b3, 0x55450b83, 0x0fd74213, 0x440d814c, 0x4f481673, 0x05714323, 0x13000022, 0x412e1f46, 0xdf493459, 0x21c7550f,
- 0x8408215f, 0x201d49cb, 0xb1103043, 0x0f0d65d7, 0x452b8d41, 0x594b0f8d, 0x0b004605, 0xb215eb46, 0x000a24d7, 0x47000080, 0x002118cf, 0x06436413,
- 0x420bd750, 0x2b500743, 0x076a470c, 0x4105c050, 0xd942053f, 0x0d00211a, 0x5f44779c, 0x0ce94805, 0x51558186, 0x14a54c0b, 0x49082b41, 0x0a4b0888,
- 0x8080261f, 0x0d000000, 0x20048201, 0x1deb6a03, 0x420cb372, 0x07201783, 0x4306854d, 0x8b830c59, 0x59093c74, 0x0020250f, 0x67070f4a, 0x2341160b,
- 0x00372105, 0x431c515d, 0x554e17ef, 0x0e5d6b05, 0x41115442, 0xb74a1ac1, 0x2243420a, 0x5b4f878f, 0x7507200f, 0x384b086f, 0x09d45409, 0x0020869a,
- 0x12200082, 0xab460382, 0x10075329, 0x54138346, 0xaf540fbf, 0x1ea75413, 0x9a0c9e54, 0x0f6b44c1, 0x41000021, 0x47412a4f, 0x07374907, 0x5310bf76,
- 0xff2009b4, 0x9a09a64c, 0x8200208d, 0x34c34500, 0x970fe141, 0x1fd74b0f, 0x440a3850, 0x206411f0, 0x27934609, 0x470c5d41, 0x555c2947, 0x1787540f,
- 0x6e0f234e, 0x7d540a1b, 0x1d736b08, 0x0026a088, 0x80000e00, 0x9b5200ff, 0x08ef4318, 0x450bff77, 0x1d4d0b83, 0x081f7006, 0xcb691b86, 0x4b022008,
- 0xc34b0b33, 0x1d0d4a0c, 0x8025a188, 0x0b000000, 0x52a38201, 0xbf7d0873, 0x0c234511, 0x8f0f894a, 0x4101200f, 0x0c880c9d, 0x2b418ea1, 0x06c74128,
- 0x66181341, 0x7b4c0bb9, 0x0c06630b, 0xfe200c87, 0x9ba10882, 0x27091765, 0x01000008, 0x02800380, 0x48113f4e, 0x29430cf5, 0x09a75a0b, 0x31618020,
- 0x6d802009, 0x61840e33, 0x8208bf51, 0x0c637d61, 0x7f092379, 0x4f470f4b, 0x1797510c, 0x46076157, 0xf5500fdf, 0x0f616910, 0x1171fe20, 0x82802006,
- 0x08696908, 0x41127a4c, 0x3f4a15f3, 0x01042607, 0x0200ff00, 0x1cf77700, 0xff204185, 0x00235b8d, 0x43100000, 0x3b22243f, 0x3b4d3f00, 0x0b937709,
- 0xad42f18f, 0x0b1f420f, 0x51084b43, 0x8020104a, 0xb557ff83, 0x052b7f2a, 0x0280ff22, 0x250beb78, 0x00170013, 0xbf6d2500, 0x07db760e, 0x410e2b7f,
- 0x00230e4f, 0x49030000, 0x0582055b, 0x07000326, 0x00000b00, 0x580bcd46, 0x00200cdd, 0x57078749, 0x8749160f, 0x0f994f0a, 0x41134761, 0x01200b31,
- 0xeb796883, 0x0b41500b, 0x0e90b38e, 0x202e7b51, 0x05d95801, 0x41080570, 0x1d530fc9, 0x0b937a0f, 0xaf8eb387, 0xf743b98f, 0x07c74227, 0x80000523,
- 0x0fcb4503, 0x430ca37b, 0x7782077f, 0x8d0a9947, 0x08af4666, 0xeb798020, 0x6459881e, 0xc3740bbf, 0x0feb6f0b, 0x20072748, 0x052b6102, 0x435e0584,
- 0x7d088308, 0x03200afd, 0x92109e41, 0x28aa8210, 0x80001500, 0x80030000, 0x0fdb5805, 0x209f4018, 0xa7418d87, 0x0aa3440f, 0x20314961, 0x073a52ff,
- 0x6108505d, 0x43181051, 0x00223457, 0xe7820500, 0x50028021, 0x81410d33, 0x063d7108, 0xdb41af84, 0x4d888205, 0x00201198, 0x463d835f, 0x152106d7,
- 0x0a355a33, 0x6917614e, 0x75411f4d, 0x184b8b07, 0x1809c344, 0x21091640, 0x0b828000, 0x42808021, 0x26790519, 0x86058605, 0x2428422d, 0x22123b42,
- 0x42000080, 0xf587513b, 0x7813677b, 0xaf4d139f, 0x00ff210c, 0x5e0a1d57, 0x3b421546, 0x01032736, 0x02000380, 0x41180480, 0x2f420f07, 0x0c624807,
- 0x00000025, 0x18000103, 0x83153741, 0x430120c3, 0x042106b2, 0x088d4d00, 0x2f830620, 0x1810434a, 0x18140345, 0x8507fb41, 0x5ee582ea, 0x0023116c,
- 0x8d000600, 0x053b56af, 0xa6554fa2, 0x0d704608, 0x40180d20, 0x47181a43, 0xd37b07ff, 0x0b79500c, 0x420fd745, 0x47450bd9, 0x8471830a, 0x095a777e,
- 0x84137542, 0x82002013, 0x2f401800, 0x0007213b, 0x4405e349, 0x0d550ff3, 0x16254c0c, 0x820ffe4a, 0x0400218a, 0x89066f41, 0x106b414f, 0xc84d0120,
- 0x80802206, 0x0c9a4b03, 0x00100025, 0x68000200, 0x9d8c2473, 0x44134344, 0xf36a0f33, 0x4678860f, 0x1b440a25, 0x41988c0a, 0x80201879, 0x43079b5e,
- 0x4a18080b, 0x0341190b, 0x1259530c, 0x43251552, 0x908205c8, 0x0cac4018, 0x86000421, 0x0e504aa2, 0x0020b891, 0xfb450082, 0x51132014, 0x8f5205f3,
- 0x35052108, 0x8505cb59, 0x0f6d4f70, 0x82150021, 0x29af5047, 0x4f004b24, 0x75795300, 0x1b595709, 0x460b6742, 0xbf4b0f0d, 0x5743870b, 0xcb6d1461,
- 0x08f64505, 0x4e05ab6c, 0x334126c3, 0x0bcb6b0d, 0x1811034d, 0x4111ef4b, 0x814f1ce5, 0x20af8227, 0x07fd7b80, 0x41188e84, 0xef410f33, 0x80802429,
- 0x410d0000, 0xa34205ab, 0x76b7881c, 0xff500b89, 0x0741430f, 0x20086f4a, 0x209d8200, 0x234c18fd, 0x05d4670a, 0x4509af51, 0x9642078d, 0x189e831d,
- 0x7c1cc74b, 0xcd4c07b9, 0x0e7c440f, 0x8b7b0320, 0x21108210, 0xc76c8080, 0x03002106, 0x6b23bf41, 0xc549060b, 0x7946180b, 0x0ff7530f, 0x17ad4618,
- 0x200ecd45, 0x208c83fd, 0x5e0488fe, 0x032009c6, 0x420d044e, 0x0d8f0d7f, 0x00820020, 0x18001021, 0x6d273b45, 0xfd4c0c93, 0xcf451813, 0x0fe5450f,
- 0x5a47c382, 0x820a8b0a, 0x282b4998, 0x410a8b5b, 0x4b232583, 0x54004f00, 0x978f0ce3, 0x500f1944, 0xa95f1709, 0x0280220b, 0x05ba7080, 0xa1530682,
- 0x06324c13, 0x91412582, 0x05536e2c, 0x63431020, 0x0f434706, 0x8c11374c, 0x176143d7, 0x4d0f454c, 0xd3680bed, 0x0bee4d17, 0x212b9a41, 0x0f530a00,
- 0x140d531c, 0x43139143, 0x95610e8d, 0x0f094415, 0x4205fb56, 0x1b4205cf, 0x17015225, 0x5e0c477f, 0xaf6e0aeb, 0x0ff36218, 0x04849a84, 0x0a454218,
- 0x9c430420, 0x23c6822b, 0x04000102, 0x45091b4b, 0xf05f0955, 0x82802007, 0x421c2023, 0x5218282b, 0x7b53173f, 0x0fe7480c, 0x74173b7f, 0x47751317,
- 0x634d1807, 0x0f6f430f, 0x24086547, 0xfc808002, 0x0b3c7f80, 0x10840120, 0x188d1282, 0x20096b43, 0x0fc24403, 0x00260faf, 0x0180000b, 0x3f500280,
- 0x18002019, 0x450b4941, 0xf3530fb9, 0x18002010, 0x8208a551, 0x06234d56, 0xcb58a39b, 0xc3421805, 0x1313461e, 0x0f855018, 0xd34b0120, 0x6cfe2008,
- 0x574f0885, 0x09204114, 0x07000029, 0x00008000, 0x44028002, 0x01420f57, 0x10c95c10, 0x11184c18, 0x80221185, 0x7f421e00, 0x00732240, 0x09cd4977,
- 0x6d0b2b42, 0x4f180f8f, 0x8f5a0bcb, 0x9b0f830f, 0x0fb9411f, 0x230b5756, 0x00fd8080, 0x82060745, 0x000121d5, 0x8e0fb277, 0x4a8d4211, 0x24061c53,
- 0x04000007, 0x12275280, 0x430c954c, 0x80201545, 0x200f764f, 0x20008200, 0x20ce8308, 0x09534f02, 0x660edf64, 0x73731771, 0xe7411807, 0x20a2820c,
- 0x13b64404, 0x8f5d6682, 0x1d6b4508, 0x0cff4d18, 0x3348c58f, 0x0fc34c07, 0x31558b84, 0x8398820f, 0x17514712, 0x240b0e46, 0x80000a00, 0x093b4502,
- 0x420f9759, 0xa54c0bf1, 0x0f2b470c, 0x410d314b, 0x2584170c, 0x73b30020, 0xb55fe782, 0x204d8410, 0x08e043fe, 0x4f147e41, 0x022008ab, 0x4b055159,
- 0x2950068f, 0x00022208, 0x48511880, 0x82002009, 0x00112300, 0x634dff00, 0x24415f27, 0x180f6d43, 0x4d0b5d45, 0x4d5f05ef, 0x01802317, 0x56188000,
- 0xa7840807, 0xc6450220, 0x21ca8229, 0x4b781a00, 0x3359182c, 0x0cf3470f, 0x180bef46, 0x420b0354, 0xff470b07, 0x4515200a, 0x9758239b, 0x4a80200c,
- 0xd2410a26, 0x05fb4a08, 0x4b05e241, 0x03200dc9, 0x92290941, 0x00002829, 0x00010900, 0x5b020001, 0x23201363, 0x460d776a, 0xef530fdb, 0x209a890c,
- 0x13fc4302, 0x00008024, 0xc4820104, 0x08820220, 0x20086b5b, 0x18518700, 0x8408d349, 0x0da449a1, 0x00080024, 0x7b690280, 0x4c438b1a, 0x01220f63,
- 0x4c878000, 0x5c149c53, 0xfb430868, 0x2f56181e, 0x0ccf7b1b, 0x0f075618, 0x2008e347, 0x14144104, 0x00207f83, 0x00207b82, 0x201adf47, 0x16c35a13,
- 0x540fdf47, 0x802006c8, 0x5418f185, 0x29430995, 0x00002419, 0x58001600, 0x5720316f, 0x4d051542, 0x4b7b1b03, 0x138f4707, 0xb747b787, 0x4aab8213,
- 0x058305fc, 0x20115759, 0x82128401, 0x0a0b44e8, 0x46800121, 0xe64210d0, 0x82129312, 0x4bffdffe, 0x3b41171b, 0x9b27870f, 0x808022ff, 0x085c68fe,
- 0x41800021, 0x01410b20, 0x001a213a, 0x47480082, 0x11374e12, 0x56130b4c, 0xdf4b0c65, 0x0b0f590b, 0x0f574c18, 0x830feb4b, 0x075f480f, 0x480b4755,
- 0x40490b73, 0x80012206, 0x09d74280, 0x80fe8022, 0x80210e86, 0x056643ff, 0x10820020, 0x420b2646, 0x0b58391a, 0xd74c1808, 0x078b4e22, 0x2007f55f,
- 0x4b491807, 0x83802017, 0x65aa82a7, 0x3152099e, 0x068b7616, 0x9b431220, 0x09bb742c, 0x500e376c, 0x8342179b, 0x0a4d5d0f, 0x8020a883, 0x180cd349,
- 0x2016bb4b, 0x14476004, 0x84136c43, 0x08cf7813, 0x4f4c0520, 0x156f420f, 0x20085f42, 0x6fd3be03, 0xd4d30803, 0xa7411420, 0x004b222c, 0x0d3b614f,
- 0x3f702120, 0x1393410a, 0x8f132745, 0x47421827, 0x41e08209, 0xb05e2bb9, 0x18b7410c, 0x18082647, 0x4107a748, 0xeb8826bf, 0x0ca76018, 0x733ecb41,
- 0xd0410d83, 0x43ebaf2a, 0x0420067f, 0x721dab4c, 0x472005bb, 0x4105d341, 0x334844cb, 0x20dba408, 0x47d6ac00, 0x034e3aef, 0x0f8f421b, 0x930f134d,
- 0x3521231f, 0xb7421533, 0x42f5ad0a, 0x1e961eaa, 0x17000022, 0x4c367b50, 0x7d491001, 0x0bf5520f, 0x4c18fda7, 0xb8460c55, 0x83fe2005, 0x00fe25b9,
- 0x80000180, 0x9e751085, 0x261b5c12, 0x82110341, 0x001123fb, 0x4518fe80, 0xf38c2753, 0x6d134979, 0x295107a7, 0xaf5f180f, 0x0fe3660c, 0x180b6079,
- 0x2007bd5f, 0x9aab9103, 0x2f4d1811, 0x05002109, 0x44254746, 0x1d200787, 0x450bab75, 0x4f180f57, 0x4f181361, 0x3b831795, 0xeb4b0120, 0x0b734805,
- 0x84078f48, 0x2e1b47bc, 0x00203383, 0xaf065f45, 0x831520d7, 0x130f51a7, 0x1797bf97, 0x2b47d783, 0x18fe2005, 0x4a18a44f, 0xa64d086d, 0x1ab0410d,
- 0x6205a258, 0xdbab069f, 0x4f06f778, 0xa963081d, 0x133b670a, 0x8323d141, 0x13195b23, 0x530f5e70, 0xe5ad0824, 0x58001421, 0x1f472b4b, 0x47bf410c,
- 0x82000121, 0x83fe20cb, 0x07424404, 0x68068243, 0xd7ad0d3d, 0x00010d26, 0x80020000, 0x4a1c6f43, 0x23681081, 0x10a14f13, 0x8a070e57, 0x430a848f,
- 0x7372243e, 0x4397a205, 0xb56c1021, 0x43978f0f, 0x64180505, 0x99aa0ff2, 0x0e000022, 0x20223341, 0x094b4f37, 0x074a3320, 0x2639410a, 0xfe208e84,
- 0x8b0e0048, 0x508020a3, 0x9e4308fe, 0x073f4115, 0xe3480420, 0x0c9b5f1b, 0x7c137743, 0x9a95185b, 0x6122b148, 0x979b08df, 0x0fe36c18, 0x48109358,
- 0x23441375, 0x0ffd5c0b, 0x180fc746, 0x2011d157, 0x07e95702, 0x58180120, 0x18770ac3, 0x51032008, 0x7d4118e3, 0x80802315, 0x3b4c1900, 0xbb5a1830,
- 0x0ceb6109, 0x5b0b3d42, 0x4f181369, 0x4f180b8d, 0x4f180f75, 0x355a1b81, 0x200d820d, 0x18e483fd, 0x4528854f, 0x89420846, 0x1321411f, 0x44086b60,
- 0x07421d77, 0x107d4405, 0x4113fd41, 0x5a181bf1, 0x4f180db3, 0x8021128f, 0x20f68280, 0x44a882fe, 0x334d249a, 0x052f6109, 0x1520c3a7, 0xef4eb783,
- 0x4ec39b1b, 0xc4c90ee7, 0x20060b4d, 0x256f4905, 0x4d0cf761, 0xcf9b1f13, 0xa213d74e, 0x0e1145d4, 0x50135b42, 0xcb4e398f, 0x20d79f27, 0x08865d80,
- 0x186d5018, 0xa90f7142, 0x067342d7, 0x3f450420, 0x65002021, 0xe3560771, 0x24d38f23, 0x15333531, 0x0eb94d01, 0x451c9f41, 0x384322fb, 0x00092108,
- 0x19af6b18, 0x6e0c6f5a, 0xbd770bfb, 0x22bb7718, 0x20090f57, 0x25e74204, 0x4207275a, 0xdb5408ef, 0x1769450f, 0x1b1b5518, 0x210b1f57, 0x5e4c8001,
- 0x55012006, 0x802107f1, 0x0a306a80, 0x45808021, 0x0d850b88, 0x31744f18, 0x1808ec54, 0x2009575b, 0x45ffa505, 0x1b420c73, 0x180f9f0f, 0x4a0cf748,
- 0x501805b2, 0x00210f40, 0x4d118f80, 0xd6823359, 0x072b5118, 0x314ad7aa, 0x8fc79f08, 0x45d78b1f, 0xfe20058f, 0x23325118, 0x7b54d9b5, 0x9fc38f46,
- 0x10bb410f, 0x41077b42, 0xc1410faf, 0x27cf441d, 0x46051b4f, 0x04200683, 0x2121d344, 0x8f530043, 0x8fcf9f0e, 0x21df8c1f, 0x50188000, 0x5d180e52,
- 0xfd201710, 0x4405c341, 0xd68528e3, 0x20071f6b, 0x1b734305, 0x6b080957, 0x7d422b1f, 0x67002006, 0x7f8317b1, 0x2024cb48, 0x08676e00, 0x8749a39b,
- 0x18132006, 0x410a6370, 0x8f490b47, 0x7e1f8f13, 0x551805c3, 0x4c180915, 0xfe200e2f, 0x244d5d18, 0x270bcf44, 0xff000019, 0x04800380, 0x5f253342,
- 0xff520df7, 0x13274c18, 0x5542dd93, 0x0776181b, 0xf94a1808, 0x084a4c0c, 0x4308ea5b, 0xde831150, 0x7900fd21, 0x00492c1e, 0x060f4510, 0x17410020,
- 0x0ce74526, 0x6206b341, 0x1f561083, 0x9d6c181b, 0x08a0500e, 0x112e4118, 0x60000421, 0xbf901202, 0x4408e241, 0xc7ab0513, 0xb40f0950, 0x055943c7,
- 0x4f18ff20, 0xc9ae1cad, 0x32b34f18, 0x7a180120, 0x3d520a05, 0x53d1b40a, 0x80200813, 0x1b815018, 0x832bf86f, 0x67731847, 0x297f4308, 0x6418d54e,
- 0x734213f7, 0x056b4b27, 0xdba5fe20, 0x1828aa4e, 0x2031a370, 0x06cb6101, 0x2040ad41, 0x07365300, 0x2558d985, 0x83fe200c, 0x0380211c, 0x542c4743,
- 0x052006b7, 0x6021df45, 0x897b0707, 0x18d3c010, 0x20090e70, 0x1d5843ff, 0x540a0e44, 0x002126c5, 0x322f7416, 0x636a5720, 0x0f317409, 0x610fe159,
- 0x294617e7, 0x08555213, 0x2006a75d, 0x6cec84fd, 0xfb5907be, 0x3a317405, 0x83808021, 0x180f20ea, 0x4626434a, 0x531818e3, 0xdb59172d, 0x0cbb460c,
- 0x2013d859, 0x18b94502, 0x8f46188d, 0x77521842, 0x0a184e38, 0x9585fd20, 0x6a180684, 0xc64507e9, 0x51cbb230, 0xd3440cf3, 0x17ff6a0f, 0x450f5b42,
- 0x276407c1, 0x4853180a, 0x21ccb010, 0xcf580013, 0x0c15442d, 0x410a1144, 0x1144359d, 0x5cfe2006, 0xa1410a43, 0x2bb64519, 0x2f5b7618, 0xb512b745,
- 0x0cfd6fd1, 0x42089f59, 0xb8450c70, 0x0000232d, 0x50180900, 0xb9491ae3, 0x0fc37610, 0x01210f83, 0x0f3b4100, 0xa01b2742, 0x0ccd426f, 0x6e8f6f94,
- 0x9c808021, 0xc7511870, 0x17c74b08, 0x9b147542, 0x44fe2079, 0xd5480c7e, 0x95ef861d, 0x101b597b, 0xf5417594, 0x9f471808, 0x86868d0e, 0x3733491c,
- 0x690f4d6d, 0x43440b83, 0x1ba94c0b, 0x660cd16b, 0x802008ae, 0x74126448, 0xcb4f38a3, 0x2cb74b0b, 0x47137755, 0xe3971777, 0x1b5d0120, 0x057a4108,
- 0x6e08664d, 0x17421478, 0x11af4208, 0x850c3f42, 0x08234f0c, 0x4321eb4a, 0xf3451095, 0x0f394e0f, 0x4310eb45, 0xc09707b1, 0x54431782, 0xaec08d1d,
- 0x0f434dbb, 0x9f0c0b45, 0x0a3b4dbb, 0x4618bdc7, 0x536032eb, 0x17354213, 0x4d134169, 0xc7a30c2f, 0x4e254342, 0x174332cf, 0x43cdae17, 0x6b4706e4,
- 0x0e16430d, 0x530b5542, 0x2f7c26bb, 0x13075f31, 0x43175342, 0x60181317, 0x6550114e, 0x28624710, 0x58070021, 0x59181683, 0x2d540cf5, 0x05d5660c,
- 0x20090c7b, 0x0e157e02, 0x8000ff2b, 0x14000080, 0x80ff8000, 0x27137e03, 0x336a4b20, 0x0f817107, 0x13876e18, 0x730f2f7e, 0x2f450b75, 0x6d02200b,
- 0x6d66094c, 0x4b802009, 0x15820a02, 0x2f45fe20, 0x5e032006, 0x00202fd9, 0x450af741, 0xeb412e0f, 0x0ff3411f, 0x420a8b65, 0xf7410eae, 0x1c664810,
- 0x540e1145, 0xbfa509f3, 0x42302f58, 0x80200c35, 0xcb066c47, 0x4b1120c1, 0x41492abb, 0x34854110, 0xa7097b72, 0x251545c7, 0x4b2c7f56, 0xc5b40bab,
- 0x940cd54e, 0x2e6151c8, 0x09f35f18, 0x4b420420, 0x09677121, 0x8f24f357, 0x1b5418e1, 0x08915a1f, 0x3143d894, 0x22541805, 0x1b9b4b0e, 0x8c0d3443,
- 0x1400240d, 0x18ff8000, 0x582e6387, 0xf99b2b3b, 0x8807a550, 0x17a14790, 0x2184fd20, 0x5758fe20, 0x2354882c, 0x15000080, 0x5e056751, 0x334c2c2f,
- 0x97c58f0c, 0x1fd7410f, 0x0d4d4018, 0x4114dc41, 0x04470ed6, 0x0dd54128, 0x00820020, 0x02011523, 0x22008700, 0x86480024, 0x0001240a, 0x8682001a,
- 0x0002240b, 0x866c000e, 0x8a03200b, 0x8a042017, 0x0005220b, 0x22218614, 0x84060000, 0x86012017, 0x8212200f, 0x250b8519, 0x000d0001, 0x0b850031,
- 0x07000224, 0x0b862600, 0x11000324, 0x0b862d00, 0x238a0420, 0x0a000524, 0x17863e00, 0x17840620, 0x01000324, 0x57820904, 0x0b85a783, 0x0b85a785,
- 0x0b85a785, 0x22000325, 0x85007a00, 0x85a7850b, 0x85a7850b, 0x22a7850b, 0x82300032, 0x00342201, 0x0805862f, 0x35003131, 0x54207962, 0x74736972,
- 0x47206e61, 0x6d6d6972, 0x65527265, 0x616c7567, 0x58545472, 0x6f725020, 0x43796767, 0x6e61656c, 0x30325454, 0x822f3430, 0x35313502, 0x79006200,
- 0x54002000, 0x69007200, 0x74007300, 0x6e006100, 0x47200f82, 0x6d240f84, 0x65006d00, 0x52200982, 0x67240582, 0x6c007500, 0x72201d82, 0x54222b82,
- 0x23825800, 0x19825020, 0x67006f22, 0x79220182, 0x1b824300, 0x3b846520, 0x1f825420, 0x41000021, 0x1422099b, 0x0b410000, 0x87088206, 0x01012102,
- 0x78080982, 0x01020101, 0x01040103, 0x01060105, 0x01080107, 0x010a0109, 0x010c010b, 0x010e010d, 0x0110010f, 0x01120111, 0x01140113, 0x01160115,
- 0x01180117, 0x011a0119, 0x011c011b, 0x011e011d, 0x0020011f, 0x00040003, 0x00060005, 0x00080007, 0x000a0009, 0x000c000b, 0x000e000d, 0x0010000f,
- 0x00120011, 0x00140013, 0x00160015, 0x00180017, 0x001a0019, 0x001c001b, 0x001e001d, 0x08bb821f, 0x22002142, 0x24002300, 0x26002500, 0x28002700,
- 0x2a002900, 0x2c002b00, 0x2e002d00, 0x30002f00, 0x32003100, 0x34003300, 0x36003500, 0x38003700, 0x3a003900, 0x3c003b00, 0x3e003d00, 0x40003f00,
- 0x42004100, 0x4b09f382, 0x00450044, 0x00470046, 0x00490048, 0x004b004a, 0x004d004c, 0x004f004e, 0x00510050, 0x00530052, 0x00550054, 0x00570056,
- 0x00590058, 0x005b005a, 0x005d005c, 0x005f005e, 0x01610060, 0x01220121, 0x01240123, 0x01260125, 0x01280127, 0x012a0129, 0x012c012b, 0x012e012d,
- 0x0130012f, 0x01320131, 0x01340133, 0x01360135, 0x01380137, 0x013a0139, 0x013c013b, 0x013e013d, 0x0140013f, 0x00ac0041, 0x008400a3, 0x00bd0085,
- 0x00e80096, 0x008e0086, 0x009d008b, 0x00a400a9, 0x008a00ef, 0x008300da, 0x00f20093, 0x008d00f3, 0x00880097, 0x00de00c3, 0x009e00f1, 0x00f500aa,
- 0x00f600f4, 0x00ad00a2, 0x00c700c9, 0x006200ae, 0x00900063, 0x00cb0064, 0x00c80065, 0x00cf00ca, 0x00cd00cc, 0x00e900ce, 0x00d30066, 0x00d100d0,
- 0x006700af, 0x009100f0, 0x00d400d6, 0x006800d5, 0x00ed00eb, 0x006a0089, 0x006b0069, 0x006c006d, 0x00a0006e, 0x0071006f, 0x00720070, 0x00750073,
- 0x00760074, 0x00ea0077, 0x007a0078, 0x007b0079, 0x007c007d, 0x00a100b8, 0x007e007f, 0x00810080, 0x00ee00ec, 0x6e750eba, 0x646f6369, 0x78302365,
- 0x31303030, 0x32200e8d, 0x33200e8d, 0x34200e8d, 0x35200e8d, 0x36200e8d, 0x37200e8d, 0x38200e8d, 0x39200e8d, 0x61200e8d, 0x62200e8d, 0x63200e8d,
- 0x64200e8d, 0x65200e8d, 0x66200e8d, 0x31210e8c, 0x8d0e8d30, 0x8d3120ef, 0x8d3120ef, 0x8d3120ef, 0x8d3120ef, 0x8d3120ef, 0x8d3120ef, 0x8d3120ef,
- 0x8d3120ef, 0x8d3120ef, 0x8d3120ef, 0x8d3120ef, 0x8d3120ef, 0x8d3120ef, 0x66312def, 0x6c656406, 0x04657465, 0x6f727545, 0x3820ec8c, 0x3820ec8d,
- 0x3820ec8d, 0x3820ec8d, 0x3820ec8d, 0x3820ec8d, 0x3820ec8d, 0x3820ec8d, 0x3820ec8d, 0x3820ec8d, 0x3820ec8d, 0x3820ec8d, 0x3820ec8d, 0x3820ec8d,
- 0x3820ec8d, 0x200ddc41, 0x0ddc4139, 0xef8d3920, 0xef8d3920, 0xef8d3920, 0xef8d3920, 0xef8d3920, 0xef8d3920, 0xef8d3920, 0xef8d3920, 0xef8d3920,
- 0xef8d3920, 0xef8d3920, 0xef8d3920, 0xef8d3920, 0xef8d3920, 0x00663923, 0x48fa0500, 0x00f762f9,
+ 0x0000bc57, 0x00000000, 0xf8a00000, 0x00000400, 0x00010037, 0x000c0000, 0x00030080, 0x2f534f40, 0x74eb8832, 0x01000090, 0x2c158248, 0x616d634e,
+ 0x23120270, 0x03000075, 0x241382a0, 0x74766352, 0x82178220, 0xfc042102, 0x02380482, 0x66796c67, 0x5689af12, 0x04070000, 0x80920000, 0x64616568,
+ 0xd36691d7, 0xcc201b82, 0x36210382, 0x27108268, 0xc3014208, 0x04010000, 0x243b0f82, 0x78746d68, 0x807e008a, 0x98010000, 0x06020000, 0x61636f6c,
+ 0xd8b0738c, 0x82050000, 0x0402291e, 0x7078616d, 0xda00ae01, 0x28201f82, 0x202c1082, 0x656d616e, 0x96bb5925, 0x84990000, 0x9e2c1382, 0x74736f70,
+ 0xef83aca6, 0x249b0000, 0xd22c3382, 0x70657270, 0x12010269, 0xf4040000, 0x08202f82, 0x012ecb84, 0x553c0000, 0x0f5fd5e9, 0x0300f53c, 0x00830008,
+ 0x7767b722, 0x002b3f82, 0xa692bd00, 0xfe0000d7, 0x83800380, 0x21f1826f, 0x00850002, 0x41820120, 0x40fec026, 0x80030000, 0x05821083, 0x07830120,
+ 0x0221038a, 0x24118200, 0x90000101, 0x82798200, 0x00022617, 0x00400008, 0x2009820a, 0x82098276, 0x82002006, 0x9001213b, 0x0223c883, 0x828a02bc,
+ 0x858f2010, 0xc5012507, 0x00023200, 0x04210083, 0x91058309, 0x6c412b03, 0x40007374, 0xac200000, 0x00830008, 0x01000523, 0x834d8380, 0x80032103,
+ 0x012101bf, 0x23b88280, 0x00800000, 0x0b830382, 0x07820120, 0x83800021, 0x88012001, 0x84002009, 0x2005870f, 0x870d8301, 0x2023901b, 0x83199501,
+ 0x82002015, 0x84802000, 0x84238267, 0x88002027, 0x8561882d, 0x21058211, 0x13880000, 0x01800022, 0x05850d85, 0x0f828020, 0x03208384, 0x03200582,
+ 0x47901b84, 0x1b850020, 0x1f821d82, 0x3f831d88, 0x3f410383, 0x84058405, 0x210982cd, 0x09830000, 0x03207789, 0xf38a1384, 0x01203782, 0x13872384,
+ 0x0b88c983, 0x0d898f84, 0x00202982, 0x23900383, 0x87008021, 0x83df8301, 0x86118d03, 0x863f880d, 0x8f35880f, 0x2160820f, 0x04830300, 0x1c220382,
+ 0x05820100, 0x4c000022, 0x09831182, 0x04001c24, 0x11823000, 0x0800082e, 0x00000200, 0xff007f00, 0xffffac20, 0x00220982, 0x09848100, 0xdf216682,
+ 0x843586d5, 0x06012116, 0x04400684, 0xa58120d7, 0x00b127d8, 0x01b88d01, 0x2d8685ff, 0xc100c621, 0xf4be0801, 0x9e011c01, 0x88021402, 0x1403fc02,
+ 0x9c035803, 0x1404de03, 0x50043204, 0xa2046204, 0x66051605, 0x1206bc05, 0xd6067406, 0x7e073807, 0x4e08ec07, 0x96086c08, 0x1009d008, 0x88094a09,
+ 0x800a160a, 0x560b040b, 0x2e0cc80b, 0xea0c820c, 0xa40d5e0d, 0x500eea0d, 0x280f960e, 0x1210b00f, 0xe0107410, 0xb6115211, 0x6e120412, 0x4c13c412,
+ 0xf613ac13, 0xae145814, 0x4015ea14, 0xa6158015, 0x1216b815, 0xc6167e16, 0x8e173417, 0x5618e017, 0xee18ba18, 0x96193619, 0x481ad419, 0xf01a9c1a,
+ 0xc81b5c1b, 0x4c1c041c, 0xea1c961c, 0x921d2a1d, 0x401ed21d, 0xe01e8e1e, 0x761f241f, 0xa61fa61f, 0x01821020, 0x8a202e34, 0xc820b220, 0x74211421,
+ 0xee219821, 0x86226222, 0x01820c23, 0x83238021, 0x23983c01, 0x24d823b0, 0x244a2400, 0x24902468, 0x250625ae, 0x25822560, 0x26f825f8, 0x82aa2658,
+ 0xd8be0801, 0x9a274027, 0x68280a28, 0x0e29a828, 0xb8292029, 0x362af829, 0x602a602a, 0x2a2b022b, 0xac2b5e2b, 0x202ce62b, 0x9a2c342c, 0x5c2d282d,
+ 0xaa2d782d, 0x262ee82d, 0x262fa62e, 0xf42fb62f, 0xc8305e30, 0xb4313e31, 0x9e321e32, 0x82331e33, 0x5c34ee33, 0x3a35ce34, 0xd4358635, 0x72362636,
+ 0x7637e636, 0x3a38d837, 0x1239a638, 0xae397439, 0x9a3a2e3a, 0x7c3b063b, 0x3a3ce83b, 0x223d963c, 0xec3d863d, 0xc63e563e, 0x9a3f2a3f, 0x6a401240,
+ 0x3641d040, 0x0842a241, 0x7a424042, 0xf042b842, 0xcc436243, 0x8a442a44, 0x5845ee44, 0xe245b645, 0xb4465446, 0x7a471447, 0x5448da47, 0x4049c648,
+ 0x15462400, 0x034d0808, 0x0b000700, 0x13000f00, 0x1b001700, 0x23001f00, 0x2b002700, 0x33002f00, 0x3b003700, 0x43003f00, 0x4b004700, 0x53004f00,
+ 0x5b005700, 0x63005f00, 0x6b006700, 0x73006f00, 0x7b007700, 0x83007f00, 0x8b008700, 0x00008f00, 0x15333511, 0x20039631, 0x20178205, 0xd3038221,
+ 0x20739707, 0x25008580, 0x028080fc, 0x05be8080, 0x04204a85, 0x05ce0685, 0x0107002a, 0x02000080, 0x00000400, 0x250d8b41, 0x33350100, 0x03920715,
+ 0x13820320, 0x858d0120, 0x0e8d0320, 0xff260d83, 0x00808000, 0x54820106, 0x04800223, 0x845b8c80, 0x41332059, 0x078b068f, 0x82000121, 0x82fe2039,
+ 0x84802003, 0x83042004, 0x23598a0e, 0x00180000, 0x03210082, 0x42ab9080, 0x73942137, 0x2013bb41, 0x8f978205, 0x2027a39b, 0x20b68801, 0x84b286fd,
+ 0x91c88407, 0x41032011, 0x11a51130, 0x15000027, 0x80ff8000, 0x11af4103, 0x841b0341, 0x8bd983fd, 0x9be99bc9, 0x8343831b, 0x21f1821f, 0xb58300ff,
+ 0x0f84e889, 0xf78a0484, 0x8000ff22, 0x0020eeb3, 0x14200082, 0x2130ef41, 0xeb431300, 0x4133200a, 0xd7410ecb, 0x9a07200b, 0x2027871b, 0x21238221,
+ 0xe7828080, 0xe784fd20, 0xe8848020, 0xfe808022, 0x08880d85, 0xba41fd20, 0x82248205, 0x85eab02a, 0x008022e7, 0x2cd74200, 0x44010021, 0xd34406eb,
+ 0x44312013, 0xcf8b0eef, 0x0d422f8b, 0x82332007, 0x0001212f, 0x8023cf82, 0x83000180, 0x820583de, 0x830682d4, 0x820020d4, 0x82dc850a, 0x20e282e9,
+ 0xb2ff85fe, 0x010327e9, 0x02000380, 0x0f440400, 0x0c634407, 0x68825982, 0x85048021, 0x260a825d, 0x010b0000, 0x4400ff00, 0x2746103f, 0x08d74209,
+ 0x4d440720, 0x0eaf4406, 0xc3441d20, 0x23078406, 0xff800002, 0x04845b83, 0x8d05b241, 0x1781436f, 0x6b8c87a5, 0x1521878e, 0x06474505, 0x01210783,
+ 0x84688c00, 0x8904828e, 0x441e8cf7, 0x0b270cff, 0x80008000, 0x45030003, 0xfb430fab, 0x080f4107, 0x410bf942, 0xd34307e5, 0x070d4207, 0x80800123,
+ 0x205d85fe, 0x849183fe, 0x20128404, 0x82809702, 0x00002217, 0x41839a09, 0x6b4408cf, 0x0733440f, 0x3b460720, 0x82798707, 0x97802052, 0x0000296f,
+ 0xff800004, 0x01800100, 0x0021ef89, 0x0a914625, 0x410a4d41, 0x00250ed4, 0x00050000, 0x056d4280, 0x210a7b46, 0x21481300, 0x46ed8512, 0x00210bd1,
+ 0x89718202, 0x21738877, 0x2b850001, 0x00220582, 0x87450a00, 0x0ddb4606, 0x41079b42, 0x9d420c09, 0x0b09420b, 0x8d820720, 0x9742fc84, 0x42098909,
+ 0x00241e0f, 0x00800014, 0x0b47da82, 0x0833442a, 0x49078d41, 0x2f450f13, 0x42278f17, 0x01200751, 0x22063742, 0x44808001, 0x20450519, 0x88068906,
+ 0x83fe2019, 0x4203202a, 0x1a941a58, 0x00820020, 0xe7a40e20, 0x420ce146, 0x854307e9, 0x0fcb4713, 0xff20a182, 0xfe209b82, 0x0c867f8b, 0x0021aea4,
+ 0x219fa40f, 0x7d41003b, 0x07194214, 0xbf440520, 0x071d4206, 0x6941a590, 0x80802309, 0x028900ff, 0xa9a4b685, 0xc5808021, 0x449b82ab, 0x152007eb,
+ 0x42134d46, 0x61440a15, 0x051e4208, 0x222b0442, 0x47001100, 0xfd412913, 0x17194714, 0x410f5b41, 0x02220773, 0x09428080, 0x21a98208, 0xd4420001,
+ 0x481c840d, 0x00232bc9, 0x42120000, 0xe74c261b, 0x149d4405, 0x07209d87, 0x410db944, 0x14421c81, 0x42fd2005, 0x80410bd2, 0x203d8531, 0x06874100,
+ 0x48256f4a, 0xcb420c95, 0x13934113, 0x44075d44, 0x044c0855, 0x00ff2105, 0xfe228185, 0x45448000, 0x22c5b508, 0x410c0000, 0x7b412087, 0x1bb74514,
+ 0x32429c85, 0x0a574805, 0x21208943, 0x8ba01300, 0x440dfb4e, 0x77431437, 0x245b4113, 0x200fb145, 0x41108ffe, 0x80203562, 0x00200082, 0x46362b42,
+ 0x1742178d, 0x4527830f, 0x0f830b2f, 0x4a138146, 0x802409a1, 0xfe8000ff, 0x94419982, 0x09294320, 0x04000022, 0x49050f4f, 0xcb470a63, 0x48032008,
+ 0x2b48067b, 0x85022008, 0x82638338, 0x00002209, 0x05af4806, 0x900e9f49, 0x84c5873f, 0x214285bd, 0x064900ff, 0x0c894607, 0x00000023, 0x4903820a,
+ 0x714319f3, 0x0749410c, 0x8a07a145, 0x02152507, 0xfe808000, 0x74490386, 0x8080211b, 0x0c276f82, 0x00018000, 0x48028003, 0x2b2315db, 0x43002f00,
+ 0x6f82142f, 0x44011521, 0x93510da7, 0x20e68508, 0x06494d80, 0x8e838020, 0x06821286, 0x124bff20, 0x25f3830c, 0x03800080, 0xe74a0380, 0x207b8715,
+ 0x876b861d, 0x4a152007, 0x07870775, 0xf6876086, 0x8417674a, 0x0a0021f2, 0x431c9743, 0x8d421485, 0x200b830b, 0x06474d03, 0x71828020, 0x04510120,
+ 0x42da8606, 0x1f831882, 0x001a0022, 0xff4d0082, 0x0b0f532c, 0x0d449b94, 0x4e312007, 0x074f12e7, 0x0bf3490b, 0xbb412120, 0x413f820a, 0xef490857,
+ 0x80002313, 0xe2830001, 0x6441fc20, 0x8b802006, 0x00012108, 0xfd201582, 0x492c9b48, 0x802014ff, 0x51084347, 0x0f4327f3, 0x17bf4a14, 0x201b7944,
+ 0x06964201, 0x134ffe20, 0x20d6830b, 0x25d78280, 0xfd800002, 0x05888000, 0x9318dc41, 0x21d282d4, 0xdb481800, 0x0dff542a, 0x45107743, 0xe14813f5,
+ 0x0f034113, 0x83135d45, 0x47b28437, 0xe4510e73, 0x21f58e06, 0x2b8400fd, 0x1041fcac, 0x08db4b0b, 0x421fdb41, 0xdf4b18df, 0x011d210a, 0x420af350,
+ 0x6e8308af, 0xac85cb86, 0x1e461082, 0x82b7a407, 0x411420a3, 0xa34130ab, 0x178f4124, 0x41139741, 0x86410d93, 0x82118511, 0x057243d8, 0x8941d9a4,
+ 0x3093480c, 0x4a13474f, 0xfb5016a9, 0x07ad4108, 0x4a0f9d42, 0xfe200fad, 0x4708aa41, 0x83482dba, 0x288f4d06, 0xb398c3bb, 0x44267b41, 0xb34439d7,
+ 0x0755410f, 0x200ebb45, 0x0f5f4215, 0x20191343, 0x06df5301, 0xf04c0220, 0x2ba64d07, 0x82050841, 0x430020ce, 0xa78f3627, 0x5213ff42, 0x2f970bc1,
+ 0x4305ab55, 0xa084111b, 0x450bac45, 0x5f4238b8, 0x010c2106, 0x0220ed82, 0x441bb344, 0x875010af, 0x0737480f, 0x490c5747, 0x0c840c03, 0x4c204b42,
+ 0x8ba905d7, 0x8b948793, 0x510c0c51, 0xfb4b24b9, 0x1b174107, 0x5709d74c, 0xd1410ca5, 0x079d480f, 0x201ff541, 0x06804780, 0x7d520120, 0x80002205,
+ 0x20a983fe, 0x47bb83fe, 0x1b8409b4, 0x81580220, 0x4e00202c, 0x4f41282f, 0x0eab4f17, 0x57471520, 0x0e0f4808, 0x8221e041, 0x3e1b4a8b, 0x4407175d,
+ 0x1b4b071f, 0x4a0f8b07, 0x174a0703, 0x0ba5411b, 0x430fb141, 0x0120057b, 0xfc20dd82, 0x4a056047, 0xf4850c0c, 0x01221982, 0x02828000, 0x1a5d088b,
+ 0x20094108, 0x8c0e3941, 0x4900200e, 0x7744434f, 0x200b870b, 0x0e4b5a33, 0x2b41f78b, 0x8b138307, 0x0b9f450b, 0x2406f741, 0xfd808001, 0x09475a00,
+ 0x84000121, 0x5980200e, 0x85450e5d, 0x832c8206, 0x4106831e, 0x00213814, 0x28b34810, 0x410c2f4b, 0x5f4a13d7, 0x0b2b4113, 0x6e43a883, 0x11174b05,
+ 0x4b066a45, 0xcc470541, 0x5000202b, 0xcb472f4b, 0x44b59f0f, 0xc5430b5b, 0x0d654907, 0x21065544, 0xd6828080, 0xfe201982, 0x8230ec4a, 0x120025c2,
+ 0x80ff8000, 0x4128d74d, 0x3320408b, 0x410a9f50, 0xdb822793, 0x822bd454, 0x61134b2e, 0x410b214a, 0xad4117c9, 0x0001211f, 0x4206854f, 0x4b430596,
+ 0x06bb5530, 0x2025cf46, 0x0ddd5747, 0x500ea349, 0x0f840fa7, 0x5213c153, 0x634e08d1, 0x0bbe4809, 0x59316e4d, 0x5b50053f, 0x203f6323, 0x5117eb46,
+ 0x94450a63, 0x246e410a, 0x63410020, 0x0bdb5f2f, 0x4233ab44, 0x39480757, 0x112d4a07, 0x7241118f, 0x000e2132, 0x9f286f41, 0x0f8762c3, 0x33350723,
+ 0x094e6415, 0x2010925f, 0x067252fe, 0xd0438020, 0x63a68225, 0x11203a4f, 0x480e6360, 0x5748131f, 0x079b521f, 0x200e2f43, 0x864b8315, 0x113348e7,
+ 0x85084e48, 0x06855008, 0x5880fd21, 0x7c420925, 0x0c414824, 0x37470c86, 0x1b8b422b, 0x5b0a8755, 0x23410c21, 0x0b83420b, 0x5a082047, 0xf482067f,
+ 0xa80b4c47, 0x0c0021cf, 0x20207b42, 0x0fb74100, 0x420b8744, 0xeb43076f, 0x0f6f420b, 0x4261fe20, 0x439aa00c, 0x215034e3, 0x0ff9570f, 0x4b1f2d5d,
+ 0x2d5d0c6f, 0x09634d0b, 0x1f51b8a0, 0x620f200c, 0xaf681e87, 0x24f94d07, 0x4e0f4945, 0xfe200c05, 0x22139742, 0x57048080, 0x23950c20, 0x97601585,
+ 0x4813201f, 0xad620523, 0x200f8f0f, 0x9e638f15, 0x00002181, 0x41342341, 0x0f930f0b, 0x210b4b62, 0x978f0001, 0xfe200f84, 0x8425c863, 0x2704822b,
+ 0x80000a00, 0x00038001, 0x610e9768, 0x834514bb, 0x0bc3430f, 0x2107e357, 0x80848080, 0x4400fe21, 0x2e410983, 0x00002a1a, 0x00000700, 0x800380ff,
+ 0x0fdf5800, 0x59150021, 0xd142163d, 0x0c02410c, 0x01020025, 0x65800300, 0x00240853, 0x1d333501, 0x15220382, 0x35420001, 0x44002008, 0x376406d7,
+ 0x096f6b19, 0x480bc142, 0x8f4908a7, 0x211f8b1f, 0x9e830001, 0x0584fe20, 0x4180fd21, 0x11850910, 0x8d198259, 0x000021d4, 0x5a08275d, 0x275d1983,
+ 0x06d9420e, 0x9f08b36a, 0x0f7d47b5, 0x8d8a2f8b, 0x4c0e0b57, 0xe7410e17, 0x42d18c1a, 0xb351087a, 0x1ac36505, 0x4b4a2f20, 0x0b9f450d, 0x430beb53,
+ 0xa7881015, 0xa5826a83, 0x80200f82, 0x86185a65, 0x4100208e, 0x176c3367, 0x0fe7650b, 0x4a17ad4b, 0x0f4217ed, 0x112e4206, 0x41113a42, 0xf7423169,
+ 0x0cb34737, 0x560f8b46, 0xa75407e5, 0x5f01200f, 0x31590c48, 0x80802106, 0x42268841, 0x0020091e, 0x4207ef64, 0x69461df7, 0x138d4114, 0x820f5145,
+ 0x53802090, 0xff200529, 0xb944b183, 0x417e8505, 0x00202561, 0x15210082, 0x42378200, 0x9b431cc3, 0x004f220d, 0x0dd54253, 0x4213f149, 0x7d41133b,
+ 0x42c9870b, 0x802010f9, 0x420b2c42, 0x8f441138, 0x267c4408, 0x600cb743, 0x8f4109d3, 0x05ab701d, 0x83440020, 0x3521223f, 0x0b794733, 0xfb62fe20,
+ 0x4afd2010, 0xaf410ae7, 0x25ce8525, 0x01080000, 0x7b6b0000, 0x0973710b, 0x82010021, 0x49038375, 0x33420767, 0x052c4212, 0x58464b85, 0x41fe2005,
+ 0x50440c27, 0x000c2209, 0x1cb36b80, 0x9b06df44, 0x0f93566f, 0x52830220, 0xfe216e8d, 0x200f8200, 0x0fb86704, 0xb057238d, 0x050b5305, 0x7217eb47,
+ 0xbd410b6b, 0x0f214610, 0x871f9956, 0x1e91567e, 0x2029b741, 0x20008200, 0x18b7410a, 0x27002322, 0x41095543, 0x0f8f0fb3, 0x41000121, 0x889d111c,
+ 0x14207b82, 0x00200382, 0x73188761, 0x475013a7, 0x6e33200c, 0x234e0ea3, 0x9b138313, 0x08e54d17, 0x9711094e, 0x2ee74311, 0x4908875e, 0xd75d1f1f,
+ 0x19ab5238, 0xa2084d48, 0x63a7a9b3, 0x55450b83, 0x0fd74213, 0x440d814c, 0x4f481673, 0x05714323, 0x13000022, 0x412e1f46, 0xdf493459, 0x21c7550f,
+ 0x8408215f, 0x201d49cb, 0xb1103043, 0x0f0d65d7, 0x452b8d41, 0x594b0f8d, 0x0b004605, 0xb215eb46, 0x000a24d7, 0x47000080, 0x002118cf, 0x06436413,
+ 0x420bd750, 0x2b500743, 0x076a470c, 0x4105c050, 0xd942053f, 0x0d00211a, 0x5f44779c, 0x0ce94805, 0x51558186, 0x14a54c0b, 0x49082b41, 0x0a4b0888,
+ 0x8080261f, 0x0d000000, 0x20048201, 0x1deb6a03, 0x420cb372, 0x07201783, 0x4306854d, 0x8b830c59, 0x59093c74, 0x0020250f, 0x67070f4a, 0x2341160b,
+ 0x00372105, 0x431c515d, 0x554e17ef, 0x0e5d6b05, 0x41115442, 0xb74a1ac1, 0x2243420a, 0x5b4f878f, 0x7507200f, 0x384b086f, 0x09d45409, 0x0020869a,
+ 0x12200082, 0xab460382, 0x10075329, 0x54138346, 0xaf540fbf, 0x1ea75413, 0x9a0c9e54, 0x0f6b44c1, 0x41000021, 0x47412a4f, 0x07374907, 0x5310bf76,
+ 0xff2009b4, 0x9a09a64c, 0x8200208d, 0x34c34500, 0x970fe141, 0x1fd74b0f, 0x440a3850, 0x206411f0, 0x27934609, 0x470c5d41, 0x555c2947, 0x1787540f,
+ 0x6e0f234e, 0x7d540a1b, 0x1d736b08, 0x0026a088, 0x80000e00, 0x9b5200ff, 0x08ef4318, 0x450bff77, 0x1d4d0b83, 0x081f7006, 0xcb691b86, 0x4b022008,
+ 0xc34b0b33, 0x1d0d4a0c, 0x8025a188, 0x0b000000, 0x52a38201, 0xbf7d0873, 0x0c234511, 0x8f0f894a, 0x4101200f, 0x0c880c9d, 0x2b418ea1, 0x06c74128,
+ 0x66181341, 0x7b4c0bb9, 0x0c06630b, 0xfe200c87, 0x9ba10882, 0x27091765, 0x01000008, 0x02800380, 0x48113f4e, 0x29430cf5, 0x09a75a0b, 0x31618020,
+ 0x6d802009, 0x61840e33, 0x8208bf51, 0x0c637d61, 0x7f092379, 0x4f470f4b, 0x1797510c, 0x46076157, 0xf5500fdf, 0x0f616910, 0x1171fe20, 0x82802006,
+ 0x08696908, 0x41127a4c, 0x3f4a15f3, 0x01042607, 0x0200ff00, 0x1cf77700, 0xff204185, 0x00235b8d, 0x43100000, 0x3b22243f, 0x3b4d3f00, 0x0b937709,
+ 0xad42f18f, 0x0b1f420f, 0x51084b43, 0x8020104a, 0xb557ff83, 0x052b7f2a, 0x0280ff22, 0x250beb78, 0x00170013, 0xbf6d2500, 0x07db760e, 0x410e2b7f,
+ 0x00230e4f, 0x49030000, 0x0582055b, 0x07000326, 0x00000b00, 0x580bcd46, 0x00200cdd, 0x57078749, 0x8749160f, 0x0f994f0a, 0x41134761, 0x01200b31,
+ 0xeb796883, 0x0b41500b, 0x0e90b38e, 0x202e7b51, 0x05d95801, 0x41080570, 0x1d530fc9, 0x0b937a0f, 0xaf8eb387, 0xf743b98f, 0x07c74227, 0x80000523,
+ 0x0fcb4503, 0x430ca37b, 0x7782077f, 0x8d0a9947, 0x08af4666, 0xeb798020, 0x6459881e, 0xc3740bbf, 0x0feb6f0b, 0x20072748, 0x052b6102, 0x435e0584,
+ 0x7d088308, 0x03200afd, 0x92109e41, 0x28aa8210, 0x80001500, 0x80030000, 0x0fdb5805, 0x209f4018, 0xa7418d87, 0x0aa3440f, 0x20314961, 0x073a52ff,
+ 0x6108505d, 0x43181051, 0x00223457, 0xe7820500, 0x50028021, 0x81410d33, 0x063d7108, 0xdb41af84, 0x4d888205, 0x00201198, 0x463d835f, 0x152106d7,
+ 0x0a355a33, 0x6917614e, 0x75411f4d, 0x184b8b07, 0x1809c344, 0x21091640, 0x0b828000, 0x42808021, 0x26790519, 0x86058605, 0x2428422d, 0x22123b42,
+ 0x42000080, 0xf587513b, 0x7813677b, 0xaf4d139f, 0x00ff210c, 0x5e0a1d57, 0x3b421546, 0x01032736, 0x02000380, 0x41180480, 0x2f420f07, 0x0c624807,
+ 0x00000025, 0x18000103, 0x83153741, 0x430120c3, 0x042106b2, 0x088d4d00, 0x2f830620, 0x1810434a, 0x18140345, 0x8507fb41, 0x5ee582ea, 0x0023116c,
+ 0x8d000600, 0x053b56af, 0xa6554fa2, 0x0d704608, 0x40180d20, 0x47181a43, 0xd37b07ff, 0x0b79500c, 0x420fd745, 0x47450bd9, 0x8471830a, 0x095a777e,
+ 0x84137542, 0x82002013, 0x2f401800, 0x0007213b, 0x4405e349, 0x0d550ff3, 0x16254c0c, 0x820ffe4a, 0x0400218a, 0x89066f41, 0x106b414f, 0xc84d0120,
+ 0x80802206, 0x0c9a4b03, 0x00100025, 0x68000200, 0x9d8c2473, 0x44134344, 0xf36a0f33, 0x4678860f, 0x1b440a25, 0x41988c0a, 0x80201879, 0x43079b5e,
+ 0x4a18080b, 0x0341190b, 0x1259530c, 0x43251552, 0x908205c8, 0x0cac4018, 0x86000421, 0x0e504aa2, 0x0020b891, 0xfb450082, 0x51132014, 0x8f5205f3,
+ 0x35052108, 0x8505cb59, 0x0f6d4f70, 0x82150021, 0x29af5047, 0x4f004b24, 0x75795300, 0x1b595709, 0x460b6742, 0xbf4b0f0d, 0x5743870b, 0xcb6d1461,
+ 0x08f64505, 0x4e05ab6c, 0x334126c3, 0x0bcb6b0d, 0x1811034d, 0x4111ef4b, 0x814f1ce5, 0x20af8227, 0x07fd7b80, 0x41188e84, 0xef410f33, 0x80802429,
+ 0x410d0000, 0xa34205ab, 0x76b7881c, 0xff500b89, 0x0741430f, 0x20086f4a, 0x209d8200, 0x234c18fd, 0x05d4670a, 0x4509af51, 0x9642078d, 0x189e831d,
+ 0x7c1cc74b, 0xcd4c07b9, 0x0e7c440f, 0x8b7b0320, 0x21108210, 0xc76c8080, 0x03002106, 0x6b23bf41, 0xc549060b, 0x7946180b, 0x0ff7530f, 0x17ad4618,
+ 0x200ecd45, 0x208c83fd, 0x5e0488fe, 0x032009c6, 0x420d044e, 0x0d8f0d7f, 0x00820020, 0x18001021, 0x6d273b45, 0xfd4c0c93, 0xcf451813, 0x0fe5450f,
+ 0x5a47c382, 0x820a8b0a, 0x282b4998, 0x410a8b5b, 0x4b232583, 0x54004f00, 0x978f0ce3, 0x500f1944, 0xa95f1709, 0x0280220b, 0x05ba7080, 0xa1530682,
+ 0x06324c13, 0x91412582, 0x05536e2c, 0x63431020, 0x0f434706, 0x8c11374c, 0x176143d7, 0x4d0f454c, 0xd3680bed, 0x0bee4d17, 0x212b9a41, 0x0f530a00,
+ 0x140d531c, 0x43139143, 0x95610e8d, 0x0f094415, 0x4205fb56, 0x1b4205cf, 0x17015225, 0x5e0c477f, 0xaf6e0aeb, 0x0ff36218, 0x04849a84, 0x0a454218,
+ 0x9c430420, 0x23c6822b, 0x04000102, 0x45091b4b, 0xf05f0955, 0x82802007, 0x421c2023, 0x5218282b, 0x7b53173f, 0x0fe7480c, 0x74173b7f, 0x47751317,
+ 0x634d1807, 0x0f6f430f, 0x24086547, 0xfc808002, 0x0b3c7f80, 0x10840120, 0x188d1282, 0x20096b43, 0x0fc24403, 0x00260faf, 0x0180000b, 0x3f500280,
+ 0x18002019, 0x450b4941, 0xf3530fb9, 0x18002010, 0x8208a551, 0x06234d56, 0xcb58a39b, 0xc3421805, 0x1313461e, 0x0f855018, 0xd34b0120, 0x6cfe2008,
+ 0x574f0885, 0x09204114, 0x07000029, 0x00008000, 0x44028002, 0x01420f57, 0x10c95c10, 0x11184c18, 0x80221185, 0x7f421e00, 0x00732240, 0x09cd4977,
+ 0x6d0b2b42, 0x4f180f8f, 0x8f5a0bcb, 0x9b0f830f, 0x0fb9411f, 0x230b5756, 0x00fd8080, 0x82060745, 0x000121d5, 0x8e0fb277, 0x4a8d4211, 0x24061c53,
+ 0x04000007, 0x12275280, 0x430c954c, 0x80201545, 0x200f764f, 0x20008200, 0x20ce8308, 0x09534f02, 0x660edf64, 0x73731771, 0xe7411807, 0x20a2820c,
+ 0x13b64404, 0x8f5d6682, 0x1d6b4508, 0x0cff4d18, 0x3348c58f, 0x0fc34c07, 0x31558b84, 0x8398820f, 0x17514712, 0x240b0e46, 0x80000a00, 0x093b4502,
+ 0x420f9759, 0xa54c0bf1, 0x0f2b470c, 0x410d314b, 0x2584170c, 0x73b30020, 0xb55fe782, 0x204d8410, 0x08e043fe, 0x4f147e41, 0x022008ab, 0x4b055159,
+ 0x2950068f, 0x00022208, 0x48511880, 0x82002009, 0x00112300, 0x634dff00, 0x24415f27, 0x180f6d43, 0x4d0b5d45, 0x4d5f05ef, 0x01802317, 0x56188000,
+ 0xa7840807, 0xc6450220, 0x21ca8229, 0x4b781a00, 0x3359182c, 0x0cf3470f, 0x180bef46, 0x420b0354, 0xff470b07, 0x4515200a, 0x9758239b, 0x4a80200c,
+ 0xd2410a26, 0x05fb4a08, 0x4b05e241, 0x03200dc9, 0x92290941, 0x00002829, 0x00010900, 0x5b020001, 0x23201363, 0x460d776a, 0xef530fdb, 0x209a890c,
+ 0x13fc4302, 0x00008024, 0xc4820104, 0x08820220, 0x20086b5b, 0x18518700, 0x8408d349, 0x0da449a1, 0x00080024, 0x7b690280, 0x4c438b1a, 0x01220f63,
+ 0x4c878000, 0x5c149c53, 0xfb430868, 0x2f56181e, 0x0ccf7b1b, 0x0f075618, 0x2008e347, 0x14144104, 0x00207f83, 0x00207b82, 0x201adf47, 0x16c35a13,
+ 0x540fdf47, 0x802006c8, 0x5418f185, 0x29430995, 0x00002419, 0x58001600, 0x5720316f, 0x4d051542, 0x4b7b1b03, 0x138f4707, 0xb747b787, 0x4aab8213,
+ 0x058305fc, 0x20115759, 0x82128401, 0x0a0b44e8, 0x46800121, 0xe64210d0, 0x82129312, 0x4bffdffe, 0x3b41171b, 0x9b27870f, 0x808022ff, 0x085c68fe,
+ 0x41800021, 0x01410b20, 0x001a213a, 0x47480082, 0x11374e12, 0x56130b4c, 0xdf4b0c65, 0x0b0f590b, 0x0f574c18, 0x830feb4b, 0x075f480f, 0x480b4755,
+ 0x40490b73, 0x80012206, 0x09d74280, 0x80fe8022, 0x80210e86, 0x056643ff, 0x10820020, 0x420b2646, 0x0b58391a, 0xd74c1808, 0x078b4e22, 0x2007f55f,
+ 0x4b491807, 0x83802017, 0x65aa82a7, 0x3152099e, 0x068b7616, 0x9b431220, 0x09bb742c, 0x500e376c, 0x8342179b, 0x0a4d5d0f, 0x8020a883, 0x180cd349,
+ 0x2016bb4b, 0x14476004, 0x84136c43, 0x08cf7813, 0x4f4c0520, 0x156f420f, 0x20085f42, 0x6fd3be03, 0xd4d30803, 0xa7411420, 0x004b222c, 0x0d3b614f,
+ 0x3f702120, 0x1393410a, 0x8f132745, 0x47421827, 0x41e08209, 0xb05e2bb9, 0x18b7410c, 0x18082647, 0x4107a748, 0xeb8826bf, 0x0ca76018, 0x733ecb41,
+ 0xd0410d83, 0x43ebaf2a, 0x0420067f, 0x721dab4c, 0x472005bb, 0x4105d341, 0x334844cb, 0x20dba408, 0x47d6ac00, 0x034e3aef, 0x0f8f421b, 0x930f134d,
+ 0x3521231f, 0xb7421533, 0x42f5ad0a, 0x1e961eaa, 0x17000022, 0x4c367b50, 0x7d491001, 0x0bf5520f, 0x4c18fda7, 0xb8460c55, 0x83fe2005, 0x00fe25b9,
+ 0x80000180, 0x9e751085, 0x261b5c12, 0x82110341, 0x001123fb, 0x4518fe80, 0xf38c2753, 0x6d134979, 0x295107a7, 0xaf5f180f, 0x0fe3660c, 0x180b6079,
+ 0x2007bd5f, 0x9aab9103, 0x2f4d1811, 0x05002109, 0x44254746, 0x1d200787, 0x450bab75, 0x4f180f57, 0x4f181361, 0x3b831795, 0xeb4b0120, 0x0b734805,
+ 0x84078f48, 0x2e1b47bc, 0x00203383, 0xaf065f45, 0x831520d7, 0x130f51a7, 0x1797bf97, 0x2b47d783, 0x18fe2005, 0x4a18a44f, 0xa64d086d, 0x1ab0410d,
+ 0x6205a258, 0xdbab069f, 0x4f06f778, 0xa963081d, 0x133b670a, 0x8323d141, 0x13195b23, 0x530f5e70, 0xe5ad0824, 0x58001421, 0x1f472b4b, 0x47bf410c,
+ 0x82000121, 0x83fe20cb, 0x07424404, 0x68068243, 0xd7ad0d3d, 0x00010d26, 0x80020000, 0x4a1c6f43, 0x23681081, 0x10a14f13, 0x8a070e57, 0x430a848f,
+ 0x7372243e, 0x4397a205, 0xb56c1021, 0x43978f0f, 0x64180505, 0x99aa0ff2, 0x0e000022, 0x20223341, 0x094b4f37, 0x074a3320, 0x2639410a, 0xfe208e84,
+ 0x8b0e0048, 0x508020a3, 0x9e4308fe, 0x073f4115, 0xe3480420, 0x0c9b5f1b, 0x7c137743, 0x9a95185b, 0x6122b148, 0x979b08df, 0x0fe36c18, 0x48109358,
+ 0x23441375, 0x0ffd5c0b, 0x180fc746, 0x2011d157, 0x07e95702, 0x58180120, 0x18770ac3, 0x51032008, 0x7d4118e3, 0x80802315, 0x3b4c1900, 0xbb5a1830,
+ 0x0ceb6109, 0x5b0b3d42, 0x4f181369, 0x4f180b8d, 0x4f180f75, 0x355a1b81, 0x200d820d, 0x18e483fd, 0x4528854f, 0x89420846, 0x1321411f, 0x44086b60,
+ 0x07421d77, 0x107d4405, 0x4113fd41, 0x5a181bf1, 0x4f180db3, 0x8021128f, 0x20f68280, 0x44a882fe, 0x334d249a, 0x052f6109, 0x1520c3a7, 0xef4eb783,
+ 0x4ec39b1b, 0xc4c90ee7, 0x20060b4d, 0x256f4905, 0x4d0cf761, 0xcf9b1f13, 0xa213d74e, 0x0e1145d4, 0x50135b42, 0xcb4e398f, 0x20d79f27, 0x08865d80,
+ 0x186d5018, 0xa90f7142, 0x067342d7, 0x3f450420, 0x65002021, 0xe3560771, 0x24d38f23, 0x15333531, 0x0eb94d01, 0x451c9f41, 0x384322fb, 0x00092108,
+ 0x19af6b18, 0x6e0c6f5a, 0xbd770bfb, 0x22bb7718, 0x20090f57, 0x25e74204, 0x4207275a, 0xdb5408ef, 0x1769450f, 0x1b1b5518, 0x210b1f57, 0x5e4c8001,
+ 0x55012006, 0x802107f1, 0x0a306a80, 0x45808021, 0x0d850b88, 0x31744f18, 0x1808ec54, 0x2009575b, 0x45ffa505, 0x1b420c73, 0x180f9f0f, 0x4a0cf748,
+ 0x501805b2, 0x00210f40, 0x4d118f80, 0xd6823359, 0x072b5118, 0x314ad7aa, 0x8fc79f08, 0x45d78b1f, 0xfe20058f, 0x23325118, 0x7b54d9b5, 0x9fc38f46,
+ 0x10bb410f, 0x41077b42, 0xc1410faf, 0x27cf441d, 0x46051b4f, 0x04200683, 0x2121d344, 0x8f530043, 0x8fcf9f0e, 0x21df8c1f, 0x50188000, 0x5d180e52,
+ 0xfd201710, 0x4405c341, 0xd68528e3, 0x20071f6b, 0x1b734305, 0x6b080957, 0x7d422b1f, 0x67002006, 0x7f8317b1, 0x2024cb48, 0x08676e00, 0x8749a39b,
+ 0x18132006, 0x410a6370, 0x8f490b47, 0x7e1f8f13, 0x551805c3, 0x4c180915, 0xfe200e2f, 0x244d5d18, 0x270bcf44, 0xff000019, 0x04800380, 0x5f253342,
+ 0xff520df7, 0x13274c18, 0x5542dd93, 0x0776181b, 0xf94a1808, 0x084a4c0c, 0x4308ea5b, 0xde831150, 0x7900fd21, 0x00492c1e, 0x060f4510, 0x17410020,
+ 0x0ce74526, 0x6206b341, 0x1f561083, 0x9d6c181b, 0x08a0500e, 0x112e4118, 0x60000421, 0xbf901202, 0x4408e241, 0xc7ab0513, 0xb40f0950, 0x055943c7,
+ 0x4f18ff20, 0xc9ae1cad, 0x32b34f18, 0x7a180120, 0x3d520a05, 0x53d1b40a, 0x80200813, 0x1b815018, 0x832bf86f, 0x67731847, 0x297f4308, 0x6418d54e,
+ 0x734213f7, 0x056b4b27, 0xdba5fe20, 0x1828aa4e, 0x2031a370, 0x06cb6101, 0x2040ad41, 0x07365300, 0x2558d985, 0x83fe200c, 0x0380211c, 0x542c4743,
+ 0x052006b7, 0x6021df45, 0x897b0707, 0x18d3c010, 0x20090e70, 0x1d5843ff, 0x540a0e44, 0x002126c5, 0x322f7416, 0x636a5720, 0x0f317409, 0x610fe159,
+ 0x294617e7, 0x08555213, 0x2006a75d, 0x6cec84fd, 0xfb5907be, 0x3a317405, 0x83808021, 0x180f20ea, 0x4626434a, 0x531818e3, 0xdb59172d, 0x0cbb460c,
+ 0x2013d859, 0x18b94502, 0x8f46188d, 0x77521842, 0x0a184e38, 0x9585fd20, 0x6a180684, 0xc64507e9, 0x51cbb230, 0xd3440cf3, 0x17ff6a0f, 0x450f5b42,
+ 0x276407c1, 0x4853180a, 0x21ccb010, 0xcf580013, 0x0c15442d, 0x410a1144, 0x1144359d, 0x5cfe2006, 0xa1410a43, 0x2bb64519, 0x2f5b7618, 0xb512b745,
+ 0x0cfd6fd1, 0x42089f59, 0xb8450c70, 0x0000232d, 0x50180900, 0xb9491ae3, 0x0fc37610, 0x01210f83, 0x0f3b4100, 0xa01b2742, 0x0ccd426f, 0x6e8f6f94,
+ 0x9c808021, 0xc7511870, 0x17c74b08, 0x9b147542, 0x44fe2079, 0xd5480c7e, 0x95ef861d, 0x101b597b, 0xf5417594, 0x9f471808, 0x86868d0e, 0x3733491c,
+ 0x690f4d6d, 0x43440b83, 0x1ba94c0b, 0x660cd16b, 0x802008ae, 0x74126448, 0xcb4f38a3, 0x2cb74b0b, 0x47137755, 0xe3971777, 0x1b5d0120, 0x057a4108,
+ 0x6e08664d, 0x17421478, 0x11af4208, 0x850c3f42, 0x08234f0c, 0x4321eb4a, 0xf3451095, 0x0f394e0f, 0x4310eb45, 0xc09707b1, 0x54431782, 0xaec08d1d,
+ 0x0f434dbb, 0x9f0c0b45, 0x0a3b4dbb, 0x4618bdc7, 0x536032eb, 0x17354213, 0x4d134169, 0xc7a30c2f, 0x4e254342, 0x174332cf, 0x43cdae17, 0x6b4706e4,
+ 0x0e16430d, 0x530b5542, 0x2f7c26bb, 0x13075f31, 0x43175342, 0x60181317, 0x6550114e, 0x28624710, 0x58070021, 0x59181683, 0x2d540cf5, 0x05d5660c,
+ 0x20090c7b, 0x0e157e02, 0x8000ff2b, 0x14000080, 0x80ff8000, 0x27137e03, 0x336a4b20, 0x0f817107, 0x13876e18, 0x730f2f7e, 0x2f450b75, 0x6d02200b,
+ 0x6d66094c, 0x4b802009, 0x15820a02, 0x2f45fe20, 0x5e032006, 0x00202fd9, 0x450af741, 0xeb412e0f, 0x0ff3411f, 0x420a8b65, 0xf7410eae, 0x1c664810,
+ 0x540e1145, 0xbfa509f3, 0x42302f58, 0x80200c35, 0xcb066c47, 0x4b1120c1, 0x41492abb, 0x34854110, 0xa7097b72, 0x251545c7, 0x4b2c7f56, 0xc5b40bab,
+ 0x940cd54e, 0x2e6151c8, 0x09f35f18, 0x4b420420, 0x09677121, 0x8f24f357, 0x1b5418e1, 0x08915a1f, 0x3143d894, 0x22541805, 0x1b9b4b0e, 0x8c0d3443,
+ 0x1400240d, 0x18ff8000, 0x582e6387, 0xf99b2b3b, 0x8807a550, 0x17a14790, 0x2184fd20, 0x5758fe20, 0x2354882c, 0x15000080, 0x5e056751, 0x334c2c2f,
+ 0x97c58f0c, 0x1fd7410f, 0x0d4d4018, 0x4114dc41, 0x04470ed6, 0x0dd54128, 0x00820020, 0x02011523, 0x22008700, 0x86480024, 0x0001240a, 0x8682001a,
+ 0x0002240b, 0x866c000e, 0x8a03200b, 0x8a042017, 0x0005220b, 0x22218614, 0x84060000, 0x86012017, 0x8212200f, 0x250b8519, 0x000d0001, 0x0b850031,
+ 0x07000224, 0x0b862600, 0x11000324, 0x0b862d00, 0x238a0420, 0x0a000524, 0x17863e00, 0x17840620, 0x01000324, 0x57820904, 0x0b85a783, 0x0b85a785,
+ 0x0b85a785, 0x22000325, 0x85007a00, 0x85a7850b, 0x85a7850b, 0x22a7850b, 0x82300032, 0x00342201, 0x0805862f, 0x35003131, 0x54207962, 0x74736972,
+ 0x47206e61, 0x6d6d6972, 0x65527265, 0x616c7567, 0x58545472, 0x6f725020, 0x43796767, 0x6e61656c, 0x30325454, 0x822f3430, 0x35313502, 0x79006200,
+ 0x54002000, 0x69007200, 0x74007300, 0x6e006100, 0x47200f82, 0x6d240f84, 0x65006d00, 0x52200982, 0x67240582, 0x6c007500, 0x72201d82, 0x54222b82,
+ 0x23825800, 0x19825020, 0x67006f22, 0x79220182, 0x1b824300, 0x3b846520, 0x1f825420, 0x41000021, 0x1422099b, 0x0b410000, 0x87088206, 0x01012102,
+ 0x78080982, 0x01020101, 0x01040103, 0x01060105, 0x01080107, 0x010a0109, 0x010c010b, 0x010e010d, 0x0110010f, 0x01120111, 0x01140113, 0x01160115,
+ 0x01180117, 0x011a0119, 0x011c011b, 0x011e011d, 0x0020011f, 0x00040003, 0x00060005, 0x00080007, 0x000a0009, 0x000c000b, 0x000e000d, 0x0010000f,
+ 0x00120011, 0x00140013, 0x00160015, 0x00180017, 0x001a0019, 0x001c001b, 0x001e001d, 0x08bb821f, 0x22002142, 0x24002300, 0x26002500, 0x28002700,
+ 0x2a002900, 0x2c002b00, 0x2e002d00, 0x30002f00, 0x32003100, 0x34003300, 0x36003500, 0x38003700, 0x3a003900, 0x3c003b00, 0x3e003d00, 0x40003f00,
+ 0x42004100, 0x4b09f382, 0x00450044, 0x00470046, 0x00490048, 0x004b004a, 0x004d004c, 0x004f004e, 0x00510050, 0x00530052, 0x00550054, 0x00570056,
+ 0x00590058, 0x005b005a, 0x005d005c, 0x005f005e, 0x01610060, 0x01220121, 0x01240123, 0x01260125, 0x01280127, 0x012a0129, 0x012c012b, 0x012e012d,
+ 0x0130012f, 0x01320131, 0x01340133, 0x01360135, 0x01380137, 0x013a0139, 0x013c013b, 0x013e013d, 0x0140013f, 0x00ac0041, 0x008400a3, 0x00bd0085,
+ 0x00e80096, 0x008e0086, 0x009d008b, 0x00a400a9, 0x008a00ef, 0x008300da, 0x00f20093, 0x008d00f3, 0x00880097, 0x00de00c3, 0x009e00f1, 0x00f500aa,
+ 0x00f600f4, 0x00ad00a2, 0x00c700c9, 0x006200ae, 0x00900063, 0x00cb0064, 0x00c80065, 0x00cf00ca, 0x00cd00cc, 0x00e900ce, 0x00d30066, 0x00d100d0,
+ 0x006700af, 0x009100f0, 0x00d400d6, 0x006800d5, 0x00ed00eb, 0x006a0089, 0x006b0069, 0x006c006d, 0x00a0006e, 0x0071006f, 0x00720070, 0x00750073,
+ 0x00760074, 0x00ea0077, 0x007a0078, 0x007b0079, 0x007c007d, 0x00a100b8, 0x007e007f, 0x00810080, 0x00ee00ec, 0x6e750eba, 0x646f6369, 0x78302365,
+ 0x31303030, 0x32200e8d, 0x33200e8d, 0x34200e8d, 0x35200e8d, 0x36200e8d, 0x37200e8d, 0x38200e8d, 0x39200e8d, 0x61200e8d, 0x62200e8d, 0x63200e8d,
+ 0x64200e8d, 0x65200e8d, 0x66200e8d, 0x31210e8c, 0x8d0e8d30, 0x8d3120ef, 0x8d3120ef, 0x8d3120ef, 0x8d3120ef, 0x8d3120ef, 0x8d3120ef, 0x8d3120ef,
+ 0x8d3120ef, 0x8d3120ef, 0x8d3120ef, 0x8d3120ef, 0x8d3120ef, 0x8d3120ef, 0x66312def, 0x6c656406, 0x04657465, 0x6f727545, 0x3820ec8c, 0x3820ec8d,
+ 0x3820ec8d, 0x3820ec8d, 0x3820ec8d, 0x3820ec8d, 0x3820ec8d, 0x3820ec8d, 0x3820ec8d, 0x3820ec8d, 0x3820ec8d, 0x3820ec8d, 0x3820ec8d, 0x3820ec8d,
+ 0x3820ec8d, 0x200ddc41, 0x0ddc4139, 0xef8d3920, 0xef8d3920, 0xef8d3920, 0xef8d3920, 0xef8d3920, 0xef8d3920, 0xef8d3920, 0xef8d3920, 0xef8d3920,
+ 0xef8d3920, 0xef8d3920, 0xef8d3920, 0xef8d3920, 0xef8d3920, 0x00663923, 0x48fa0500, 0x00f762f9,
};
static void GetDefaultCompressedFontDataTTF(const void** ttf_compressed_data, unsigned int* ttf_compressed_size)
diff --git a/3rdparty/bgfx/3rdparty/ocornut-imgui/imgui.h b/3rdparty/bgfx/3rdparty/ocornut-imgui/imgui.h
index ba4fa75ce23..cd94ff36129 100644
--- a/3rdparty/bgfx/3rdparty/ocornut-imgui/imgui.h
+++ b/3rdparty/bgfx/3rdparty/ocornut-imgui/imgui.h
@@ -1,5 +1,5 @@
-// ImGui library v1.30
-// See .cpp file for commentary.
+// ImGui library v1.32 wip
+// See .cpp file for documentation.
// See ImGui::ShowTestWindow() for sample code.
// Read 'Programmer guide' in .cpp for notes on how to setup ImGui in your codebase.
// Get latest version at https://github.com/ocornut/imgui
@@ -43,7 +43,7 @@ typedef int ImGuiColorEditMode; // enum ImGuiColorEditMode_
typedef int ImGuiWindowFlags; // enum ImGuiWindowFlags_
typedef int ImGuiSetCondition; // enum ImGuiSetCondition_
typedef int ImGuiInputTextFlags; // enum ImGuiInputTextFlags_
-struct ImGuiTextEditCallbackData; // for advanced uses of InputText()
+struct ImGuiTextEditCallbackData; // for advanced uses of InputText()
struct ImVec2
{
@@ -69,13 +69,12 @@ struct ImVec4
namespace ImGui
{
- // Proxy functions to access the MemAllocFn/MemFreeFn/MemReallocFn pointers in ImGui::GetIO(). The only reason they exist here is to allow ImVector<> to compile inline.
+ // Proxy functions to access the MemAllocFn/MemFreeFn pointers in ImGui::GetIO(). The only reason they exist here is to allow ImVector<> to compile inline.
IMGUI_API void* MemAlloc(size_t sz);
IMGUI_API void MemFree(void* ptr);
- IMGUI_API void* MemRealloc(void* ptr, size_t sz);
}
-// std::vector<> like class to avoid dragging dependencies (also: windows implementation of STL with debug enabled is absurdly slow, so let's bypass it so our code runs fast in debug).
+// std::vector<> like class to avoid dragging dependencies (also: windows implementation of STL with debug enabled is absurdly slow, so let's bypass it so our code runs fast in debug).
// Use '#define ImVector std::vector' if you want to use the STL type or your own type.
// Our implementation does NOT call c++ constructors! because the data types we use don't need them (but that could be added as well). Only provide the minimum functionalities we need.
#ifndef ImVector
@@ -115,8 +114,16 @@ public:
inline const value_type& back() const { IM_ASSERT(Size > 0); return Data[Size-1]; }
inline void swap(ImVector<T>& rhs) { const size_t rhs_size = rhs.Size; rhs.Size = Size; Size = rhs_size; const size_t rhs_cap = rhs.Capacity; rhs.Capacity = Capacity; Capacity = rhs_cap; value_type* rhs_data = rhs.Data; rhs.Data = Data; Data = rhs_data; }
- inline void reserve(size_t new_capacity) { Data = (value_type*)ImGui::MemRealloc(Data, new_capacity * sizeof(value_type)); Capacity = new_capacity; }
inline void resize(size_t new_size) { if (new_size > Capacity) reserve(new_size); Size = new_size; }
+ inline void reserve(size_t new_capacity)
+ {
+ if (new_capacity <= Capacity) return;
+ T* new_data = (value_type*)ImGui::MemAlloc(new_capacity * sizeof(value_type));
+ memcpy(new_data, Data, Size * sizeof(value_type));
+ ImGui::MemFree(Data);
+ Data = new_data;
+ Capacity = new_capacity;
+ }
inline void push_back(const value_type& v) { if (Size == Capacity) reserve(Capacity ? Capacity * 2 : 4); Data[Size++] = v; }
inline void pop_back() { IM_ASSERT(Size > 0); Size--; }
@@ -152,25 +159,26 @@ namespace ImGui
IMGUI_API bool Begin(const char* name = "Debug", bool* p_opened = NULL, ImVec2 size = ImVec2(0,0), float fill_alpha = -1.0f, ImGuiWindowFlags flags = 0);// return false when window is collapsed, so you can early out in your code. passing 'bool* p_opened' displays a Close button on the upper-right corner of the window, the pointed value will be set to false when the button is pressed.
IMGUI_API void End();
IMGUI_API void BeginChild(const char* str_id, ImVec2 size = ImVec2(0,0), bool border = false, ImGuiWindowFlags extra_flags = 0); // size==0.0f: use remaining window size, size<0.0f: use remaining window size minus abs(size). on each axis.
+ IMGUI_API void BeginChild(ImGuiID id, ImVec2 size = ImVec2(0,0), bool border = false, ImGuiWindowFlags extra_flags = 0); // "
IMGUI_API void EndChild();
IMGUI_API bool GetWindowIsFocused();
- IMGUI_API ImVec2 GetContentRegionMax(); // window or current column boundaries
- IMGUI_API ImVec2 GetWindowContentRegionMin(); // window boundaries
+ IMGUI_API ImVec2 GetContentRegionMax(); // window or current column boundaries, in windows coordinates
+ IMGUI_API ImVec2 GetWindowContentRegionMin(); // window boundaries, in windows coordinates
IMGUI_API ImVec2 GetWindowContentRegionMax();
IMGUI_API ImDrawList* GetWindowDrawList(); // get rendering command-list if you want to append your own draw primitives.
IMGUI_API ImFont* GetWindowFont();
- IMGUI_API float GetWindowFontSize();
+ IMGUI_API float GetWindowFontSize(); // size (also height in pixels) of current font with current scale applied
IMGUI_API void SetWindowFontScale(float scale); // per-window font scale. Adjust IO.FontGlobalScale if you want to scale all windows.
IMGUI_API ImVec2 GetWindowPos(); // you should rarely need/care about the window position, but it can be useful if you want to do your own drawing.
IMGUI_API ImVec2 GetWindowSize(); // get current window position.
IMGUI_API float GetWindowWidth();
IMGUI_API bool GetWindowCollapsed();
- IMGUI_API void SetWindowPos(const ImVec2& pos, ImGuiSetCondition cond = 0); // set current window position - call within Begin()/End().
- IMGUI_API void SetWindowSize(const ImVec2& size, ImGuiSetCondition cond = 0); // set current window size. set to ImVec2(0,0) to force an auto-fit
- IMGUI_API void SetWindowCollapsed(bool collapsed, ImGuiSetCondition cond = 0); // set current window collapsed state.
IMGUI_API void SetNextWindowPos(const ImVec2& pos, ImGuiSetCondition cond = 0); // set next window position - call before Begin().
- IMGUI_API void SetNextWindowSize(const ImVec2& size, ImGuiSetCondition cond = 0); // set next window size. set to ImVec2(0,0) to force an auto-fit
+ IMGUI_API void SetNextWindowSize(const ImVec2& size, ImGuiSetCondition cond = 0); // set next window size. set to ImVec2(0,0) to force an auto-fit.
IMGUI_API void SetNextWindowCollapsed(bool collapsed, ImGuiSetCondition cond = 0); // set next window collapsed state.
+ IMGUI_API void SetWindowPos(const ImVec2& pos, ImGuiSetCondition cond = 0); // set current window position - call within Begin()/End(). may incur tearing.
+ IMGUI_API void SetWindowSize(const ImVec2& size, ImGuiSetCondition cond = 0); // set current window size. set to ImVec2(0,0) to force an auto-fit. may incur tearing.
+ IMGUI_API void SetWindowCollapsed(bool collapsed, ImGuiSetCondition cond = 0); // set current window collapsed state.
IMGUI_API void SetScrollPosHere(); // adjust scrolling position to center into the current cursor position.
IMGUI_API void SetKeyboardFocusHere(int offset = 0); // focus keyboard on the next widget. Use positive 'offset' to access sub components of a multiple component widget.
@@ -187,9 +195,9 @@ namespace ImGui
IMGUI_API void PopStyleVar(int count = 1);
// Parameters stacks (current window)
- IMGUI_API void PushItemWidth(float item_width); // width of items for the common item+label case. default to ~2/3 of windows width.
+ IMGUI_API void PushItemWidth(float item_width); // width of items for the common item+label case, pixels. 0.0f = default to ~2/3 of windows width, >0.0f: width in pixels, <0.0f align xx pixels to the right of window (so -0.01f always align width to the right side)
IMGUI_API void PopItemWidth();
- IMGUI_API float GetItemWidth();
+ IMGUI_API float CalcItemWidth(); // width of item given pushed settings and current cursor position
IMGUI_API void PushAllowKeyboardFocus(bool v); // allow focusing using TAB/Shift-TAB, enabled by default but you can disable it for certain widgets.
IMGUI_API void PopAllowKeyboardFocus();
IMGUI_API void PushTextWrapPos(float wrap_pos_x = 0.0f); // word-wrapping for Text*() commands. < 0.0f: no wrapping; 0.0f: wrap to end of window (or column); > 0.0f: wrap at 'wrap_pos_x' position in window local space.
@@ -211,14 +219,16 @@ namespace ImGui
IMGUI_API void SetColumnOffset(int column_index, float offset);
IMGUI_API float GetColumnWidth(int column_index = -1);
IMGUI_API ImVec2 GetCursorPos(); // cursor position is relative to window position
+ IMGUI_API float GetCursorPosX(); // "
+ IMGUI_API float GetCursorPosY(); // "
IMGUI_API void SetCursorPos(const ImVec2& pos); // "
IMGUI_API void SetCursorPosX(float x); // "
IMGUI_API void SetCursorPosY(float y); // "
IMGUI_API ImVec2 GetCursorScreenPos(); // cursor position in absolute screen coordinates (0..io.DisplaySize)
IMGUI_API void SetCursorScreenPos(const ImVec2& pos); // cursor position in absolute screen coordinates (0..io.DisplaySize)
IMGUI_API void AlignFirstTextHeightToWidgets(); // call once if the first item on the line is a Text() item and you want to vertically lower it to match subsequent (bigger) widgets.
- IMGUI_API float GetTextLineSpacing();
- IMGUI_API float GetTextLineHeight();
+ IMGUI_API float GetTextLineHeight(); // height of font == GetWindowFontSize()
+ IMGUI_API float GetTextLineHeightWithSpacing(); // spacing (in pixels) between 2 consecutive lines of text == GetWindowFontSize() + GetStyle().ItemSpacing.y
// ID scopes
// If you are creating repeated widgets in a loop you most likely want to push a unique identifier so ImGui can differentiate them.
@@ -238,7 +248,7 @@ namespace ImGui
IMGUI_API void TextWrapped(const char* fmt, ...); // shortcut for PushTextWrapPos(0.0f); Text(fmt, ...); PopTextWrapPos();
IMGUI_API void TextWrappedV(const char* fmt, va_list args);
IMGUI_API void TextUnformatted(const char* text, const char* text_end = NULL); // doesn't require null terminated string if 'text_end' is specified. no copy done to any bounded stack buffer, recommended for long chunks of text.
- IMGUI_API void LabelText(const char* label, const char* fmt, ...); // display text+label aligned the same way as value+label widgets
+ IMGUI_API void LabelText(const char* label, const char* fmt, ...); // display text+label aligned the same way as value+label widgets
IMGUI_API void LabelTextV(const char* label, const char* fmt, va_list args);
IMGUI_API void BulletText(const char* fmt, ...);
IMGUI_API void BulletTextV(const char* fmt, va_list args);
@@ -246,7 +256,7 @@ namespace ImGui
IMGUI_API bool SmallButton(const char* label);
IMGUI_API bool InvisibleButton(const char* str_id, const ImVec2& size);
IMGUI_API void Image(ImTextureID user_texture_id, const ImVec2& size, const ImVec2& uv0 = ImVec2(0,0), const ImVec2& uv1 = ImVec2(1,1), const ImVec4& tint_col = ImVec4(1,1,1,1), const ImVec4& border_col = ImVec4(0,0,0,0));
- IMGUI_API bool ImageButton(ImTextureID user_texture_id, const ImVec2& size, const ImVec2& uv0 = ImVec2(0,0), const ImVec2& uv1 = ImVec2(1,1), int frame_padding = -1, const ImVec4& bg_col = ImVec4(0,0,0,1)); // <0 frame_padding uses default frame padding settings. 0 for no paddnig.
+ IMGUI_API bool ImageButton(ImTextureID user_texture_id, const ImVec2& size, const ImVec2& uv0 = ImVec2(0,0), const ImVec2& uv1 = ImVec2(1,1), int frame_padding = -1, const ImVec4& bg_col = ImVec4(0,0,0,1), const ImVec4& tint_col = ImVec4(1,1,1,1)); // <0 frame_padding uses default frame padding settings. 0 for no paddnig.
IMGUI_API bool CollapsingHeader(const char* label, const char* str_id = NULL, const bool display_frame = true, const bool default_open = false);
IMGUI_API bool SliderFloat(const char* label, float* v, float v_min, float v_max, const char* display_format = "%.3f", float power = 1.0f); // adjust display_format to decorate the value with a prefix or a suffix. Use power!=1.0 for logarithmic sliders.
IMGUI_API bool SliderFloat2(const char* label, float v[2], float v_min, float v_max, const char* display_format = "%.3f", float power = 1.0f);
@@ -271,9 +281,9 @@ namespace ImGui
IMGUI_API bool InputFloat3(const char* label, float v[3], int decimal_precision = -1);
IMGUI_API bool InputFloat4(const char* label, float v[4], int decimal_precision = -1);
IMGUI_API bool InputInt(const char* label, int* v, int step = 1, int step_fast = 100, ImGuiInputTextFlags extra_flags = 0);
- IMGUI_API bool Combo(const char* label, int* current_item, const char** items, int items_count, int popup_height_items = 7);
- IMGUI_API bool Combo(const char* label, int* current_item, const char* items_separated_by_zeros, int popup_height_items = 7); // separate items with \0, end item-list with \0\0
- IMGUI_API bool Combo(const char* label, int* current_item, bool (*items_getter)(void* data, int idx, const char** out_text), void* data, int items_count, int popup_height_items = 7);
+ IMGUI_API bool Combo(const char* label, int* current_item, const char** items, int items_count, int height_in_items = -1);
+ IMGUI_API bool Combo(const char* label, int* current_item, const char* items_separated_by_zeros, int height_in_items = -1); // separate items with \0, end item-list with \0\0
+ IMGUI_API bool Combo(const char* label, int* current_item, bool (*items_getter)(void* data, int idx, const char** out_text), void* data, int items_count, int height_in_items = -1);
IMGUI_API bool ColorButton(const ImVec4& col, bool small_height = false, bool outline_border = true);
IMGUI_API bool ColorEdit3(const char* label, float col[3]);
IMGUI_API bool ColorEdit4(const char* label, float col[4], bool show_alpha = true);
@@ -288,6 +298,15 @@ namespace ImGui
IMGUI_API void TreePop();
IMGUI_API void OpenNextNode(bool open); // force open/close the next TreeNode or CollapsingHeader
+ // Selectable / Lists
+ IMGUI_API bool Selectable(const char* label, bool selected, const ImVec2& size = ImVec2(0,0));
+ IMGUI_API bool Selectable(const char* label, bool* p_selected, const ImVec2& size = ImVec2(0,0));
+ IMGUI_API bool ListBox(const char* label, int* current_item, const char** items, int items_count, int height_in_items = -1);
+ IMGUI_API bool ListBox(const char* label, int* current_item, bool (*items_getter)(void* data, int idx, const char** out_text), void* data, int items_count, int height_in_items = -1);
+ IMGUI_API bool ListBoxHeader(const char* label, const ImVec2& size = ImVec2(0,0)); // use if you want to reimplement ListBox() will custom data or interactions. make sure to call ListBoxFooter() afterwards.
+ IMGUI_API bool ListBoxHeader(const char* label, int items_count, int height_in_items = -1); // "
+ IMGUI_API void ListBoxFooter(); // terminate the scrolling region
+
// Value() Helpers: output single value in "name: value" format. Tip: freely declare your own within the ImGui namespace!
IMGUI_API void Value(const char* prefix, bool b);
IMGUI_API void Value(const char* prefix, int v);
@@ -322,11 +341,20 @@ namespace ImGui
IMGUI_API int GetFrameCount();
IMGUI_API const char* GetStyleColName(ImGuiCol idx);
IMGUI_API ImVec2 CalcTextSize(const char* text, const char* text_end = NULL, bool hide_text_after_double_hash = false, float wrap_width = -1.0f);
+ IMGUI_API void CalcListClipping(int items_count, float items_height, int* out_items_display_start, int* out_items_display_end); // helper to manually clip large list of items. see comments in implementation.
+
+ IMGUI_API void BeginChildFrame(ImGuiID id, const ImVec2& size); // helper to create a child window / scrolling region that looks like a normal widget frame.
+ IMGUI_API void EndChildFrame();
IMGUI_API ImU32 ColorConvertFloat4ToU32(const ImVec4& in);
IMGUI_API void ColorConvertRGBtoHSV(float r, float g, float b, float& out_h, float& out_s, float& out_v);
IMGUI_API void ColorConvertHSVtoRGB(float h, float s, float v, float& out_r, float& out_g, float& out_b);
+ // Internal state access - if you want to share ImGui state between modules (e.g. DLL) or allocate it yourself
+ IMGUI_API void* GetInternalState();
+ IMGUI_API size_t GetInternalStateSize();
+ IMGUI_API void SetInternalState(void* state, bool construct = false);
+
// Obsolete (will be removed)
IMGUI_API void GetDefaultFontData(const void** fnt_data, unsigned int* fnt_size, const void** png_data, unsigned int* png_size);
@@ -336,19 +364,21 @@ namespace ImGui
enum ImGuiWindowFlags_
{
// Default: 0
- ImGuiWindowFlags_ShowBorders = 1 << 0,
- ImGuiWindowFlags_NoTitleBar = 1 << 1,
- ImGuiWindowFlags_NoResize = 1 << 2,
- ImGuiWindowFlags_NoMove = 1 << 3,
- ImGuiWindowFlags_NoScrollbar = 1 << 4,
- ImGuiWindowFlags_NoScrollWithMouse = 1 << 5,
- ImGuiWindowFlags_AlwaysAutoResize = 1 << 6,
- ImGuiWindowFlags_NoSavedSettings = 1 << 7, // Never load/save settings in .ini file
- ImGuiWindowFlags_ChildWindow = 1 << 8, // For internal use by BeginChild()
- ImGuiWindowFlags_ChildWindowAutoFitX = 1 << 9, // For internal use by BeginChild()
- ImGuiWindowFlags_ChildWindowAutoFitY = 1 << 10, // For internal use by BeginChild()
- ImGuiWindowFlags_ComboBox = 1 << 11, // For internal use by ComboBox()
- ImGuiWindowFlags_Tooltip = 1 << 12 // For internal use by Render() when using Tooltip
+ ImGuiWindowFlags_NoTitleBar = 1 << 0, // Disable title-bar
+ ImGuiWindowFlags_NoResize = 1 << 1, // Disable user resizing with the lower-right grip
+ ImGuiWindowFlags_NoMove = 1 << 2, // Disable user moving the window
+ ImGuiWindowFlags_NoScrollbar = 1 << 3, // Disable scroll bar (window can still scroll with mouse or programatically)
+ ImGuiWindowFlags_NoScrollWithMouse = 1 << 4, // Disable user scrolling with mouse wheel
+ ImGuiWindowFlags_NoCollapse = 1 << 5, // Disable user collapsing window by double-clicking on it
+ ImGuiWindowFlags_AlwaysAutoResize = 1 << 6, // Resize every window to its content every frame
+ ImGuiWindowFlags_ShowBorders = 1 << 7, // Show borders around windows and items
+ ImGuiWindowFlags_NoSavedSettings = 1 << 8, // Never load/save settings in .ini file
+ // [Internal]
+ ImGuiWindowFlags_ChildWindow = 1 << 9, // For internal use by BeginChild()
+ ImGuiWindowFlags_ChildWindowAutoFitX = 1 << 10, // For internal use by BeginChild()
+ ImGuiWindowFlags_ChildWindowAutoFitY = 1 << 11, // For internal use by BeginChild()
+ ImGuiWindowFlags_ComboBox = 1 << 12, // For internal use by ComboBox()
+ ImGuiWindowFlags_Tooltip = 1 << 13 // For internal use by BeginTooltip()
};
// Flags for ImGui::InputText()
@@ -393,6 +423,7 @@ enum ImGuiCol_
{
ImGuiCol_Text,
ImGuiCol_WindowBg,
+ ImGuiCol_ChildWindowBg,
ImGuiCol_Border,
ImGuiCol_BorderShadow,
ImGuiCol_FrameBg, // Background of checkbox, radio button, plot, slider, text input
@@ -436,14 +467,15 @@ enum ImGuiCol_
// NB: the enum only refers to fields of ImGuiStyle() which makes sense to be pushed/poped in UI code. Feel free to add others.
enum ImGuiStyleVar_
{
- ImGuiStyleVar_Alpha, // float
- ImGuiStyleVar_WindowPadding, // ImVec2
- ImGuiStyleVar_WindowRounding, // float
- ImGuiStyleVar_FramePadding, // ImVec2
- ImGuiStyleVar_FrameRounding, // float
- ImGuiStyleVar_ItemSpacing, // ImVec2
- ImGuiStyleVar_ItemInnerSpacing, // ImVec2
- ImGuiStyleVar_TreeNodeSpacing // float
+ ImGuiStyleVar_Alpha, // float
+ ImGuiStyleVar_WindowPadding, // ImVec2
+ ImGuiStyleVar_WindowRounding, // float
+ ImGuiStyleVar_ChildWindowRounding, // float
+ ImGuiStyleVar_FramePadding, // ImVec2
+ ImGuiStyleVar_FrameRounding, // float
+ ImGuiStyleVar_ItemSpacing, // ImVec2
+ ImGuiStyleVar_ItemInnerSpacing, // ImVec2
+ ImGuiStyleVar_TreeNodeSpacing // float
};
// Enumeration for ColorEditMode()
@@ -471,6 +503,7 @@ struct ImGuiStyle
ImVec2 WindowPadding; // Padding within a window
ImVec2 WindowMinSize; // Minimum window size
float WindowRounding; // Radius of window corners rounding. Set to 0.0f to have rectangular windows
+ float ChildWindowRounding; // Radius of child window corners rounding. Set to 0.0f to have rectangular windows
ImVec2 FramePadding; // Padding within a framed rectangle (used by most widgets)
float FrameRounding; // Radius of frame corners rounding. Set to 0.0f to have rectangular frame (used by most widgets).
ImVec2 ItemSpacing; // Horizontal and vertical spacing between widgets/lines
@@ -514,18 +547,17 @@ struct ImGuiIO
// User Functions
//------------------------------------------------------------------
- // REQUIRED: rendering function.
+ // REQUIRED: rendering function.
// See example code if you are unsure of how to implement this.
- void (*RenderDrawListsFn)(ImDrawList** const draw_lists, int count);
+ void (*RenderDrawListsFn)(ImDrawList** const draw_lists, int count);
// Optional: access OS clipboard (default to use native Win32 clipboard on Windows, otherwise use a ImGui private clipboard)
// Override to access OS clipboard on other architectures.
const char* (*GetClipboardTextFn)();
void (*SetClipboardTextFn)(const char* text);
- // Optional: override memory allocations (default to posix malloc/realloc/free)
+ // Optional: override memory allocations (default to posix malloc/free). MemFreeFn() may be called with a NULL pointer.
void* (*MemAllocFn)(size_t sz);
- void* (*MemReallocFn)(void* ptr, size_t sz);
void (*MemFreeFn)(void* ptr);
// Optional: notify OS Input Method Editor of the screen position of your cursor for text input position (e.g. when using Japanese/Chinese inputs in Windows)
@@ -537,7 +569,7 @@ struct ImGuiIO
ImVec2 MousePos; // Mouse position, in pixels (set to -1,-1 if no mouse / on another screen, etc.)
bool MouseDown[5]; // Mouse buttons. ImGui itself only uses button 0 (left button) but you can use others as storage for convenience.
- float MouseWheel; // Mouse wheel: 1 unit scrolls about 5 lines text.
+ float MouseWheel; // Mouse wheel: 1 unit scrolls about 5 lines text.
bool MouseDrawCursor; // Request ImGui to draw a mouse cursor for you (if you are on a platform without a mouse cursor).
bool KeyCtrl; // Keyboard modifier pressed: Control
bool KeyShift; // Keyboard modifier pressed: Shift
@@ -558,14 +590,15 @@ struct ImGuiIO
// [Internal] ImGui will maintain those fields for you
//------------------------------------------------------------------
- ImVec2 MousePosPrev;
- ImVec2 MouseDelta;
- bool MouseClicked[5];
- ImVec2 MouseClickedPos[5];
- float MouseClickedTime[5];
- bool MouseDoubleClicked[5];
- float MouseDownTime[5];
- float KeysDownTime[512];
+ ImVec2 MousePosPrev; //
+ ImVec2 MouseDelta; // Mouse delta. Note that this is zero if either current or previous position are negative to allow mouse enabling/disabling.
+ bool MouseClicked[5]; // Mouse button went from !Down to Down
+ ImVec2 MouseClickedPos[5]; // Position at time of clicking
+ float MouseClickedTime[5]; // Time of last click (used to figure out double-click)
+ bool MouseDoubleClicked[5]; // Has mouse button been double-clicked?
+ bool MouseDownOwned[5]; // Track if button was clicked inside a window. We don't request mouse capture from the application if click started outside ImGui bounds.
+ float MouseDownTime[5]; // Time the mouse button has been down
+ float KeysDownTime[512]; // Time the keyboard key has been down
IMGUI_API ImGuiIO();
};
@@ -647,13 +680,13 @@ struct ImGuiTextBuffer
// - You want to store custom debug data easily without adding or editing structures in your code.
struct ImGuiStorage
{
- struct Pair
- {
- ImGuiID key;
- union { int val_i; float val_f; void* val_p; };
- Pair(ImGuiID _key, int _val_i) { key = _key; val_i = _val_i; }
- Pair(ImGuiID _key, float _val_f) { key = _key; val_f = _val_f; }
- Pair(ImGuiID _key, void* _val_p) { key = _key; val_p = _val_p; }
+ struct Pair
+ {
+ ImGuiID key;
+ union { int val_i; float val_f; void* val_p; };
+ Pair(ImGuiID _key, int _val_i) { key = _key; val_i = _val_i; }
+ Pair(ImGuiID _key, float _val_f) { key = _key; val_f = _val_f; }
+ Pair(ImGuiID _key, void* _val_p) { key = _key; val_p = _val_p; }
};
ImVector<Pair> Data;
@@ -668,7 +701,7 @@ struct ImGuiStorage
IMGUI_API void* GetVoidPtr(ImGuiID key) const; // default_val is NULL
IMGUI_API void SetVoidPtr(ImGuiID key, void* val);
- // - Get***Ref() functions finds pair, insert on demand if missing, return pointer. Useful if you intend to do Get+Set.
+ // - Get***Ref() functions finds pair, insert on demand if missing, return pointer. Useful if you intend to do Get+Set.
// - References are only valid until a new value is added to the storage. Calling a Set***() function or a Get***Ref() function invalidates the pointer.
// - A typical use case where this is convenient:
// float* pvar = ImGui::GetFloatRef(key); ImGui::SliderFloat("var", pvar, 0, 100.0f); some_var += *pvar;
@@ -683,7 +716,7 @@ struct ImGuiStorage
// Shared state of InputText(), passed to callback when a ImGuiInputTextFlags_Callback* flag is used.
struct ImGuiTextEditCallbackData
{
- ImGuiKey EventKey; // Key pressed (Up/Down/TAB) // Read-only
+ ImGuiKey EventKey; // Key pressed (Up/Down/TAB) // Read-only
char* Buf; // Current text // Read-write (pointed data only)
size_t BufSize; // // Read-only
bool BufDirty; // Set if you modify Buf directly // Write
@@ -704,7 +737,7 @@ struct ImColor
{
ImVec4 Value;
- ImColor(int r, int g, int b, int a = 255) { Value.x = r / 255.0f; Value.y = g / 255.0f; Value.z = b / 255.0f; Value.w = a / 255.0f; }
+ ImColor(int r, int g, int b, int a = 255) { Value.x = (float)r / 255.0f; Value.y = (float)g / 255.0f; Value.z = (float)b / 255.0f; Value.w = (float)a / 255.0f; }
ImColor(float r, float g, float b, float a = 1.0f) { Value.x = r; Value.y = g; Value.z = b; Value.w = a; }
ImColor(const ImVec4& col) { Value = col; }
@@ -769,17 +802,17 @@ struct ImDrawList
// [Internal to ImGui]
ImVector<ImVec4> clip_rect_stack; // [Internal]
- ImVector<ImTextureID> texture_id_stack; // [Internal]
+ ImVector<ImTextureID> texture_id_stack; // [Internal]
ImDrawVert* vtx_write; // [Internal] point within vtx_buffer after each add command (to avoid using the ImVector<> operators too much)
ImDrawList() { Clear(); }
IMGUI_API void Clear();
- IMGUI_API void PushClipRect(const ImVec4& clip_rect);
+ IMGUI_API void PushClipRect(const ImVec4& clip_rect); // Scissoring. The values are x1, y1, x2, y2.
IMGUI_API void PopClipRect();
IMGUI_API void PushTextureID(const ImTextureID& texture_id);
IMGUI_API void PopTextureID();
- // Primitives
+ // Primitives
IMGUI_API void AddLine(const ImVec2& a, const ImVec2& b, ImU32 col);
IMGUI_API void AddRect(const ImVec2& a, const ImVec2& b, ImU32 col, float rounding = 0.0f, int rounding_corners=0x0F);
IMGUI_API void AddRectFilled(const ImVec2& a, const ImVec2& b, ImU32 col, float rounding = 0.0f, int rounding_corners=0x0F);
@@ -787,7 +820,7 @@ struct ImDrawList
IMGUI_API void AddCircle(const ImVec2& centre, float radius, ImU32 col, int num_segments = 12);
IMGUI_API void AddCircleFilled(const ImVec2& centre, float radius, ImU32 col, int num_segments = 12);
IMGUI_API void AddArc(const ImVec2& center, float rad, ImU32 col, int a_min, int a_max, bool tris = false, const ImVec2& third_point_offset = ImVec2(0,0));
- IMGUI_API void AddText(ImFont* font, float font_size, const ImVec2& pos, ImU32 col, const char* text_begin, const char* text_end = NULL, float wrap_width = 0.0f);
+ IMGUI_API void AddText(ImFont* font, float font_size, const ImVec2& pos, ImU32 col, const char* text_begin, const char* text_end = NULL, float wrap_width = 0.0f, const ImVec2* cpu_clip_max = NULL);
IMGUI_API void AddImage(ImTextureID user_texture_id, const ImVec2& a, const ImVec2& b, const ImVec2& uv0, const ImVec2& uv1, ImU32 col = 0xFFFFFFFF);
// Advanced
@@ -892,7 +925,7 @@ struct ImFont
// 'wrap_width' enable automatic word-wrapping across multiple lines to fit into given width. 0.0f to disable.
IMGUI_API ImVec2 CalcTextSizeA(float size, float max_width, float wrap_width, const char* text_begin, const char* text_end = NULL, const char** remaining = NULL) const; // utf8
IMGUI_API ImVec2 CalcTextSizeW(float size, float max_width, const ImWchar* text_begin, const ImWchar* text_end, const ImWchar** remaining = NULL) const; // wchar
- IMGUI_API void RenderText(float size, ImVec2 pos, ImU32 col, const ImVec4& clip_rect, const char* text_begin, const char* text_end, ImDrawVert*& out_vertices, float wrap_width = 0.0f) const;
+ IMGUI_API void RenderText(float size, ImVec2 pos, ImU32 col, const ImVec4& clip_rect, const char* text_begin, const char* text_end, ImDrawVert*& out_vertices, float wrap_width = 0.0f, const ImVec2* cpu_clip_max = NULL) const;
IMGUI_API const char* CalcWordWrapPositionA(float scale, const char* text, const char* text_end, float wrap_width) const;
};
diff --git a/3rdparty/bgfx/README.md b/3rdparty/bgfx/README.md
index 96846e87026..e49f6a7bc5f 100644
--- a/3rdparty/bgfx/README.md
+++ b/3rdparty/bgfx/README.md
@@ -52,11 +52,9 @@ Who is using it?
http://airmech.com/ AirMech is a free-to-play futuristic action real-time
strategy video game developed and published by Carbon Games.
-http://theengine.co/ Loom Game Engine developed by The Engine Company. Loom
+http://loomsdk.com/ Loom Game Engine developed by The Engine Company. Loom
is a powerful 2D game engine with live reloading of code and assets, a friendly
-scripting language, and an efficient command-line workflow. Here is video where
-they explain why they choose bgfx over alternatives:
-<a href="https://www.youtube.com/watch?feature=player_embedded&v=PHY_XHkMGIM&t=1m53s" target="_blank"><img src="https://img.youtube.com/vi/PHY_XHkMGIM/0.jpg" alt="Why did you choose bgfx?" width="240" height="180" border="10" /></a>
+scripting language, and an efficient command-line workflow.
https://github.com/dariomanesku/cmftStudio cmftStudio - cubemap filtering tool.
![cmftStudio](https://github.com/dariomanesku/cmftStudio/raw/master/screenshots/cmftStudio_small.jpg)
@@ -71,6 +69,10 @@ very early development and primary focusing on Mac as primary target. This is
how it currently looks.
![mac_screenshot](https://raw.githubusercontent.com/emoon/ProDBG/master/data/screens/mac_screenshot.png)
+
+http://www.dogbytegames.com/ Dogbyte Games is an indie mobile developer studio
+focusing on racing games.
+
Examples
--------
@@ -306,6 +308,9 @@ Dependencies
Building
--------
+Steps bellow are for default build system inside bgfx repository. There is
+alterative way to build bgfx and examples with [fips](https://github.com/floooh/fips-bgfx/#fips-bgfx).
+
### Prerequisites
Windows users download GnuWin32 utilities from:
@@ -741,7 +746,9 @@ language API bindings, WinRT/WinPhone support.
Kai Jourdan ([@questor](https://github.com/questor)) - 23-vectordisplay example
Stanlo Slasinski ([@stanlo](https://github.com/stanlo)) - 24-nbody example
Daniel Collin ([@emoon](https://github.com/emoon)) - Port of Ocornut's ImGui
- to bgfx.
+ to bgfx.
+Andre Weissflog ([@floooh](https://github.com/floooh)) - Alternative build
+system fips.
[License (BSD 2-clause)](https://github.com/bkaradzic/bgfx/blob/master/LICENSE)
-------------------------------------------------------------------------------
diff --git a/3rdparty/bgfx/examples/08-update/update.cpp b/3rdparty/bgfx/examples/08-update/update.cpp
index e151f9ba988..0ed14fa3f9d 100644
--- a/3rdparty/bgfx/examples/08-update/update.cpp
+++ b/3rdparty/bgfx/examples/08-update/update.cpp
@@ -84,7 +84,7 @@ static const uint16_t s_cubeIndices[36] =
9, 10, 11,
12, 14, 13, // 6
- 14, 15, 13,
+ 14, 15, 13,
16, 18, 17, // 8
18, 19, 17,
@@ -96,7 +96,7 @@ static const uint16_t s_cubeIndices[36] =
static void updateTextureCubeRectBgra8(bgfx::TextureHandle _handle, uint8_t _side, uint32_t _x, uint32_t _y, uint32_t _width, uint32_t _height, uint8_t _r, uint8_t _g, uint8_t _b, uint8_t _a = 0xff)
{
bgfx::TextureInfo ti;
- bgfx::calcTextureSize(ti, _width, _height, 1, 1, bgfx::TextureFormat::BGRA8);
+ bgfx::calcTextureSize(ti, _width, _height, 1, 1, false, bgfx::TextureFormat::BGRA8);
const bgfx::Memory* mem = bgfx::alloc(ti.storageSize);
uint8_t* data = (uint8_t*)mem->data;
@@ -285,7 +285,7 @@ int _main_(int /*_argc*/, char** /*_argv*/)
float at[3] = { 0.0f, 0.0f, 0.0f };
float eye[3] = { 0.0f, 0.0f, -5.0f };
-
+
float view[16];
float proj[16];
bx::mtxLookAt(view, eye, at);
@@ -394,7 +394,7 @@ int _main_(int /*_argc*/, char** /*_argv*/)
bgfx::submit(1);
}
- // Advance to next frame. Rendering thread will be kicked to
+ // Advance to next frame. Rendering thread will be kicked to
// process submitted rendering primitives.
bgfx::frame();
}
diff --git a/3rdparty/bgfx/examples/18-ibl/ibl.cpp b/3rdparty/bgfx/examples/18-ibl/ibl.cpp
index 6c772bc13b0..732598784c3 100644
--- a/3rdparty/bgfx/examples/18-ibl/ibl.cpp
+++ b/3rdparty/bgfx/examples/18-ibl/ibl.cpp
@@ -285,7 +285,7 @@ int _main_(int /*_argc*/, char** /*_argv*/)
bool m_specularIbl;
bool m_showDiffColorWheel;
bool m_showSpecColorWheel;
- bool m_crossCubemapPreview;
+ ImguiCubemap::Enum m_crossCubemapPreview;
};
Settings settings;
@@ -305,7 +305,7 @@ int _main_(int /*_argc*/, char** /*_argv*/)
settings.m_specularIbl = true;
settings.m_showDiffColorWheel = true;
settings.m_showSpecColorWheel = false;
- settings.m_crossCubemapPreview = false;
+ settings.m_crossCubemapPreview = ImguiCubemap::Cross;
float time = 0.0f;
@@ -324,7 +324,7 @@ int _main_(int /*_argc*/, char** /*_argv*/)
);
static int32_t rightScrollArea = 0;
- imguiBeginScrollArea("Settings", width - 256 - 10, 10, 256, 590, &rightScrollArea);
+ imguiBeginScrollArea("Settings", width - 256 - 10, 10, 256, 540, &rightScrollArea);
imguiLabel("Shade:");
imguiSeparator();
@@ -350,9 +350,9 @@ int _main_(int /*_argc*/, char** /*_argv*/)
, "Grace"
) );
static float lod = 0.0f;
- if (imguiCube(lightProbes[currentLightProbe].m_tex, lod, settings.m_crossCubemapPreview))
+ if (imguiCube(lightProbes[currentLightProbe].m_tex, lod, settings.m_crossCubemapPreview, true) )
{
- settings.m_crossCubemapPreview = !settings.m_crossCubemapPreview;
+ settings.m_crossCubemapPreview = ImguiCubemap::Enum( (settings.m_crossCubemapPreview+1) % ImguiCubemap::Count);
}
imguiSlider("Texture LOD", lod, float(0.0f), 10.1f, 0.1f);
diff --git a/3rdparty/bgfx/examples/common/bgfx_utils.cpp b/3rdparty/bgfx/examples/common/bgfx_utils.cpp
index a9516af16ee..0035076d88b 100644
--- a/3rdparty/bgfx/examples/common/bgfx_utils.cpp
+++ b/3rdparty/bgfx/examples/common/bgfx_utils.cpp
@@ -5,6 +5,8 @@
#include <string.h> // strlen
+#include "common.h"
+
#include <tinystl/allocator.h>
#include <tinystl/vector.h>
#include <tinystl/string.h>
diff --git a/3rdparty/bgfx/examples/common/common.h b/3rdparty/bgfx/examples/common/common.h
index fbcea73cc93..3e80ee67ff2 100644
--- a/3rdparty/bgfx/examples/common/common.h
+++ b/3rdparty/bgfx/examples/common/common.h
@@ -3,7 +3,12 @@
* License: http://www.opensource.org/licenses/BSD-2-Clause
*/
+#ifndef COMMON_H_HEADER_GUARD
+#define COMMON_H_HEADER_GUARD
+
#include <bx/timer.h>
#include <bx/fpumath.h>
#include "entry/entry.h"
+
+#endif // COMMON_H_HEADER_GUARD
diff --git a/3rdparty/bgfx/examples/common/entry/cmd.cpp b/3rdparty/bgfx/examples/common/entry/cmd.cpp
index 6dfcb37d874..6d58aebf077 100644
--- a/3rdparty/bgfx/examples/common/entry/cmd.cpp
+++ b/3rdparty/bgfx/examples/common/entry/cmd.cpp
@@ -7,11 +7,14 @@
#include <stdint.h>
#include <stdlib.h> // size_t
#include <string.h> // strlen
+
+#include <bx/allocator.h>
#include <bx/hash.h>
#include <bx/tokenizecmd.h>
#include "dbg.h"
#include "cmd.h"
+#include "entry_p.h"
#include <tinystl/allocator.h>
#include <tinystl/string.h>
@@ -89,14 +92,24 @@ struct CmdContext
CmdLookup m_lookup;
};
-static CmdContext s_cmdContext;
+static CmdContext* s_cmdContext;
+
+void cmdInit()
+{
+ s_cmdContext = BX_NEW(entry::getAllocator(), CmdContext);
+}
+
+void cmdShutdown()
+{
+ BX_DELETE(entry::getAllocator(), s_cmdContext);
+}
void cmdAdd(const char* _name, ConsoleFn _fn, void* _userData)
{
- s_cmdContext.add(_name, _fn, _userData);
+ s_cmdContext->add(_name, _fn, _userData);
}
void cmdExec(const char* _cmd)
{
- s_cmdContext.exec(_cmd);
+ s_cmdContext->exec(_cmd);
}
diff --git a/3rdparty/bgfx/examples/common/entry/cmd.h b/3rdparty/bgfx/examples/common/entry/cmd.h
index e1b2cbad247..7873d1aedc6 100644
--- a/3rdparty/bgfx/examples/common/entry/cmd.h
+++ b/3rdparty/bgfx/examples/common/entry/cmd.h
@@ -9,7 +9,16 @@
struct CmdContext;
typedef int (*ConsoleFn)(CmdContext* _context, void* _userData, int _argc, char const* const* _argv);
+///
+void cmdInit();
+
+///
+void cmdShutdown();
+
+///
void cmdAdd(const char* _name, ConsoleFn _fn, void* _userData = NULL);
+
+///
void cmdExec(const char* _cmd);
#endif // CMD_H_HEADER_GUARD
diff --git a/3rdparty/bgfx/examples/common/entry/entry.cpp b/3rdparty/bgfx/examples/common/entry/entry.cpp
index 3b4a49410f5..947d4204666 100644
--- a/3rdparty/bgfx/examples/common/entry/entry.cpp
+++ b/3rdparty/bgfx/examples/common/entry/entry.cpp
@@ -22,7 +22,17 @@ namespace entry
static bool s_exit = false;
static bx::FileReaderI* s_fileReader = NULL;
static bx::FileWriterI* s_fileWriter = NULL;
- static bx::CrtAllocator s_allocator;
+
+ extern bx::ReallocatorI* getDefaultAllocator();
+ static bx::ReallocatorI* s_allocator = getDefaultAllocator();
+
+#if ENTRY_CONFIG_IMPLEMENT_DEFAULT_ALLOCATOR
+ bx::ReallocatorI* getDefaultAllocator()
+ {
+ static bx::CrtAllocator s_allocator;
+ return &s_allocator;
+ }
+#endif // ENTRY_CONFIG_IMPLEMENT_DEFAULT_ALLOCATOR
bool setOrToggle(uint32_t& _flags, const char* _name, uint32_t _bit, int _first, int _argc, char const* const* _argv)
{
@@ -137,10 +147,12 @@ namespace entry
s_fileWriter = new bx::CrtFileWriter;
#endif // BX_CONFIG_CRT_FILE_READER_WRITER
+ cmdInit();
cmdAdd("mouselock", cmdMouseLock);
cmdAdd("graphics", cmdGraphics );
cmdAdd("exit", cmdExit );
+ inputInit();
inputAddBindings("bindings", s_bindings);
entry::WindowHandle defaultWindow = { 0 };
@@ -148,6 +160,11 @@ namespace entry
int32_t result = ::_main_(_argc, _argv);
+ inputRemoveBindings("bindings");
+ inputShutdown();
+
+ cmdShutdown();
+
#if BX_CONFIG_CRT_FILE_READER_WRITER
delete s_fileReader;
s_fileReader = NULL;
@@ -448,7 +465,20 @@ namespace entry
bx::ReallocatorI* getAllocator()
{
- return &s_allocator;
+ return s_allocator;
+ }
+
+ void* TinyStlAllocator::static_allocate(size_t _bytes)
+ {
+ return BX_ALLOC(getAllocator(), _bytes);
+ }
+
+ void TinyStlAllocator::static_deallocate(void* _ptr, size_t /*_bytes*/)
+ {
+ if (NULL != _ptr)
+ {
+ BX_FREE(getAllocator(), _ptr);
+ }
}
} // namespace entry
diff --git a/3rdparty/bgfx/examples/common/entry/entry_osx.mm b/3rdparty/bgfx/examples/common/entry/entry_osx.mm
index 0f556675d1c..eec2e513cff 100644
--- a/3rdparty/bgfx/examples/common/entry/entry_osx.mm
+++ b/3rdparty/bgfx/examples/common/entry/entry_osx.mm
@@ -57,21 +57,21 @@ namespace entry
static int32_t threadFunc(void* _userData)
{
- CFBundleRef mainBundle = CFBundleGetMainBundle();
- if ( mainBundle != nil )
- {
- CFURLRef resourcesURL = CFBundleCopyResourcesDirectoryURL(mainBundle);
- if ( resourcesURL != nil )
- {
- char path[PATH_MAX];
- if (CFURLGetFileSystemRepresentation(resourcesURL, TRUE, (UInt8 *)path, PATH_MAX) )
- {
- chdir(path);
- }
- CFRelease(resourcesURL);
- }
- }
-
+ CFBundleRef mainBundle = CFBundleGetMainBundle();
+ if ( mainBundle != nil )
+ {
+ CFURLRef resourcesURL = CFBundleCopyResourcesDirectoryURL(mainBundle);
+ if ( resourcesURL != nil )
+ {
+ char path[PATH_MAX];
+ if (CFURLGetFileSystemRepresentation(resourcesURL, TRUE, (UInt8 *)path, PATH_MAX) )
+ {
+ chdir(path);
+ }
+ CFRelease(resourcesURL);
+ }
+ }
+
MainThreadEntry* self = (MainThreadEntry*)_userData;
return main(self->m_argc, self->m_argv);
}
diff --git a/3rdparty/bgfx/examples/common/entry/entry_p.h b/3rdparty/bgfx/examples/common/entry/entry_p.h
index 09fa203bde5..39a289ed737 100644
--- a/3rdparty/bgfx/examples/common/entry/entry_p.h
+++ b/3rdparty/bgfx/examples/common/entry/entry_p.h
@@ -6,6 +6,8 @@
#ifndef ENTRY_PRIVATE_H_HEADER_GUARD
#define ENTRY_PRIVATE_H_HEADER_GUARD
+#define TINYSTL_ALLOCATOR entry::TinyStlAllocator
+
#include <bx/spscqueue.h>
#include "entry.h"
@@ -37,11 +39,21 @@
# error "Both ENTRY_DEFAULT_WIDTH and ENTRY_DEFAULT_HEIGHT must be defined."
#endif // ENTRY_DEFAULT_WIDTH
+#ifndef ENTRY_CONFIG_IMPLEMENT_DEFAULT_ALLOCATOR
+# define ENTRY_CONFIG_IMPLEMENT_DEFAULT_ALLOCATOR 1
+#endif // ENTRY_CONFIG_IMPLEMENT_DEFAULT_ALLOCATOR
+
#define ENTRY_IMPLEMENT_EVENT(_class, _type) \
_class(WindowHandle _handle) : Event(_type, _handle) {}
namespace entry
{
+ struct TinyStlAllocator
+ {
+ static void* static_allocate(size_t _bytes);
+ static void static_deallocate(void* _ptr, size_t /*_bytes*/);
+ };
+
int main(int _argc, char** _argv);
struct Event
diff --git a/3rdparty/bgfx/examples/common/entry/entry_x11.cpp b/3rdparty/bgfx/examples/common/entry/entry_x11.cpp
index 434e7c79a87..05080671258 100644
--- a/3rdparty/bgfx/examples/common/entry/entry_x11.cpp
+++ b/3rdparty/bgfx/examples/common/entry/entry_x11.cpp
@@ -10,7 +10,8 @@
#define XK_MISCELLANY
#define XK_LATIN1
#include <X11/keysymdef.h>
-#include <bgfxplatform.h> // will include X11 which #defines None... Don't mess with order of includes.
+#include <X11/Xlib.h> // will include X11 which #defines None... Don't mess with order of includes.
+#include <bgfxplatform.h>
#undef None
#include <bx/thread.h>
diff --git a/3rdparty/bgfx/examples/common/entry/input.cpp b/3rdparty/bgfx/examples/common/entry/input.cpp
index 851f22643e0..871bc96ea1d 100644
--- a/3rdparty/bgfx/examples/common/entry/input.cpp
+++ b/3rdparty/bgfx/examples/common/entry/input.cpp
@@ -8,6 +8,7 @@
#include "entry_p.h"
#include "input.h"
+#include <bx/allocator.h>
#include <bx/ringbuffer.h>
#include <tinystl/allocator.h>
#include <tinystl/unordered_map.h>
@@ -249,95 +250,105 @@ struct Input
Gamepad m_gamepad[ENTRY_CONFIG_MAX_GAMEPADS];
};
-static Input s_input;
+static Input* s_input;
+
+void inputInit()
+{
+ s_input = BX_NEW(entry::getAllocator(), Input);
+}
+
+void inputShutdown()
+{
+ BX_DELETE(entry::getAllocator(), s_input);
+}
void inputAddBindings(const char* _name, const InputBinding* _bindings)
{
- s_input.addBindings(_name, _bindings);
+ s_input->addBindings(_name, _bindings);
}
void inputRemoveBindings(const char* _name)
{
- s_input.removeBindings(_name);
+ s_input->removeBindings(_name);
}
void inputProcess()
{
- s_input.process();
+ s_input->process();
}
void inputSetMouseResolution(uint16_t _width, uint16_t _height)
{
- s_input.m_mouse.setResolution(_width, _height);
+ s_input->m_mouse.setResolution(_width, _height);
}
void inputSetKeyState(entry::Key::Enum _key, uint8_t _modifiers, bool _down)
{
- s_input.m_keyboard.setKeyState(_key, _modifiers, _down);
+ s_input->m_keyboard.setKeyState(_key, _modifiers, _down);
}
void inputChar(uint8_t _len, const uint8_t _char[4])
{
- s_input.m_keyboard.pushChar(_len, _char);
+ s_input->m_keyboard.pushChar(_len, _char);
}
const uint8_t* inputGetChar()
{
- return s_input.m_keyboard.popChar();
+ return s_input->m_keyboard.popChar();
}
void inputCharFlush()
{
- s_input.m_keyboard.charFlush();
+ s_input->m_keyboard.charFlush();
}
void inputSetMousePos(int32_t _mx, int32_t _my, int32_t _mz)
{
- s_input.m_mouse.setPos(_mx, _my, _mz);
+ s_input->m_mouse.setPos(_mx, _my, _mz);
}
void inputSetMouseButtonState(entry::MouseButton::Enum _button, uint8_t _state)
{
- s_input.m_mouse.setButtonState(_button, _state);
+ s_input->m_mouse.setButtonState(_button, _state);
}
void inputGetMouse(float _mouse[3])
{
- _mouse[0] = s_input.m_mouse.m_norm[0];
- _mouse[1] = s_input.m_mouse.m_norm[1];
- _mouse[2] = s_input.m_mouse.m_norm[2];
- s_input.m_mouse.m_norm[0] = 0.0f;
- s_input.m_mouse.m_norm[1] = 0.0f;
- s_input.m_mouse.m_norm[2] = 0.0f;
+ _mouse[0] = s_input->m_mouse.m_norm[0];
+ _mouse[1] = s_input->m_mouse.m_norm[1];
+ _mouse[2] = s_input->m_mouse.m_norm[2];
+ s_input->m_mouse.m_norm[0] = 0.0f;
+ s_input->m_mouse.m_norm[1] = 0.0f;
+ s_input->m_mouse.m_norm[2] = 0.0f;
}
bool inputIsMouseLocked()
{
- return s_input.m_mouse.m_lock;
+ return s_input->m_mouse.m_lock;
}
void inputSetMouseLock(bool _lock)
{
- if (s_input.m_mouse.m_lock != _lock)
+ if (s_input->m_mouse.m_lock != _lock)
{
- s_input.m_mouse.m_lock = _lock;
+ s_input->m_mouse.m_lock = _lock;
entry::WindowHandle defaultWindow = { 0 };
entry::setMouseLock(defaultWindow, _lock);
if (_lock)
{
- s_input.m_mouse.m_norm[0] = 0.0f;
- s_input.m_mouse.m_norm[1] = 0.0f;
- s_input.m_mouse.m_norm[2] = 0.0f;
+ s_input->m_mouse.m_norm[0] = 0.0f;
+ s_input->m_mouse.m_norm[1] = 0.0f;
+ s_input->m_mouse.m_norm[2] = 0.0f;
}
}
}
void inputSetGamepadAxis(entry::GamepadHandle _handle, entry::GamepadAxis::Enum _axis, int32_t _value)
{
- s_input.m_gamepad[_handle.idx].setAxis(_axis, _value);
+ s_input->m_gamepad[_handle.idx].setAxis(_axis, _value);
}
int32_t inputGetGamepadAxis(entry::GamepadHandle _handle, entry::GamepadAxis::Enum _axis)
{
- return s_input.m_gamepad[_handle.idx].getAxis(_axis);
+ return s_input->m_gamepad[_handle.idx].getAxis(_axis);
}
diff --git a/3rdparty/bgfx/examples/common/entry/input.h b/3rdparty/bgfx/examples/common/entry/input.h
index 12d830ccc66..c3f7ef18223 100644
--- a/3rdparty/bgfx/examples/common/entry/input.h
+++ b/3rdparty/bgfx/examples/common/entry/input.h
@@ -22,6 +22,12 @@ struct InputBinding
#define INPUT_BINDING_END { entry::Key::None, entry::Modifier::None, 0, NULL, NULL }
///
+void inputInit();
+
+///
+void inputShutdown();
+
+///
void inputAddBindings(const char* _name, const InputBinding* _bindings);
///
diff --git a/3rdparty/bgfx/examples/common/imgui/fs_imgui_latlong.bin.h b/3rdparty/bgfx/examples/common/imgui/fs_imgui_latlong.bin.h
new file mode 100644
index 00000000000..e98e50da499
--- /dev/null
+++ b/3rdparty/bgfx/examples/common/imgui/fs_imgui_latlong.bin.h
@@ -0,0 +1,123 @@
+static const uint8_t fs_imgui_latlong_glsl[646] =
+{
+ 0x46, 0x53, 0x48, 0x03, 0x6f, 0x1e, 0x3e, 0x3c, 0x02, 0x00, 0x11, 0x75, 0x5f, 0x69, 0x6d, 0x61, // FSH.o.><...u_ima
+ 0x67, 0x65, 0x4c, 0x6f, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x07, 0x01, 0x00, 0x00, // geLodEnabled....
+ 0x01, 0x00, 0x0a, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x00, 0x01, 0x00, // ...s_texColor...
+ 0x00, 0x01, 0x00, 0x4e, 0x02, 0x00, 0x00, 0x76, 0x61, 0x72, 0x79, 0x69, 0x6e, 0x67, 0x20, 0x68, // ...N...varying h
+ 0x69, 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, 0x32, 0x20, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, // ighp vec2 v_texc
+ 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x3b, 0x0a, 0x75, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x20, 0x68, // oord0;.uniform h
+ 0x69, 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x75, 0x5f, 0x69, 0x6d, 0x61, 0x67, // ighp vec4 u_imag
+ 0x65, 0x4c, 0x6f, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x3b, 0x0a, 0x75, 0x6e, 0x69, // eLodEnabled;.uni
+ 0x66, 0x6f, 0x72, 0x6d, 0x20, 0x6c, 0x6f, 0x77, 0x70, 0x20, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, // form lowp sample
+ 0x72, 0x43, 0x75, 0x62, 0x65, 0x20, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, // rCube s_texColor
+ 0x3b, 0x0a, 0x76, 0x6f, 0x69, 0x64, 0x20, 0x6d, 0x61, 0x69, 0x6e, 0x20, 0x28, 0x29, 0x0a, 0x7b, // ;.void main ().{
+ 0x0a, 0x20, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, 0x33, 0x20, 0x72, 0x65, // . highp vec3 re
+ 0x73, 0x75, 0x6c, 0x74, 0x5f, 0x31, 0x3b, 0x0a, 0x20, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, // sult_1;. highp
+ 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x3b, 0x0a, // float tmpvar_2;.
+ 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x20, 0x3d, 0x20, 0x28, 0x76, 0x5f, // tmpvar_2 = (v_
+ 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x2e, 0x78, 0x20, 0x2a, 0x20, 0x36, 0x2e, // texcoord0.x * 6.
+ 0x32, 0x38, 0x33, 0x31, 0x39, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, // 28319);. highp
+ 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x33, 0x3b, 0x0a, // float tmpvar_3;.
+ 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x33, 0x20, 0x3d, 0x20, 0x28, 0x76, 0x5f, // tmpvar_3 = (v_
+ 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x2e, 0x79, 0x20, 0x2a, 0x20, 0x33, 0x2e, // texcoord0.y * 3.
+ 0x31, 0x34, 0x31, 0x35, 0x39, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, // 14159);. result
+ 0x5f, 0x31, 0x2e, 0x78, 0x20, 0x3d, 0x20, 0x28, 0x73, 0x69, 0x6e, 0x28, 0x74, 0x6d, 0x70, 0x76, // _1.x = (sin(tmpv
+ 0x61, 0x72, 0x5f, 0x33, 0x29, 0x20, 0x2a, 0x20, 0x63, 0x6f, 0x73, 0x28, 0x74, 0x6d, 0x70, 0x76, // ar_3) * cos(tmpv
+ 0x61, 0x72, 0x5f, 0x32, 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, // ar_2));. result
+ 0x5f, 0x31, 0x2e, 0x79, 0x20, 0x3d, 0x20, 0x63, 0x6f, 0x73, 0x28, 0x74, 0x6d, 0x70, 0x76, 0x61, // _1.y = cos(tmpva
+ 0x72, 0x5f, 0x33, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x5f, 0x31, // r_3);. result_1
+ 0x2e, 0x7a, 0x20, 0x3d, 0x20, 0x28, 0x2d, 0x28, 0x73, 0x69, 0x6e, 0x28, 0x74, 0x6d, 0x70, 0x76, // .z = (-(sin(tmpv
+ 0x61, 0x72, 0x5f, 0x33, 0x29, 0x29, 0x20, 0x2a, 0x20, 0x73, 0x69, 0x6e, 0x28, 0x74, 0x6d, 0x70, // ar_3)) * sin(tmp
+ 0x76, 0x61, 0x72, 0x5f, 0x32, 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x6c, 0x6f, 0x77, 0x70, 0x20, // var_2));. lowp
+ 0x76, 0x65, 0x63, 0x34, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x34, 0x3b, 0x0a, 0x20, // vec4 tmpvar_4;.
+ 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x34, 0x2e, 0x78, 0x79, 0x7a, 0x20, 0x3d, 0x20, // tmpvar_4.xyz =
+ 0x74, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x43, 0x75, 0x62, 0x65, 0x4c, 0x6f, 0x64, 0x20, 0x20, // textureCubeLod
+ 0x20, 0x20, 0x28, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x2c, 0x20, 0x72, // (s_texColor, r
+ 0x65, 0x73, 0x75, 0x6c, 0x74, 0x5f, 0x31, 0x2c, 0x20, 0x75, 0x5f, 0x69, 0x6d, 0x61, 0x67, 0x65, // esult_1, u_image
+ 0x4c, 0x6f, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x2e, 0x78, 0x29, 0x2e, 0x78, 0x79, // LodEnabled.x).xy
+ 0x7a, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x34, 0x2e, 0x77, 0x20, // z;. tmpvar_4.w
+ 0x3d, 0x20, 0x28, 0x30, 0x2e, 0x32, 0x20, 0x2b, 0x20, 0x28, 0x30, 0x2e, 0x38, 0x20, 0x2a, 0x20, // = (0.2 + (0.8 *
+ 0x75, 0x5f, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x4c, 0x6f, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, // u_imageLodEnable
+ 0x64, 0x2e, 0x79, 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x67, 0x6c, 0x5f, 0x46, 0x72, 0x61, 0x67, // d.y));. gl_Frag
+ 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x20, 0x3d, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x34, // Color = tmpvar_4
+ 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x00, // ;.}...
+};
+static const uint8_t fs_imgui_latlong_dx9[553] =
+{
+ 0x46, 0x53, 0x48, 0x03, 0x6f, 0x1e, 0x3e, 0x3c, 0x01, 0x00, 0x11, 0x75, 0x5f, 0x69, 0x6d, 0x61, // FSH.o.><...u_ima
+ 0x67, 0x65, 0x4c, 0x6f, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x15, 0x01, 0x00, 0x00, // geLodEnabled....
+ 0x01, 0x00, 0x04, 0x02, 0x00, 0x03, 0xff, 0xff, 0xfe, 0xff, 0x30, 0x00, 0x43, 0x54, 0x41, 0x42, // ..........0.CTAB
+ 0x1c, 0x00, 0x00, 0x00, 0x8b, 0x00, 0x00, 0x00, 0x00, 0x03, 0xff, 0xff, 0x02, 0x00, 0x00, 0x00, // ................
+ 0x1c, 0x00, 0x00, 0x00, 0x00, 0x81, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, 0x44, 0x00, 0x00, 0x00, // ............D...
+ 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x00, 0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........P.......
+ 0x60, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x74, 0x00, 0x00, 0x00, // `...........t...
+ 0x00, 0x00, 0x00, 0x00, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x00, 0xab, // ....s_texColor..
+ 0x04, 0x00, 0x0e, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ................
+ 0x75, 0x5f, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x4c, 0x6f, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, // u_imageLodEnable
+ 0x64, 0x00, 0xab, 0xab, 0x01, 0x00, 0x03, 0x00, 0x01, 0x00, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, // d...............
+ 0x00, 0x00, 0x00, 0x00, 0x70, 0x73, 0x5f, 0x33, 0x5f, 0x30, 0x00, 0x4d, 0x69, 0x63, 0x72, 0x6f, // ....ps_3_0.Micro
+ 0x73, 0x6f, 0x66, 0x74, 0x20, 0x28, 0x52, 0x29, 0x20, 0x48, 0x4c, 0x53, 0x4c, 0x20, 0x53, 0x68, // soft (R) HLSL Sh
+ 0x61, 0x64, 0x65, 0x72, 0x20, 0x43, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x72, 0x20, 0x39, 0x2e, // ader Compiler 9.
+ 0x32, 0x39, 0x2e, 0x39, 0x35, 0x32, 0x2e, 0x33, 0x31, 0x31, 0x31, 0x00, 0x51, 0x00, 0x00, 0x05, // 29.952.3111.Q...
+ 0x01, 0x00, 0x0f, 0xa0, 0x00, 0x00, 0x00, 0x3f, 0xdb, 0x0f, 0xc9, 0x40, 0xdb, 0x0f, 0x49, 0xc0, // .......?...@..I.
+ 0x00, 0x00, 0x00, 0x00, 0x51, 0x00, 0x00, 0x05, 0x02, 0x00, 0x0f, 0xa0, 0xcd, 0xcc, 0x4c, 0x3f, // ....Q.........L?
+ 0xcd, 0xcc, 0x4c, 0x3e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1f, 0x00, 0x00, 0x02, // ..L>............
+ 0x05, 0x00, 0x00, 0x80, 0x00, 0x00, 0x03, 0x90, 0x1f, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x98, // ................
+ 0x00, 0x08, 0x0f, 0xa0, 0x02, 0x00, 0x00, 0x03, 0x00, 0x00, 0x01, 0x80, 0x01, 0x00, 0x00, 0xa0, // ................
+ 0x00, 0x00, 0x00, 0x90, 0x13, 0x00, 0x00, 0x02, 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, 0x00, 0x80, // ................
+ 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, 0x00, 0x80, 0x01, 0x00, 0x55, 0xa0, // ..............U.
+ 0x01, 0x00, 0xaa, 0xa0, 0x25, 0x00, 0x00, 0x02, 0x01, 0x00, 0x03, 0x80, 0x00, 0x00, 0x00, 0x80, // ....%...........
+ 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, 0x55, 0x90, 0x01, 0x00, 0x00, 0xa0, // ..........U.....
+ 0x01, 0x00, 0x00, 0xa0, 0x13, 0x00, 0x00, 0x02, 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, 0x00, 0x80, // ................
+ 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, 0x00, 0x80, 0x01, 0x00, 0x55, 0xa0, // ..............U.
+ 0x01, 0x00, 0xaa, 0xa0, 0x25, 0x00, 0x00, 0x02, 0x02, 0x00, 0x03, 0x80, 0x00, 0x00, 0x00, 0x80, // ....%...........
+ 0x05, 0x00, 0x00, 0x03, 0x00, 0x00, 0x01, 0x80, 0x01, 0x00, 0x00, 0x80, 0x02, 0x00, 0x55, 0x80, // ..............U.
+ 0x05, 0x00, 0x00, 0x03, 0x00, 0x00, 0x04, 0x80, 0x01, 0x00, 0x55, 0x80, 0x02, 0x00, 0x55, 0x81, // ..........U...U.
+ 0x01, 0x00, 0x00, 0x02, 0x00, 0x00, 0x02, 0x80, 0x02, 0x00, 0x00, 0x80, 0x01, 0x00, 0x00, 0x02, // ................
+ 0x00, 0x00, 0x08, 0x80, 0x00, 0x00, 0x00, 0xa0, 0x5f, 0x00, 0x00, 0x03, 0x00, 0x00, 0x0f, 0x80, // ........_.......
+ 0x00, 0x00, 0xe4, 0x80, 0x00, 0x08, 0xe4, 0xa0, 0x01, 0x00, 0x00, 0x02, 0x00, 0x08, 0x07, 0x80, // ................
+ 0x00, 0x00, 0xe4, 0x80, 0x01, 0x00, 0x00, 0x02, 0x00, 0x00, 0x02, 0x80, 0x00, 0x00, 0x55, 0xa0, // ..............U.
+ 0x04, 0x00, 0x00, 0x04, 0x00, 0x08, 0x08, 0x80, 0x00, 0x00, 0x55, 0x80, 0x02, 0x00, 0x00, 0xa0, // ..........U.....
+ 0x02, 0x00, 0x55, 0xa0, 0xff, 0xff, 0x00, 0x00, 0x00, // ..U......
+};
+static const uint8_t fs_imgui_latlong_dx11[600] =
+{
+ 0x46, 0x53, 0x48, 0x03, 0x6f, 0x1e, 0x3e, 0x3c, 0x01, 0x00, 0x11, 0x75, 0x5f, 0x69, 0x6d, 0x61, // FSH.o.><...u_ima
+ 0x67, 0x65, 0x4c, 0x6f, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x15, 0x00, 0x30, 0x0a, // geLodEnabled..0.
+ 0x01, 0x00, 0x30, 0x02, 0x44, 0x58, 0x42, 0x43, 0x89, 0x11, 0x25, 0xa6, 0xf5, 0x66, 0x12, 0x3f, // ..0.DXBC..%..f.?
+ 0xc0, 0x1f, 0x67, 0x9b, 0x6e, 0x4e, 0xac, 0x03, 0x01, 0x00, 0x00, 0x00, 0x30, 0x02, 0x00, 0x00, // ..g.nN......0...
+ 0x03, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, 0xb8, 0x00, 0x00, 0x00, // ....,...........
+ 0x49, 0x53, 0x47, 0x4e, 0x50, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, // ISGNP...........
+ 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, // 8...............
+ 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x44, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........D.......
+ 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x03, 0x00, 0x00, // ................
+ 0x53, 0x56, 0x5f, 0x50, 0x4f, 0x53, 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x00, 0x54, 0x45, 0x58, 0x43, // SV_POSITION.TEXC
+ 0x4f, 0x4f, 0x52, 0x44, 0x00, 0xab, 0xab, 0xab, 0x4f, 0x53, 0x47, 0x4e, 0x2c, 0x00, 0x00, 0x00, // OORD....OSGN,...
+ 0x01, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ .......
+ 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, // ................
+ 0x53, 0x56, 0x5f, 0x54, 0x41, 0x52, 0x47, 0x45, 0x54, 0x00, 0xab, 0xab, 0x53, 0x48, 0x44, 0x52, // SV_TARGET...SHDR
+ 0x70, 0x01, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x5c, 0x00, 0x00, 0x00, 0x59, 0x00, 0x00, 0x04, // p...@.......Y...
+ 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa4, 0x00, 0x00, 0x00, 0x5a, 0x00, 0x00, 0x03, // F. .........Z...
+ 0x00, 0x60, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x58, 0x30, 0x00, 0x04, 0x00, 0x70, 0x10, 0x00, // .`......X0...p..
+ 0x00, 0x00, 0x00, 0x00, 0x55, 0x55, 0x00, 0x00, 0x62, 0x10, 0x00, 0x03, 0x32, 0x10, 0x10, 0x00, // ....UU..b...2...
+ 0x01, 0x00, 0x00, 0x00, 0x65, 0x00, 0x00, 0x03, 0xf2, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // ....e.... ......
+ 0x68, 0x00, 0x00, 0x02, 0x03, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x0a, 0x32, 0x00, 0x10, 0x00, // h.......8...2...
+ 0x00, 0x00, 0x00, 0x00, 0x46, 0x10, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, // ....F........@..
+ 0xdb, 0x0f, 0xc9, 0x40, 0xdb, 0x0f, 0x49, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ...@..I@........
+ 0x4d, 0x00, 0x00, 0x07, 0x42, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd0, 0x00, 0x00, // M...B...........
+ 0x1a, 0x00, 0x10, 0x80, 0x41, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x4d, 0x00, 0x00, 0x06, // ....A.......M...
+ 0x32, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0xd0, 0x00, 0x00, 0x16, 0x05, 0x10, 0x00, // 2...............
+ 0x00, 0x00, 0x00, 0x00, 0x4d, 0x00, 0x00, 0x06, 0x00, 0xd0, 0x00, 0x00, 0x62, 0x00, 0x10, 0x00, // ....M.......b...
+ 0x02, 0x00, 0x00, 0x00, 0x06, 0x01, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x07, // ............8...
+ 0x82, 0x00, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // ........*.......
+ 0x1a, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x07, 0x12, 0x00, 0x10, 0x00, // ........8.......
+ 0x02, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x10, 0x00, // ................
+ 0x02, 0x00, 0x00, 0x00, 0x48, 0x00, 0x00, 0x0c, 0xf2, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // ....H...........
+ 0x86, 0x03, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x46, 0x7e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // ........F~......
+ 0x00, 0x60, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x80, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, // .`........ .....
+ 0xa3, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x05, 0x72, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // ....6...r ......
+ 0x46, 0x02, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0a, 0x82, 0x20, 0x10, 0x00, // F.......2.... ..
+ 0x00, 0x00, 0x00, 0x00, 0x1a, 0x80, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa3, 0x00, 0x00, 0x00, // ...... .........
+ 0x01, 0x40, 0x00, 0x00, 0xcd, 0xcc, 0x4c, 0x3f, 0x01, 0x40, 0x00, 0x00, 0xcd, 0xcc, 0x4c, 0x3e, // .@....L?.@....L>
+ 0x3e, 0x00, 0x00, 0x01, 0x00, 0x00, 0x40, 0x0a, // >.....@.
+};
diff --git a/3rdparty/bgfx/examples/common/imgui/fs_imgui_latlong.sc b/3rdparty/bgfx/examples/common/imgui/fs_imgui_latlong.sc
new file mode 100644
index 00000000000..694e2dae67b
--- /dev/null
+++ b/3rdparty/bgfx/examples/common/imgui/fs_imgui_latlong.sc
@@ -0,0 +1,38 @@
+$input v_texcoord0
+
+/*
+ * Copyright 2014-2015 Dario Manesku. All rights reserved.
+ * License: http://www.opensource.org/licenses/BSD-2-Clause
+ */
+
+#include <bgfx_shader.sh>
+
+uniform vec4 u_imageLodEnabled;
+SAMPLERCUBE(s_texColor, 0);
+
+#define u_imageLod u_imageLodEnabled.x
+#define u_imageEnabled u_imageLodEnabled.y
+
+vec3 vecFromLatLong(vec2 _uv)
+{
+ float pi = 3.14159265;
+ float twoPi = 2.0*pi;
+ float phi = _uv.x * twoPi;
+ float theta = _uv.y *pi;
+
+ vec3 result;
+ result.x = sin(theta)*cos(phi);
+ result.y = cos(theta);
+ result.z = -sin(theta)*sin(phi);
+
+ return result;
+}
+
+void main()
+{
+ vec3 dir = vecFromLatLong(v_texcoord0);
+ vec3 color = textureCubeLod(s_texColor, dir, u_imageLod).xyz;
+ float alpha = 0.2 + 0.8*u_imageEnabled;
+
+ gl_FragColor = vec4(color, alpha);
+}
diff --git a/3rdparty/bgfx/examples/common/imgui/imgui.cpp b/3rdparty/bgfx/examples/common/imgui/imgui.cpp
index 163f18a81aa..805b60b0536 100644
--- a/3rdparty/bgfx/examples/common/imgui/imgui.cpp
+++ b/3rdparty/bgfx/examples/common/imgui/imgui.cpp
@@ -41,6 +41,8 @@
#include "fs_imgui_texture.bin.h"
#include "vs_imgui_cubemap.bin.h"
#include "fs_imgui_cubemap.bin.h"
+#include "vs_imgui_latlong.bin.h"
+#include "fs_imgui_latlong.bin.h"
#include "vs_imgui_image.bin.h"
#include "fs_imgui_image.bin.h"
#include "fs_imgui_image_swizz.bin.h"
@@ -65,15 +67,25 @@ static const int32_t SCROLL_AREA_PADDING = 6;
static const int32_t AREA_HEADER = 20;
static const float s_tabStops[4] = {150, 210, 270, 330};
-static void* imguiMalloc(size_t size, void* /*_userptr*/)
-{
- return malloc(size);
-}
+// For a custom allocator, define this and implement imguiMalloc and imguiFree somewhere in the project.
+#ifndef IMGUI_CONFIG_CUSTOM_ALLOCATOR
+# define IMGUI_CONFIG_CUSTOM_ALLOCATOR 0
+#endif // ENTRY_CONFIG_USE_TINYSTL
-static void imguiFree(void* _ptr, void* /*_userptr*/)
-{
- free(_ptr);
-}
+#if IMGUI_CONFIG_CUSTOM_ALLOCATOR
+ void* imguiMalloc(size_t size, void* /*_userptr*/);
+ void imguiFree(void* _ptr, void* /*_userptr*/);
+#else
+ static void* imguiMalloc(size_t _size, void* /*_userptr*/)
+ {
+ return malloc(_size);
+ }
+
+ static void imguiFree(void* _ptr, void* /*_userptr*/)
+ {
+ free(_ptr);
+ }
+#endif //IMGUI_CONFIG_CUSTOM_ALLOCATOR
#define IMGUI_MIN(_a, _b) (_a)<(_b)?(_a):(_b)
#define IMGUI_MAX(_a, _b) (_a)>(_b)?(_a):(_b)
@@ -393,6 +405,7 @@ struct Imgui
m_colorProgram.idx = bgfx::invalidHandle;
m_textureProgram.idx = bgfx::invalidHandle;
m_cubeMapProgram.idx = bgfx::invalidHandle;
+ m_latlongProgram.idx = bgfx::invalidHandle;
m_imageProgram.idx = bgfx::invalidHandle;
m_imageSwizzProgram.idx = bgfx::invalidHandle;
}
@@ -481,6 +494,8 @@ struct Imgui
const bgfx::Memory* fs_imgui_texture;
const bgfx::Memory* vs_imgui_cubemap;
const bgfx::Memory* fs_imgui_cubemap;
+ const bgfx::Memory* vs_imgui_latlong;
+ const bgfx::Memory* fs_imgui_latlong;
const bgfx::Memory* vs_imgui_image;
const bgfx::Memory* fs_imgui_image;
const bgfx::Memory* fs_imgui_image_swizz;
@@ -494,6 +509,8 @@ struct Imgui
fs_imgui_texture = bgfx::makeRef(fs_imgui_texture_dx9, sizeof(fs_imgui_texture_dx9) );
vs_imgui_cubemap = bgfx::makeRef(vs_imgui_cubemap_dx9, sizeof(vs_imgui_cubemap_dx9) );
fs_imgui_cubemap = bgfx::makeRef(fs_imgui_cubemap_dx9, sizeof(fs_imgui_cubemap_dx9) );
+ vs_imgui_latlong = bgfx::makeRef(vs_imgui_latlong_dx9, sizeof(vs_imgui_latlong_dx9) );
+ fs_imgui_latlong = bgfx::makeRef(fs_imgui_latlong_dx9, sizeof(fs_imgui_latlong_dx9) );
vs_imgui_image = bgfx::makeRef(vs_imgui_image_dx9, sizeof(vs_imgui_image_dx9) );
fs_imgui_image = bgfx::makeRef(fs_imgui_image_dx9, sizeof(fs_imgui_image_dx9) );
fs_imgui_image_swizz = bgfx::makeRef(fs_imgui_image_swizz_dx9, sizeof(fs_imgui_image_swizz_dx9) );
@@ -507,6 +524,8 @@ struct Imgui
fs_imgui_texture = bgfx::makeRef(fs_imgui_texture_dx11, sizeof(fs_imgui_texture_dx11) );
vs_imgui_cubemap = bgfx::makeRef(vs_imgui_cubemap_dx11, sizeof(vs_imgui_cubemap_dx11) );
fs_imgui_cubemap = bgfx::makeRef(fs_imgui_cubemap_dx11, sizeof(fs_imgui_cubemap_dx11) );
+ vs_imgui_latlong = bgfx::makeRef(vs_imgui_latlong_dx11, sizeof(vs_imgui_latlong_dx11) );
+ fs_imgui_latlong = bgfx::makeRef(fs_imgui_latlong_dx11, sizeof(fs_imgui_latlong_dx11) );
vs_imgui_image = bgfx::makeRef(vs_imgui_image_dx11, sizeof(vs_imgui_image_dx11) );
fs_imgui_image = bgfx::makeRef(fs_imgui_image_dx11, sizeof(fs_imgui_image_dx11) );
fs_imgui_image_swizz = bgfx::makeRef(fs_imgui_image_swizz_dx11, sizeof(fs_imgui_image_swizz_dx11) );
@@ -519,6 +538,8 @@ struct Imgui
fs_imgui_texture = bgfx::makeRef(fs_imgui_texture_glsl, sizeof(fs_imgui_texture_glsl) );
vs_imgui_cubemap = bgfx::makeRef(vs_imgui_cubemap_glsl, sizeof(vs_imgui_cubemap_glsl) );
fs_imgui_cubemap = bgfx::makeRef(fs_imgui_cubemap_glsl, sizeof(fs_imgui_cubemap_glsl) );
+ vs_imgui_latlong = bgfx::makeRef(vs_imgui_latlong_glsl, sizeof(vs_imgui_latlong_glsl) );
+ fs_imgui_latlong = bgfx::makeRef(fs_imgui_latlong_glsl, sizeof(fs_imgui_latlong_glsl) );
vs_imgui_image = bgfx::makeRef(vs_imgui_image_glsl, sizeof(vs_imgui_image_glsl) );
fs_imgui_image = bgfx::makeRef(fs_imgui_image_glsl, sizeof(fs_imgui_image_glsl) );
fs_imgui_image_swizz = bgfx::makeRef(fs_imgui_image_swizz_glsl, sizeof(fs_imgui_image_swizz_glsl) );
@@ -546,6 +567,12 @@ struct Imgui
bgfx::destroyShader(vsh);
bgfx::destroyShader(fsh);
+ vsh = bgfx::createShader(vs_imgui_latlong);
+ fsh = bgfx::createShader(fs_imgui_latlong);
+ m_latlongProgram = bgfx::createProgram(vsh, fsh);
+ bgfx::destroyShader(vsh);
+ bgfx::destroyShader(fsh);
+
vsh = bgfx::createShader(vs_imgui_image);
fsh = bgfx::createShader(fs_imgui_image);
m_imageProgram = bgfx::createProgram(vsh, fsh);
@@ -586,6 +613,7 @@ struct Imgui
bgfx::destroyProgram(m_colorProgram);
bgfx::destroyProgram(m_textureProgram);
bgfx::destroyProgram(m_cubeMapProgram);
+ bgfx::destroyProgram(m_latlongProgram);
bgfx::destroyProgram(m_imageProgram);
bgfx::destroyProgram(m_imageSwizzProgram);
nvgDelete(m_nvg);
@@ -1594,24 +1622,27 @@ struct Imgui
const int32_t yy = area.m_widgetY;
area.m_widgetY += _height + DEFAULT_SPACING;
- const bool enabled = _enabled && isEnabled(m_areaId);
- const bool over = enabled && inRect(xx, yy, _width, _height);
- const bool res = buttonLogic(id, over);
+ if (screenQuad(xx, yy, _width, _height, _originBottomLeft) )
+ {
+ const bool enabled = _enabled && isEnabled(m_areaId);
+ const bool over = enabled && inRect(xx, yy, _width, _height);
+ const bool res = buttonLogic(id, over);
- const float lodEnabled[4] = { _lod, float(enabled), 0.0f, 0.0f };
+ const float lodEnabled[4] = { _lod, float(enabled), 0.0f, 0.0f };
+ bgfx::setUniform(u_imageLodEnabled, lodEnabled);
+ bgfx::setTexture(0, s_texColor, bgfx::isValid(_image) ? _image : m_missingTexture);
+ bgfx::setState(BGFX_STATE_RGB_WRITE
+ |BGFX_STATE_ALPHA_WRITE
+ |BGFX_STATE_BLEND_FUNC(BGFX_STATE_BLEND_SRC_ALPHA, BGFX_STATE_BLEND_INV_SRC_ALPHA)
+ );
+ bgfx::setProgram(m_imageProgram);
+ setCurrentScissor();
+ bgfx::submit(m_view);
- screenQuad(xx, yy, _width, _height, _originBottomLeft);
- bgfx::setUniform(u_imageLodEnabled, lodEnabled);
- bgfx::setTexture(0, s_texColor, bgfx::isValid(_image) ? _image : m_missingTexture);
- bgfx::setState(BGFX_STATE_RGB_WRITE
- |BGFX_STATE_ALPHA_WRITE
- |BGFX_STATE_BLEND_FUNC(BGFX_STATE_BLEND_SRC_ALPHA, BGFX_STATE_BLEND_INV_SRC_ALPHA)
- );
- bgfx::setProgram(m_imageProgram);
- setCurrentScissor();
- bgfx::submit(m_view);
+ return res;
+ }
- return res;
+ return false;
}
bool image(bgfx::TextureHandle _image, float _lod, float _width, float _aspect, ImguiAlign::Enum _align, bool _enabled, bool _originBottomLeft)
@@ -1654,29 +1685,32 @@ struct Imgui
const int32_t yy = area.m_widgetY;
area.m_widgetY += _height + DEFAULT_SPACING;
- const bool enabled = _enabled && isEnabled(m_areaId);
- const bool over = enabled && inRect(xx, yy, _width, _height);
- const bool res = buttonLogic(id, over);
+ if (screenQuad(xx, yy, _width, _height) )
+ {
+ const bool enabled = _enabled && isEnabled(m_areaId);
+ const bool over = enabled && inRect(xx, yy, _width, _height);
+ const bool res = buttonLogic(id, over);
- screenQuad(xx, yy, _width, _height);
+ const float lodEnabled[4] = { _lod, float(enabled), 0.0f, 0.0f };
+ bgfx::setUniform(u_imageLodEnabled, lodEnabled);
- const float lodEnabled[4] = { _lod, float(enabled), 0.0f, 0.0f };
- bgfx::setUniform(u_imageLodEnabled, lodEnabled);
+ float swizz[4] = { 0.0f, 0.0f, 0.0f, 0.0f };
+ swizz[_channel] = 1.0f;
+ bgfx::setUniform(u_imageSwizzle, swizz);
- float swizz[4] = { 0.0f, 0.0f, 0.0f, 0.0f };
- swizz[_channel] = 1.0f;
- bgfx::setUniform(u_imageSwizzle, swizz);
+ bgfx::setTexture(0, s_texColor, bgfx::isValid(_image) ? _image : m_missingTexture);
+ bgfx::setState(BGFX_STATE_RGB_WRITE
+ |BGFX_STATE_ALPHA_WRITE
+ |BGFX_STATE_BLEND_FUNC(BGFX_STATE_BLEND_SRC_ALPHA, BGFX_STATE_BLEND_INV_SRC_ALPHA)
+ );
+ bgfx::setProgram(m_imageSwizzProgram);
+ setCurrentScissor();
+ bgfx::submit(m_view);
- bgfx::setTexture(0, s_texColor, bgfx::isValid(_image) ? _image : m_missingTexture);
- bgfx::setState(BGFX_STATE_RGB_WRITE
- |BGFX_STATE_ALPHA_WRITE
- |BGFX_STATE_BLEND_FUNC(BGFX_STATE_BLEND_SRC_ALPHA, BGFX_STATE_BLEND_INV_SRC_ALPHA)
- );
- bgfx::setProgram(m_imageSwizzProgram);
- setCurrentScissor();
- bgfx::submit(m_view);
+ return res;
+ }
- return res;
+ return false;
}
bool imageChannel(bgfx::TextureHandle _image, uint8_t _channel, float _lod, float _width, float _aspect, ImguiAlign::Enum _align, bool _enabled)
@@ -1687,8 +1721,96 @@ struct Imgui
return imageChannel(_image, _channel, _lod, int32_t(width), int32_t(height), _align, _enabled);
}
- bool cubeMap(bgfx::TextureHandle _cubemap, float _lod, bool _cross, ImguiAlign::Enum _align, bool _enabled)
+ bool latlong(bgfx::TextureHandle _cubemap, float _lod, ImguiAlign::Enum _align, bool _enabled)
+ {
+ const uint32_t id = getId();
+
+ Area& area = getCurrentArea();
+ int32_t xx;
+ int32_t width;
+ if (ImguiAlign::Left == _align)
+ {
+ xx = area.m_contentX + SCROLL_AREA_PADDING;
+ width = area.m_widgetW;
+ }
+ else if (ImguiAlign::LeftIndented == _align
+ || ImguiAlign::Right == _align)
+ {
+ xx = area.m_widgetX;
+ width = area.m_widgetW;
+ }
+ else //if (ImguiAlign::Center == _align
+ //|| ImguiAlign::CenterIndented == _align).
+ {
+ xx = area.m_widgetX;
+ width = area.m_widgetW - (area.m_widgetX-area.m_scissorX);
+ }
+
+ const int32_t height = width/2;
+ const int32_t yy = area.m_widgetY;
+ area.m_widgetY += height + DEFAULT_SPACING;
+
+ if (screenQuad(xx, yy, width, height, false) )
+ {
+ const bool enabled = _enabled && isEnabled(m_areaId);
+ const bool over = enabled && inRect(xx, yy, width, height);
+ const bool res = buttonLogic(id, over);
+
+ const float lodEnabled[4] = { _lod, float(enabled), 0.0f, 0.0f };
+ bgfx::setUniform(u_imageLodEnabled, lodEnabled);
+
+ bgfx::setTexture(0, s_texColor, _cubemap);
+ bgfx::setState(BGFX_STATE_RGB_WRITE
+ |BGFX_STATE_ALPHA_WRITE
+ |BGFX_STATE_BLEND_FUNC(BGFX_STATE_BLEND_SRC_ALPHA, BGFX_STATE_BLEND_INV_SRC_ALPHA)
+ );
+ bgfx::setProgram(m_latlongProgram);
+ setCurrentScissor();
+ bgfx::submit(m_view);
+
+ return res;
+ }
+
+ return false;
+ }
+
+ bool cubeMap(bgfx::TextureHandle _cubemap, float _lod, bool _cross, bool _sameHeight, ImguiAlign::Enum _align, bool _enabled)
{
+ const uint32_t id = getId();
+
+ Area& area = getCurrentArea();
+ int32_t xx;
+ int32_t width;
+ if (ImguiAlign::Left == _align)
+ {
+ xx = area.m_contentX + SCROLL_AREA_PADDING;
+ width = area.m_widgetW;
+ }
+ else if (ImguiAlign::LeftIndented == _align
+ || ImguiAlign::Right == _align)
+ {
+ xx = area.m_widgetX;
+ width = area.m_widgetW;
+ }
+ else //if (ImguiAlign::Center == _align
+ //|| ImguiAlign::CenterIndented == _align).
+ {
+ xx = area.m_widgetX;
+ width = area.m_widgetW - (area.m_widgetX-area.m_scissorX);
+ }
+
+ const bool adjustHeight = (_cross && _sameHeight);
+ const bool fullHeight = (_cross && !_sameHeight);
+
+ if (adjustHeight)
+ {
+ xx += width/6;
+ }
+
+ const int32_t height = fullHeight ? (width*3)/4 : (width/2);
+ const int32_t yy = area.m_widgetY;
+ area.m_widgetY += height + DEFAULT_SPACING;
+
const uint32_t numVertices = 14;
const uint32_t numIndices = 36;
if (bgfx::checkAvailTransientBuffers(numVertices, PosNormalVertex::ms_decl, numIndices) )
@@ -1760,38 +1882,12 @@ struct Imgui
indices += addQuad(indices, 10, 12, 13, 11);
}
- const uint32_t id = getId();
-
- Area& area = getCurrentArea();
- int32_t xx;
- int32_t width;
- if (ImguiAlign::Left == _align)
- {
- xx = area.m_contentX + SCROLL_AREA_PADDING;
- width = area.m_widgetW;
- }
- else if (ImguiAlign::LeftIndented == _align
- || ImguiAlign::Right == _align)
- {
- xx = area.m_widgetX;
- width = area.m_widgetW;
- }
- else //if (ImguiAlign::Center == _align
- //|| ImguiAlign::CenterIndented == _align).
- {
- xx = area.m_widgetX;
- width = area.m_widgetW - (area.m_widgetX-area.m_scissorX);
- }
-
- const uint32_t height = _cross ? (width*3)/4 : (width/2);
- const int32_t yy = area.m_widgetY;
- area.m_widgetY += height + DEFAULT_SPACING;
-
const bool enabled = _enabled && isEnabled(m_areaId);
const bool over = enabled && inRect(xx, yy, width, height);
const bool res = buttonLogic(id, over);
- const float scale = float(width/2)+0.25f;
+ const float widthf = float(width);
+ const float scale = adjustHeight ? (widthf+0.5f)/3.0f : (widthf*0.5f + 0.25f);
float mtx[16];
bx::mtxSRT(mtx, scale, scale, 1.0f, 0.0f, 0.0f, 0.0f, float(xx), float(yy), 0.0f);
@@ -1817,6 +1913,19 @@ struct Imgui
return false;
}
+ bool cubeMap(bgfx::TextureHandle _cubemap, float _lod, ImguiCubemap::Enum _display, bool _sameHeight, ImguiAlign::Enum _align, bool _enabled)
+ {
+ if (ImguiCubemap::Cross == _display
+ || ImguiCubemap::Hex == _display)
+ {
+ return cubeMap(_cubemap, _lod, (ImguiCubemap::Cross == _display), _sameHeight, _align, _enabled);
+ }
+ else //(ImguiCubemap::Latlong == _display).
+ {
+ return latlong(_cubemap, _lod, _align, _enabled);
+ }
+ }
+
bool collapse(const char* _text, const char* _subtext, bool _checked, bool _enabled)
{
const uint32_t id = getId();
@@ -2596,7 +2705,7 @@ struct Imgui
#endif // USE_NANOVG_FONT
}
- void screenQuad(int32_t _x, int32_t _y, int32_t _width, uint32_t _height, bool _originBottomLeft = false)
+ bool screenQuad(int32_t _x, int32_t _y, int32_t _width, uint32_t _height, bool _originBottomLeft = false)
{
if (bgfx::checkAvailTransientVertexBuffer(6, PosUvVertex::ms_decl) )
{
@@ -2650,7 +2759,11 @@ struct Imgui
vertex[5].m_v = minv;
bgfx::setVertexBuffer(&vb);
+
+ return true;
}
+
+ return false;
}
void colorWheelWidget(float _rgb[3], bool _respectIndentation, float _size, bool _enabled)
@@ -3054,6 +3167,7 @@ struct Imgui
bgfx::ProgramHandle m_colorProgram;
bgfx::ProgramHandle m_textureProgram;
bgfx::ProgramHandle m_cubeMapProgram;
+ bgfx::ProgramHandle m_latlongProgram;
bgfx::ProgramHandle m_imageProgram;
bgfx::ProgramHandle m_imageSwizzProgram;
bgfx::TextureHandle m_missingTexture;
@@ -3348,9 +3462,9 @@ bool imguiImageChannel(bgfx::TextureHandle _image, uint8_t _channel, float _lod,
return s_imgui.imageChannel(_image, _channel, _lod, _width, _aspect, _align, _enabled);
}
-bool imguiCube(bgfx::TextureHandle _cubemap, float _lod, bool _cross, ImguiAlign::Enum _align, bool _enabled)
+bool imguiCube(bgfx::TextureHandle _cubemap, float _lod, ImguiCubemap::Enum _display, bool _sameHeight, ImguiAlign::Enum _align, bool _enabled)
{
- return s_imgui.cubeMap(_cubemap, _lod, _cross, _align, _enabled);
+ return s_imgui.cubeMap(_cubemap, _lod, _display, _sameHeight, _align, _enabled);
}
float imguiGetTextLength(const char* _text, ImguiFontHandle _handle)
diff --git a/3rdparty/bgfx/examples/common/imgui/imgui.h b/3rdparty/bgfx/examples/common/imgui/imgui.h
index faa2d4f3044..01f3c90e27b 100644
--- a/3rdparty/bgfx/examples/common/imgui/imgui.h
+++ b/3rdparty/bgfx/examples/common/imgui/imgui.h
@@ -94,6 +94,18 @@ struct ImguiAlign
};
};
+struct ImguiCubemap
+{
+ enum Enum
+ {
+ Cross,
+ Latlong,
+ Hex,
+
+ Count,
+ };
+};
+
struct ImguiBorder
{
enum Enum
@@ -184,7 +196,7 @@ bool imguiImage(bgfx::TextureHandle _image, float _lod, int32_t _width, int32_t
bool imguiImage(bgfx::TextureHandle _image, float _lod, float _scale, float _aspect, ImguiAlign::Enum _align = ImguiAlign::LeftIndented, bool _enabled = true, bool _originBottomLeft = false);
bool imguiImageChannel(bgfx::TextureHandle _image, uint8_t _channel, float _lod, int32_t _width, int32_t _height, ImguiAlign::Enum _align = ImguiAlign::LeftIndented, bool _enabled = true);
bool imguiImageChannel(bgfx::TextureHandle _image, uint8_t _channel, float _lod, float _scale, float _aspect, ImguiAlign::Enum _align = ImguiAlign::LeftIndented, bool _enabled = true);
-bool imguiCube(bgfx::TextureHandle _cubemap, float _lod = 0.0f, bool _cross = true, ImguiAlign::Enum _align = ImguiAlign::LeftIndented, bool _enabled = true);
+bool imguiCube(bgfx::TextureHandle _cubemap, float _lod = 0.0f, ImguiCubemap::Enum _display = ImguiCubemap::Cross, bool _sameHeight = false, ImguiAlign::Enum _align = ImguiAlign::LeftIndented, bool _enabled = true);
float imguiGetTextLength(const char* _text, ImguiFontHandle _handle);
bool imguiMouseOverArea();
diff --git a/3rdparty/bgfx/examples/common/imgui/vs_imgui_latlong.bin.h b/3rdparty/bgfx/examples/common/imgui/vs_imgui_latlong.bin.h
new file mode 100644
index 00000000000..bb168300e08
--- /dev/null
+++ b/3rdparty/bgfx/examples/common/imgui/vs_imgui_latlong.bin.h
@@ -0,0 +1,84 @@
+static const uint8_t vs_imgui_latlong_glsl[337] =
+{
+ 0x56, 0x53, 0x48, 0x03, 0x6f, 0x1e, 0x3e, 0x3c, 0x01, 0x00, 0x0f, 0x75, 0x5f, 0x6d, 0x6f, 0x64, // VSH.o.><...u_mod
+ 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x09, 0x01, 0x00, 0x00, 0x01, 0x00, // elViewProj......
+ 0x2c, 0x01, 0x00, 0x00, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x20, 0x68, 0x69, // ,...attribute hi
+ 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, 0x33, 0x20, 0x61, 0x5f, 0x70, 0x6f, 0x73, 0x69, 0x74, // ghp vec3 a_posit
+ 0x69, 0x6f, 0x6e, 0x3b, 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x20, 0x68, // ion;.attribute h
+ 0x69, 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, 0x32, 0x20, 0x61, 0x5f, 0x74, 0x65, 0x78, 0x63, // ighp vec2 a_texc
+ 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x3b, 0x0a, 0x76, 0x61, 0x72, 0x79, 0x69, 0x6e, 0x67, 0x20, 0x68, // oord0;.varying h
+ 0x69, 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, 0x32, 0x20, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, // ighp vec2 v_texc
+ 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x3b, 0x0a, 0x75, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x20, 0x68, // oord0;.uniform h
+ 0x69, 0x67, 0x68, 0x70, 0x20, 0x6d, 0x61, 0x74, 0x34, 0x20, 0x75, 0x5f, 0x6d, 0x6f, 0x64, 0x65, // ighp mat4 u_mode
+ 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x3b, 0x0a, 0x76, 0x6f, 0x69, 0x64, 0x20, // lViewProj;.void
+ 0x6d, 0x61, 0x69, 0x6e, 0x20, 0x28, 0x29, 0x0a, 0x7b, 0x0a, 0x20, 0x20, 0x68, 0x69, 0x67, 0x68, // main ().{. high
+ 0x70, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x3b, // p vec4 tmpvar_1;
+ 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x2e, 0x77, 0x20, 0x3d, 0x20, // . tmpvar_1.w =
+ 0x31, 0x2e, 0x30, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x2e, // 1.0;. tmpvar_1.
+ 0x78, 0x79, 0x7a, 0x20, 0x3d, 0x20, 0x61, 0x5f, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, // xyz = a_position
+ 0x3b, 0x0a, 0x20, 0x20, 0x67, 0x6c, 0x5f, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x20, // ;. gl_Position
+ 0x3d, 0x20, 0x28, 0x75, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, // = (u_modelViewPr
+ 0x6f, 0x6a, 0x20, 0x2a, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x29, 0x3b, 0x0a, // oj * tmpvar_1);.
+ 0x20, 0x20, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x20, 0x3d, 0x20, // v_texcoord0 =
+ 0x61, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, // a_texcoord0;.}..
+ 0x00, // .
+};
+static const uint8_t vs_imgui_latlong_dx9[319] =
+{
+ 0x56, 0x53, 0x48, 0x03, 0x6f, 0x1e, 0x3e, 0x3c, 0x01, 0x00, 0x0f, 0x75, 0x5f, 0x6d, 0x6f, 0x64, // VSH.o.><...u_mod
+ 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x09, 0x01, 0x00, 0x00, 0x04, 0x00, // elViewProj......
+ 0x1c, 0x01, 0x00, 0x03, 0xfe, 0xff, 0xfe, 0xff, 0x23, 0x00, 0x43, 0x54, 0x41, 0x42, 0x1c, 0x00, // ........#.CTAB..
+ 0x00, 0x00, 0x57, 0x00, 0x00, 0x00, 0x00, 0x03, 0xfe, 0xff, 0x01, 0x00, 0x00, 0x00, 0x1c, 0x00, // ..W.............
+ 0x00, 0x00, 0x00, 0x81, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x02, 0x00, // ......P...0.....
+ 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x75, 0x5f, // ......@.......u_
+ 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x00, 0x03, 0x00, // modelViewProj...
+ 0x03, 0x00, 0x04, 0x00, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x76, 0x73, // ..............vs
+ 0x5f, 0x33, 0x5f, 0x30, 0x00, 0x4d, 0x69, 0x63, 0x72, 0x6f, 0x73, 0x6f, 0x66, 0x74, 0x20, 0x28, // _3_0.Microsoft (
+ 0x52, 0x29, 0x20, 0x48, 0x4c, 0x53, 0x4c, 0x20, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x20, 0x43, // R) HLSL Shader C
+ 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x72, 0x20, 0x39, 0x2e, 0x32, 0x39, 0x2e, 0x39, 0x35, 0x32, // ompiler 9.29.952
+ 0x2e, 0x33, 0x31, 0x31, 0x31, 0x00, 0x1f, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, // .3111...........
+ 0x0f, 0x90, 0x1f, 0x00, 0x00, 0x02, 0x05, 0x00, 0x00, 0x80, 0x01, 0x00, 0x0f, 0x90, 0x1f, 0x00, // ................
+ 0x00, 0x02, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x0f, 0xe0, 0x1f, 0x00, 0x00, 0x02, 0x05, 0x00, // ................
+ 0x00, 0x80, 0x01, 0x00, 0x03, 0xe0, 0x05, 0x00, 0x00, 0x03, 0x00, 0x00, 0x0f, 0x80, 0x01, 0x00, // ................
+ 0xe4, 0xa0, 0x00, 0x00, 0x55, 0x90, 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, 0x0f, 0x80, 0x00, 0x00, // ....U...........
+ 0xe4, 0xa0, 0x00, 0x00, 0x00, 0x90, 0x00, 0x00, 0xe4, 0x80, 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, // ................
+ 0x0f, 0x80, 0x02, 0x00, 0xe4, 0xa0, 0x00, 0x00, 0xaa, 0x90, 0x00, 0x00, 0xe4, 0x80, 0x02, 0x00, // ................
+ 0x00, 0x03, 0x00, 0x00, 0x0f, 0xe0, 0x00, 0x00, 0xe4, 0x80, 0x03, 0x00, 0xe4, 0xa0, 0x01, 0x00, // ................
+ 0x00, 0x02, 0x01, 0x00, 0x03, 0xe0, 0x01, 0x00, 0xe4, 0x90, 0xff, 0xff, 0x00, 0x00, 0x00, // ...............
+};
+static const uint8_t vs_imgui_latlong_dx11[518] =
+{
+ 0x56, 0x53, 0x48, 0x03, 0x6f, 0x1e, 0x3e, 0x3c, 0x01, 0x00, 0x0f, 0x75, 0x5f, 0x6d, 0x6f, 0x64, // VSH.o.><...u_mod
+ 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x09, 0x00, 0xe0, 0x09, 0x04, 0x00, // elViewProj......
+ 0xdc, 0x01, 0x44, 0x58, 0x42, 0x43, 0xb0, 0x50, 0xdf, 0x0d, 0x1e, 0x85, 0x4e, 0xbe, 0xdd, 0xef, // ..DXBC.P....N...
+ 0x92, 0x24, 0x45, 0x46, 0x54, 0x49, 0x01, 0x00, 0x00, 0x00, 0xdc, 0x01, 0x00, 0x00, 0x03, 0x00, // .$EFTI..........
+ 0x00, 0x00, 0x2c, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0xd8, 0x00, 0x00, 0x00, 0x49, 0x53, // ..,...........IS
+ 0x47, 0x4e, 0x4c, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x38, 0x00, // GNL...........8.
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, // ................
+ 0x00, 0x00, 0x07, 0x07, 0x00, 0x00, 0x41, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ......A.........
+ 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x03, 0x00, 0x00, 0x50, 0x4f, // ..............PO
+ 0x53, 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x00, 0x54, 0x45, 0x58, 0x43, 0x4f, 0x4f, 0x52, 0x44, 0x00, // SITION.TEXCOORD.
+ 0xab, 0xab, 0x4f, 0x53, 0x47, 0x4e, 0x50, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x00, // ..OSGNP.........
+ 0x00, 0x00, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x00, // ..8.............
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x44, 0x00, 0x00, 0x00, 0x00, 0x00, // ..........D.....
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x0c, // ................
+ 0x00, 0x00, 0x53, 0x56, 0x5f, 0x50, 0x4f, 0x53, 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x00, 0x54, 0x45, // ..SV_POSITION.TE
+ 0x58, 0x43, 0x4f, 0x4f, 0x52, 0x44, 0x00, 0xab, 0xab, 0xab, 0x53, 0x48, 0x44, 0x52, 0xfc, 0x00, // XCOORD....SHDR..
+ 0x00, 0x00, 0x40, 0x00, 0x01, 0x00, 0x3f, 0x00, 0x00, 0x00, 0x59, 0x00, 0x00, 0x04, 0x46, 0x8e, // ..@...?...Y...F.
+ 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa2, 0x00, 0x00, 0x00, 0x5f, 0x00, 0x00, 0x03, 0x72, 0x10, // ........._...r.
+ 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5f, 0x00, 0x00, 0x03, 0x32, 0x10, 0x10, 0x00, 0x01, 0x00, // ......_...2.....
+ 0x00, 0x00, 0x67, 0x00, 0x00, 0x04, 0xf2, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, // ..g.... ........
+ 0x00, 0x00, 0x65, 0x00, 0x00, 0x03, 0x32, 0x20, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x68, 0x00, // ..e...2 ......h.
+ 0x00, 0x02, 0x01, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x08, 0xf2, 0x00, 0x10, 0x00, 0x00, 0x00, // ......8.........
+ 0x00, 0x00, 0x56, 0x15, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, // ..V.......F. ...
+ 0x00, 0x00, 0x9f, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0a, 0xf2, 0x00, 0x10, 0x00, 0x00, 0x00, // ......2.........
+ 0x00, 0x00, 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x9e, 0x00, 0x00, 0x00, 0x06, 0x10, // ..F. ...........
+ 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x32, 0x00, // ......F.......2.
+ 0x00, 0x0a, 0xf2, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, // ..........F. ...
+ 0x00, 0x00, 0xa0, 0x00, 0x00, 0x00, 0xa6, 0x1a, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x0e, // ..............F.
+ 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0xf2, 0x20, 0x10, 0x00, 0x00, 0x00, // ........... ....
+ 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, // ..F.......F. ...
+ 0x00, 0x00, 0xa1, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x05, 0x32, 0x20, 0x10, 0x00, 0x01, 0x00, // ......6...2 ....
+ 0x00, 0x00, 0x46, 0x10, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x01, 0x00, 0x02, // ..F.......>.....
+ 0x01, 0x00, 0x10, 0x00, 0x30, 0x0a, // ....0.
+};
diff --git a/3rdparty/bgfx/examples/common/imgui/vs_imgui_latlong.sc b/3rdparty/bgfx/examples/common/imgui/vs_imgui_latlong.sc
new file mode 100644
index 00000000000..667fc3dc97a
--- /dev/null
+++ b/3rdparty/bgfx/examples/common/imgui/vs_imgui_latlong.sc
@@ -0,0 +1,15 @@
+$input a_position, a_texcoord0
+$output v_texcoord0
+
+/*
+ * Copyright 2015 Dario Manesku. All rights reserved.
+ * License: http://www.opensource.org/licenses/BSD-2-Clause
+ */
+
+#include <bgfx_shader.sh>
+
+void main()
+{
+ gl_Position = mul(u_modelViewProj, vec4(a_position, 1.0) );
+ v_texcoord0 = a_texcoord0;
+}
diff --git a/3rdparty/bgfx/include/bgfx.c99.h b/3rdparty/bgfx/include/bgfx.c99.h
index afc1c44edba..df1930e5f5a 100644
--- a/3rdparty/bgfx/include/bgfx.c99.h
+++ b/3rdparty/bgfx/include/bgfx.c99.h
@@ -265,6 +265,7 @@ typedef struct bgfx_texture_info
uint16_t depth;
uint8_t numMips;
uint8_t bitsPerPixel;
+ bool cubeMap;
} bgfx_texture_info_t;
@@ -870,7 +871,7 @@ BGFX_C_API void bgfx_destroy_program(bgfx_program_handle_t _handle);
/**
* Calculate amount of memory required for texture.
*/
-BGFX_C_API void bgfx_calc_texture_size(bgfx_texture_info_t* _info, uint16_t _width, uint16_t _height, uint16_t _depth, uint8_t _numMips, bgfx_texture_format_t _format);
+BGFX_C_API void bgfx_calc_texture_size(bgfx_texture_info_t* _info, uint16_t _width, uint16_t _height, uint16_t _depth, bool _cubeMap, uint8_t _numMips, bgfx_texture_format_t _format);
/**
* Create texture from memory buffer.
diff --git a/3rdparty/bgfx/include/bgfx.h b/3rdparty/bgfx/include/bgfx.h
index c81a51e03bc..31bf19a6fbc 100644
--- a/3rdparty/bgfx/include/bgfx.h
+++ b/3rdparty/bgfx/include/bgfx.h
@@ -360,6 +360,7 @@ namespace bgfx
uint16_t depth; //!< Texture depth.
uint8_t numMips; //!< Number of MIP maps.
uint8_t bitsPerPixel; //!< Format bits per pixel.
+ bool cubeMap; //!< Texture is cubemap.
};
///
@@ -817,7 +818,7 @@ namespace bgfx
void destroyProgram(ProgramHandle _handle);
/// Calculate amount of memory required for texture.
- void calcTextureSize(TextureInfo& _info, uint16_t _width, uint16_t _height, uint16_t _depth, uint8_t _numMips, TextureFormat::Enum _format);
+ void calcTextureSize(TextureInfo& _info, uint16_t _width, uint16_t _height, uint16_t _depth, bool _cubeMap, uint8_t _numMips, TextureFormat::Enum _format);
/// Create texture from memory buffer.
///
diff --git a/3rdparty/bgfx/include/bgfxplatform.h b/3rdparty/bgfx/include/bgfxplatform.h
index 08b93844ef2..1e073de835e 100644
--- a/3rdparty/bgfx/include/bgfxplatform.h
+++ b/3rdparty/bgfx/include/bgfxplatform.h
@@ -51,12 +51,11 @@ namespace bgfx
} // namespace bgfx
#elif BX_PLATFORM_FREEBSD || BX_PLATFORM_LINUX || BX_PLATFORM_RPI
-# include <X11/Xlib.h>
namespace bgfx
{
///
- void x11SetDisplayWindow(::Display* _display, ::Window _window);
+ void x11SetDisplayWindow(void* _display, uint32_t _window);
} // namespace bgfx
diff --git a/3rdparty/bgfx/scripts/bgfx.lua b/3rdparty/bgfx/scripts/bgfx.lua
index 71bce9ac8c1..c42d57f0194 100644
--- a/3rdparty/bgfx/scripts/bgfx.lua
+++ b/3rdparty/bgfx/scripts/bgfx.lua
@@ -14,13 +14,16 @@ function bgfxProject(_name, _kind, _defines)
"BGFX_SHARED_LIB_BUILD=1",
}
+ configuration { "vs20* or mingw*" }
+ links {
+ "gdi32",
+ "psapi",
+ }
+
configuration { "mingw*" }
linkoptions {
"-shared",
}
- links {
- "gdi32",
- }
configuration {}
end
diff --git a/3rdparty/bgfx/src/bgfx.cpp b/3rdparty/bgfx/src/bgfx.cpp
index ccc6a86b38a..35320e1a48f 100644
--- a/3rdparty/bgfx/src/bgfx.cpp
+++ b/3rdparty/bgfx/src/bgfx.cpp
@@ -34,10 +34,10 @@ namespace bgfx
g_bgfxEaglLayer = _layer;
}
#elif BX_PLATFORM_LINUX
- ::Display* g_bgfxX11Display;
- ::Window g_bgfxX11Window;
+ void* g_bgfxX11Display;
+ uint32_t g_bgfxX11Window;
- void x11SetDisplayWindow(::Display* _display, ::Window _window)
+ void x11SetDisplayWindow(void* _display, uint32_t _window)
{
g_bgfxX11Display = _display;
g_bgfxX11Window = _window;
@@ -2309,27 +2309,33 @@ again:
s_ctx->destroyProgram(_handle);
}
- void calcTextureSize(TextureInfo& _info, uint16_t _width, uint16_t _height, uint16_t _depth, uint8_t _numMips, TextureFormat::Enum _format)
+ void calcTextureSize(TextureInfo& _info, uint16_t _width, uint16_t _height, uint16_t _depth, bool _cubeMap, uint8_t _numMips, TextureFormat::Enum _format)
{
- _width = bx::uint32_max(1, _width);
- _height = bx::uint32_max(1, _height);
+ const ImageBlockInfo& blockInfo = getBlockInfo(_format);
+ const uint8_t bpp = blockInfo.bitsPerPixel;
+ const uint32_t blockWidth = blockInfo.blockWidth;
+ const uint32_t blockHeight = blockInfo.blockHeight;
+ const uint32_t minBlockX = blockInfo.minBlockX;
+ const uint32_t minBlockY = blockInfo.minBlockY;
+
+ _width = bx::uint32_max(blockWidth * minBlockX, ( (_width + blockWidth - 1) / blockWidth)*blockWidth);
+ _height = bx::uint32_max(blockHeight * minBlockY, ( (_height + blockHeight - 1) / blockHeight)*blockHeight);
_depth = bx::uint32_max(1, _depth);
_numMips = bx::uint32_max(1, _numMips);
uint32_t width = _width;
uint32_t height = _height;
uint32_t depth = _depth;
-
- uint32_t bpp = getBitsPerPixel(_format);
- uint32_t size = 0;
+ uint32_t sides = _cubeMap ? 6 : 1;
+ uint32_t size = 0;
for (uint32_t lod = 0; lod < _numMips; ++lod)
{
- width = bx::uint32_max(1, width);
- height = bx::uint32_max(1, height);
+ width = bx::uint32_max(blockWidth * minBlockX, ( (width + blockWidth - 1) / blockWidth )*blockWidth);
+ height = bx::uint32_max(blockHeight * minBlockY, ( (height + blockHeight - 1) / blockHeight)*blockHeight);
depth = bx::uint32_max(1, depth);
- size += width*height*depth*bpp/8;
+ size += width*height*depth*bpp/8 * sides;
width >>= 1;
height >>= 1;
@@ -2341,6 +2347,7 @@ again:
_info.height = _height;
_info.depth = _depth;
_info.numMips = _numMips;
+ _info.cubeMap = _cubeMap;
_info.storageSize = size;
_info.bitsPerPixel = bpp;
}
@@ -2362,7 +2369,7 @@ again:
&& NULL != _mem)
{
TextureInfo ti;
- calcTextureSize(ti, _width, _height, 1, _numMips, _format);
+ calcTextureSize(ti, _width, _height, 1, false, _numMips, _format);
BX_CHECK(ti.storageSize == _mem->size
, "createTexture2D: Texture storage size doesn't match passed memory size (storage size: %d, memory size: %d)"
, ti.storageSize
@@ -2403,7 +2410,7 @@ again:
&& NULL != _mem)
{
TextureInfo ti;
- calcTextureSize(ti, _width, _height, _depth, _numMips, _format);
+ calcTextureSize(ti, _width, _height, _depth, false, _numMips, _format);
BX_CHECK(ti.storageSize == _mem->size
, "createTexture3D: Texture storage size doesn't match passed memory size (storage size: %d, memory size: %d)"
, ti.storageSize
@@ -2443,10 +2450,10 @@ again:
&& NULL != _mem)
{
TextureInfo ti;
- calcTextureSize(ti, _size, _size, 1, _numMips, _format);
- BX_CHECK(ti.storageSize*6 == _mem->size
+ calcTextureSize(ti, _size, _size, 1, true, _numMips, _format);
+ BX_CHECK(ti.storageSize == _mem->size
, "createTextureCube: Texture storage size doesn't match passed memory size (storage size: %d, memory size: %d)"
- , ti.storageSize*6
+ , ti.storageSize
, _mem->size
);
}
@@ -2459,15 +2466,15 @@ again:
bx::write(&writer, magic);
TextureCreate tc;
- tc.m_flags = _flags;
- tc.m_width = _size;
- tc.m_height = _size;
- tc.m_sides = 6;
- tc.m_depth = 0;
+ tc.m_flags = _flags;
+ tc.m_width = _size;
+ tc.m_height = _size;
+ tc.m_sides = 6;
+ tc.m_depth = 0;
tc.m_numMips = _numMips;
- tc.m_format = uint8_t(_format);
+ tc.m_format = uint8_t(_format);
tc.m_cubeMap = true;
- tc.m_mem = _mem;
+ tc.m_mem = _mem;
bx::write(&writer, tc);
return s_ctx->createTexture(mem, _flags, 0, NULL);
@@ -3194,10 +3201,10 @@ BGFX_C_API void bgfx_destroy_program(bgfx_program_handle_t _handle)
bgfx::destroyProgram(handle.cpp);
}
-BGFX_C_API void bgfx_calc_texture_size(bgfx_texture_info_t* _info, uint16_t _width, uint16_t _height, uint16_t _depth, uint8_t _numMips, bgfx_texture_format_t _format)
+BGFX_C_API void bgfx_calc_texture_size(bgfx_texture_info_t* _info, uint16_t _width, uint16_t _height, uint16_t _depth, bool _cubeMap, uint8_t _numMips, bgfx_texture_format_t _format)
{
bgfx::TextureInfo& info = *(bgfx::TextureInfo*)_info;
- bgfx::calcTextureSize(info, _width, _height, _depth, _numMips, bgfx::TextureFormat::Enum(_format) );
+ bgfx::calcTextureSize(info, _width, _height, _depth, _cubeMap, _numMips, bgfx::TextureFormat::Enum(_format) );
}
BGFX_C_API bgfx_texture_handle_t bgfx_create_texture(const bgfx_memory_t* _mem, uint32_t _flags, uint8_t _skip, bgfx_texture_info_t* _info)
diff --git a/3rdparty/bgfx/src/bgfx_compute.sh b/3rdparty/bgfx/src/bgfx_compute.sh
index 2ce9b608178..5ad2959b50d 100644
--- a/3rdparty/bgfx/src/bgfx_compute.sh
+++ b/3rdparty/bgfx/src/bgfx_compute.sh
@@ -20,6 +20,10 @@ uint floatBitsToUint(float _x) { return asuint(_x); }
uvec2 floatBitsToUint(vec2 _x) { return asuint(_x); }
uvec3 floatBitsToUint(vec3 _x) { return asuint(_x); }
uvec4 floatBitsToUint(vec4 _x) { return asuint(_x); }
+int floatBitsToInt(float _x) { return asint(_x); }
+ivec2 floatBitsToInt(vec2 _x) { return asint(_x); }
+ivec3 floatBitsToInt(vec3 _x) { return asint(_x); }
+ivec4 floatBitsToInt(vec4 _x) { return asint(_x); }
#define SHARED groupshared
@@ -38,6 +42,16 @@ vec4 imageLoad(Texture2D _image, ivec2 _uv)
return _image.Load(uint3(_uv.xy, 0) );
}
+uint imageLoad(Texture2D<uint> _image, ivec2 _uv)
+{
+ return _image.Load(uint3(_uv.xy, 0) );
+}
+
+uint imageLoad(RWTexture2D<uint> _image, ivec2 _uv)
+{
+ return _image[_uv.xy];
+}
+
ivec2 imageSize(Texture2D _image)
{
ivec2 result;
@@ -45,11 +59,6 @@ ivec2 imageSize(Texture2D _image)
return result;
}
-//vec4 imageLoad(RWTexture2D<float4> _image, ivec2 _uv)
-//{
-// return _image[_uv];
-//}
-
ivec2 imageSize(RWTexture2D<float4> _image)
{
ivec2 result;
@@ -57,11 +66,23 @@ ivec2 imageSize(RWTexture2D<float4> _image)
return result;
}
+ivec2 imageSize(RWTexture2D<uint> _image)
+{
+ ivec2 result;
+ _image.GetDimensions(result.x, result.y);
+ return result;
+}
+
void imageStore(RWTexture2D<float4> _image, ivec2 _uv, vec4 _rgba)
{
_image[_uv] = _rgba;
}
+void imageStore(RWTexture2D<uint> _image, ivec2 _uv, uvec4 _r)
+{
+ _image[_uv] = _r.x;
+}
+
#define __ATOMIC_IMPL_TYPE(_genType, _glFunc, _dxFunc) \
_genType _glFunc(_genType _mem, _genType _data) \
{ \
diff --git a/3rdparty/bgfx/src/bgfx_p.h b/3rdparty/bgfx/src/bgfx_p.h
index 4562aaaf91c..e158b6021bd 100644
--- a/3rdparty/bgfx/src/bgfx_p.h
+++ b/3rdparty/bgfx/src/bgfx_p.h
@@ -201,8 +201,8 @@ namespace bgfx
#elif BX_PLATFORM_IOS
extern void* g_bgfxEaglLayer;
#elif BX_PLATFORM_LINUX
- extern ::Display* g_bgfxX11Display;
- extern ::Window g_bgfxX11Window;
+ extern void* g_bgfxX11Display;
+ extern uint32_t g_bgfxX11Window;
#elif BX_PLATFORM_OSX
extern void* g_bgfxNSWindow;
#elif BX_PLATFORM_WINDOWS
@@ -2681,6 +2681,7 @@ namespace bgfx
, (uint16_t)imageContainer.m_width
, (uint16_t)imageContainer.m_height
, (uint16_t)imageContainer.m_depth
+ , imageContainer.m_cubeMap
, imageContainer.m_numMips
, TextureFormat::Enum(imageContainer.m_format)
);
@@ -2689,11 +2690,12 @@ namespace bgfx
{
_info->format = TextureFormat::Unknown;
_info->storageSize = 0;
- _info->width = 0;
- _info->height = 0;
- _info->depth = 0;
+ _info->width = 0;
+ _info->height = 0;
+ _info->depth = 0;
_info->numMips = 0;
_info->bitsPerPixel = 0;
+ _info->cubeMap = false;
}
}
diff --git a/3rdparty/bgfx/src/glcontext_egl.cpp b/3rdparty/bgfx/src/glcontext_egl.cpp
index 77abfa96a5c..9ef95846fef 100644
--- a/3rdparty/bgfx/src/glcontext_egl.cpp
+++ b/3rdparty/bgfx/src/glcontext_egl.cpp
@@ -185,8 +185,8 @@ EGL_IMPORT
ndt = GetDC(g_bgfxHwnd);
nwh = g_bgfxHwnd;
# elif BX_PLATFORM_LINUX
- ndt = g_bgfxX11Display;
- nwh = g_bgfxX11Window;
+ ndt = (EGLNativeDisplayType)g_bgfxX11Display;
+ nwh = (EGLNativeWindowType)g_bgfxX11Window;
# endif // BX_PLATFORM_
m_display = eglGetDisplay(ndt);
BGFX_FATAL(m_display != EGL_NO_DISPLAY, Fatal::UnableToInitialize, "Failed to create display %p", m_display);
diff --git a/3rdparty/bgfx/src/glcontext_glx.cpp b/3rdparty/bgfx/src/glcontext_glx.cpp
index fa738c25a0e..1168672cffb 100644
--- a/3rdparty/bgfx/src/glcontext_glx.cpp
+++ b/3rdparty/bgfx/src/glcontext_glx.cpp
@@ -29,23 +29,23 @@ namespace bgfx
SwapChainGL(::Window _window, XVisualInfo* _visualInfo, GLXContext _context)
: m_window(_window)
{
- m_context = glXCreateContext(g_bgfxX11Display, _visualInfo, _context, GL_TRUE);
+ m_context = glXCreateContext( (::Display*)g_bgfxX11Display, _visualInfo, _context, GL_TRUE);
}
~SwapChainGL()
{
- glXMakeCurrent(g_bgfxX11Display, 0, 0);
- glXDestroyContext(g_bgfxX11Display, m_context);
+ glXMakeCurrent( (::Display*)g_bgfxX11Display, 0, 0);
+ glXDestroyContext( (::Display*)g_bgfxX11Display, m_context);
}
void makeCurrent()
{
- glXMakeCurrent(g_bgfxX11Display, m_window, m_context);
+ glXMakeCurrent( (::Display*)g_bgfxX11Display, m_window, m_context);
}
void swapBuffers()
{
- glXSwapBuffers(g_bgfxX11Display, m_window);
+ glXSwapBuffers( (::Display*)g_bgfxX11Display, m_window);
}
Window m_window;
@@ -55,10 +55,10 @@ namespace bgfx
void GlContext::create(uint32_t _width, uint32_t _height)
{
BX_UNUSED(_width, _height);
- XLockDisplay(g_bgfxX11Display);
+ XLockDisplay( (::Display*)g_bgfxX11Display);
int major, minor;
- bool version = glXQueryVersion(g_bgfxX11Display, &major, &minor);
+ bool version = glXQueryVersion( (::Display*)g_bgfxX11Display, &major, &minor);
BGFX_FATAL(version, Fatal::UnableToInitialize, "Failed to query GLX version");
BGFX_FATAL( (major == 1 && minor >= 2) || major > 1
, Fatal::UnableToInitialize
@@ -67,9 +67,9 @@ namespace bgfx
, minor
);
- int32_t screen = DefaultScreen(g_bgfxX11Display);
+ int32_t screen = DefaultScreen( (::Display*)g_bgfxX11Display);
- const char* extensions = glXQueryExtensionsString(g_bgfxX11Display, screen);
+ const char* extensions = glXQueryExtensionsString( (::Display*)g_bgfxX11Display, screen);
BX_TRACE("GLX extensions:");
dumpExtensions(extensions);
@@ -91,13 +91,13 @@ namespace bgfx
GLXFBConfig bestConfig = NULL;
int numConfigs;
- GLXFBConfig* configs = glXChooseFBConfig(g_bgfxX11Display, screen, attrsGlx, &numConfigs);
+ GLXFBConfig* configs = glXChooseFBConfig( (::Display*)g_bgfxX11Display, screen, attrsGlx, &numConfigs);
BX_TRACE("glX num configs %d", numConfigs);
for (int ii = 0; ii < numConfigs; ++ii)
{
- m_visualInfo = glXGetVisualFromFBConfig(g_bgfxX11Display, configs[ii]);
+ m_visualInfo = glXGetVisualFromFBConfig( (::Display*)g_bgfxX11Display, configs[ii]);
if (NULL != m_visualInfo)
{
BX_TRACE("---");
@@ -105,7 +105,7 @@ namespace bgfx
for (uint32_t attr = 6; attr < BX_COUNTOF(attrsGlx)-1 && attrsGlx[attr] != None; attr += 2)
{
int value;
- glXGetFBConfigAttrib(g_bgfxX11Display, configs[ii], attrsGlx[attr], &value);
+ glXGetFBConfigAttrib( (::Display*)g_bgfxX11Display, configs[ii], attrsGlx[attr], &value);
BX_TRACE("glX %d/%d %2d: %4x, %8x (%8x%s)"
, ii
, numConfigs
@@ -141,7 +141,7 @@ namespace bgfx
BGFX_FATAL(m_visualInfo, Fatal::UnableToInitialize, "Failed to find a suitable X11 display configuration.");
BX_TRACE("Create GL 2.1 context.");
- m_context = glXCreateContext(g_bgfxX11Display, m_visualInfo, 0, GL_TRUE);
+ m_context = glXCreateContext( (::Display*)g_bgfxX11Display, m_visualInfo, 0, GL_TRUE);
BGFX_FATAL(NULL != m_context, Fatal::UnableToInitialize, "Failed to create GL 2.1 context.");
#if BGFX_CONFIG_RENDERER_OPENGL >= 31
@@ -158,11 +158,11 @@ namespace bgfx
0,
};
- GLXContext context = glXCreateContextAttribsARB(g_bgfxX11Display, bestConfig, 0, true, contextAttrs);
+ GLXContext context = glXCreateContextAttribsARB( (::Display*)g_bgfxX11Display, bestConfig, 0, true, contextAttrs);
if (NULL != context)
{
- glXDestroyContext(g_bgfxX11Display, m_context);
+ glXDestroyContext( (::Display*)g_bgfxX11Display, m_context);
m_context = context;
}
}
@@ -170,17 +170,17 @@ namespace bgfx
BX_UNUSED(bestConfig);
#endif // BGFX_CONFIG_RENDERER_OPENGL >= 31
- XUnlockDisplay(g_bgfxX11Display);
+ XUnlockDisplay( (::Display*)g_bgfxX11Display);
import();
- glXMakeCurrent(g_bgfxX11Display, g_bgfxX11Window, m_context);
+ glXMakeCurrent( (::Display*)g_bgfxX11Display, (::Window)g_bgfxX11Window, m_context);
glXSwapIntervalEXT = (PFNGLXSWAPINTERVALEXTPROC)glXGetProcAddress( (const GLubyte*)"glXSwapIntervalEXT");
if (NULL != glXSwapIntervalEXT)
{
BX_TRACE("Using glXSwapIntervalEXT.");
- glXSwapIntervalEXT(g_bgfxX11Display, g_bgfxX11Window, 0);
+ glXSwapIntervalEXT( (::Display*)g_bgfxX11Display, (::Window)g_bgfxX11Window, 0);
}
else
{
@@ -203,13 +203,13 @@ namespace bgfx
glClearColor(0.0f, 0.0f, 0.0f, 1.0f);
glClear(GL_COLOR_BUFFER_BIT);
- glXSwapBuffers(g_bgfxX11Display, g_bgfxX11Window);
+ glXSwapBuffers( (::Display*)g_bgfxX11Display, (::Window)g_bgfxX11Window);
}
void GlContext::destroy()
{
- glXMakeCurrent(g_bgfxX11Display, 0, 0);
- glXDestroyContext(g_bgfxX11Display, m_context);
+ glXMakeCurrent( (::Display*)g_bgfxX11Display, 0, 0);
+ glXDestroyContext( (::Display*)g_bgfxX11Display, m_context);
XFree(m_visualInfo);
}
@@ -219,7 +219,7 @@ namespace bgfx
if (NULL != glXSwapIntervalEXT)
{
- glXSwapIntervalEXT(g_bgfxX11Display, g_bgfxX11Window, interval);
+ glXSwapIntervalEXT( (::Display*)g_bgfxX11Display, (::Window)g_bgfxX11Window, interval);
}
else if (NULL != glXSwapIntervalMESA)
{
@@ -250,8 +250,8 @@ namespace bgfx
{
if (NULL == _swapChain)
{
- glXMakeCurrent(g_bgfxX11Display, g_bgfxX11Window, m_context);
- glXSwapBuffers(g_bgfxX11Display, g_bgfxX11Window);
+ glXMakeCurrent( (::Display*)g_bgfxX11Display, (::Window)g_bgfxX11Window, m_context);
+ glXSwapBuffers( (::Display*)g_bgfxX11Display, (::Window)g_bgfxX11Window);
}
else
{
@@ -264,7 +264,7 @@ namespace bgfx
{
if (NULL == _swapChain)
{
- glXMakeCurrent(g_bgfxX11Display, g_bgfxX11Window, m_context);
+ glXMakeCurrent( (::Display*)g_bgfxX11Display, (::Window)g_bgfxX11Window, m_context);
}
else
{
diff --git a/3rdparty/bgfx/src/glimports.h b/3rdparty/bgfx/src/glimports.h
index 69e5aff9223..93f8586cc03 100644
--- a/3rdparty/bgfx/src/glimports.h
+++ b/3rdparty/bgfx/src/glimports.h
@@ -230,7 +230,7 @@ GL_IMPORT______(false, PFNGLBUFFERDATAPROC, glBufferData)
GL_IMPORT______(false, PFNGLBUFFERSUBDATAPROC, glBufferSubData);
GL_IMPORT______(true, PFNGLCHECKFRAMEBUFFERSTATUSPROC, glCheckFramebufferStatus);
GL_IMPORT______(false, PFNGLCLEARPROC, glClear);
-GL_IMPORT______(false, PFNGLCLEARBUFFERFVPROC, glClearBufferfv);
+GL_IMPORT______(true, PFNGLCLEARBUFFERFVPROC, glClearBufferfv);
GL_IMPORT______(false, PFNGLCLEARCOLORPROC, glClearColor);
GL_IMPORT______(false, PFNGLCLEARSTENCILPROC, glClearStencil);
GL_IMPORT______(false, PFNGLCOLORMASKPROC, glColorMask);
diff --git a/3rdparty/bgfx/src/image.cpp b/3rdparty/bgfx/src/image.cpp
index eea632fed29..ed3b7ca8343 100644
--- a/3rdparty/bgfx/src/image.cpp
+++ b/3rdparty/bgfx/src/image.cpp
@@ -12,54 +12,61 @@ namespace bgfx
{
static const ImageBlockInfo s_imageBlockInfo[] =
{
- { 4, 4, 4, 8 }, // BC1
- { 8, 4, 4, 16 }, // BC2
- { 8, 4, 4, 16 }, // BC3
- { 4, 4, 4, 8 }, // BC4
- { 8, 4, 4, 16 }, // BC5
- { 8, 4, 4, 16 }, // BC6H
- { 8, 4, 4, 16 }, // BC7
- { 4, 4, 4, 8 }, // ETC1
- { 4, 4, 4, 8 }, // ETC2
- { 8, 4, 4, 16 }, // ETC2A
- { 4, 4, 4, 8 }, // ETC2A1
- { 2, 8, 4, 8 }, // PTC12
- { 4, 4, 4, 8 }, // PTC14
- { 2, 8, 4, 8 }, // PTC12A
- { 4, 4, 4, 8 }, // PTC14A
- { 2, 8, 4, 8 }, // PTC22
- { 4, 4, 4, 8 }, // PTC24
- { 0, 0, 0, 0 }, // Unknown
- { 1, 8, 1, 1 }, // R1
- { 8, 1, 1, 1 }, // R8
- { 16, 1, 1, 2 }, // R16
- { 16, 1, 1, 2 }, // R16F
- { 32, 1, 1, 4 }, // R32
- { 32, 1, 1, 4 }, // R32F
- { 16, 1, 1, 2 }, // RG8
- { 32, 1, 1, 4 }, // RG16
- { 32, 1, 1, 4 }, // RG16F
- { 64, 1, 1, 8 }, // RG32
- { 64, 1, 1, 8 }, // RG32F
- { 32, 1, 1, 4 }, // BGRA8
- { 64, 1, 1, 8 }, // RGBA16
- { 64, 1, 1, 8 }, // RGBA16F
- { 128, 1, 1, 16 }, // RGBA32
- { 128, 1, 1, 16 }, // RGBA32F
- { 16, 1, 1, 2 }, // R5G6B5
- { 16, 1, 1, 2 }, // RGBA4
- { 16, 1, 1, 2 }, // RGB5A1
- { 32, 1, 1, 4 }, // RGB10A2
- { 32, 1, 1, 4 }, // R11G11B10F
- { 0, 0, 0, 0 }, // UnknownDepth
- { 16, 1, 1, 2 }, // D16
- { 24, 1, 1, 3 }, // D24
- { 32, 1, 1, 4 }, // D24S8
- { 32, 1, 1, 4 }, // D32
- { 16, 1, 1, 2 }, // D16F
- { 24, 1, 1, 3 }, // D24F
- { 32, 1, 1, 4 }, // D32F
- { 8, 1, 1, 1 }, // D0S8
+ // +------------------ bits per pixel
+ // | +--------------- block width
+ // | | +------------ block height
+ // | | | +-------- block size
+ // | | | | +----- min blocks x
+ // | | | | | +-- min blocks y
+ // | | | | | |
+ { 4, 4, 4, 8, 1, 1 }, // BC1
+ { 8, 4, 4, 16, 1, 1 }, // BC2
+ { 8, 4, 4, 16, 1, 1 }, // BC3
+ { 4, 4, 4, 8, 1, 1 }, // BC4
+ { 8, 4, 4, 16, 1, 1 }, // BC5
+ { 8, 4, 4, 16, 1, 1 }, // BC6H
+ { 8, 4, 4, 16, 1, 1 }, // BC7
+ { 4, 4, 4, 8, 1, 1 }, // ETC1
+ { 4, 4, 4, 8, 1, 1 }, // ETC2
+ { 8, 4, 4, 16, 1, 1 }, // ETC2A
+ { 4, 4, 4, 8, 1, 1 }, // ETC2A1
+ { 2, 8, 4, 8, 2, 2 }, // PTC12
+ { 4, 4, 4, 8, 2, 2 }, // PTC14
+ { 2, 8, 4, 8, 2, 2 }, // PTC12A
+ { 4, 4, 4, 8, 2, 2 }, // PTC14A
+ { 2, 8, 4, 8, 2, 2 }, // PTC22
+ { 4, 4, 4, 8, 2, 2 }, // PTC24
+ { 0, 0, 0, 0, 1, 1 }, // Unknown
+ { 1, 8, 1, 1, 1, 1 }, // R1
+ { 8, 1, 1, 1, 1, 1 }, // R8
+ { 16, 1, 1, 2, 1, 1 }, // R16
+ { 16, 1, 1, 2, 1, 1 }, // R16F
+ { 32, 1, 1, 4, 1, 1 }, // R32
+ { 32, 1, 1, 4, 1, 1 }, // R32F
+ { 16, 1, 1, 2, 1, 1 }, // RG8
+ { 32, 1, 1, 4, 1, 1 }, // RG16
+ { 32, 1, 1, 4, 1, 1 }, // RG16F
+ { 64, 1, 1, 8, 1, 1 }, // RG32
+ { 64, 1, 1, 8, 1, 1 }, // RG32F
+ { 32, 1, 1, 4, 1, 1 }, // BGRA8
+ { 64, 1, 1, 8, 1, 1 }, // RGBA16
+ { 64, 1, 1, 8, 1, 1 }, // RGBA16F
+ { 128, 1, 1, 16, 1, 1 }, // RGBA32
+ { 128, 1, 1, 16, 1, 1 }, // RGBA32F
+ { 16, 1, 1, 2, 1, 1 }, // R5G6B5
+ { 16, 1, 1, 2, 1, 1 }, // RGBA4
+ { 16, 1, 1, 2, 1, 1 }, // RGB5A1
+ { 32, 1, 1, 4, 1, 1 }, // RGB10A2
+ { 32, 1, 1, 4, 1, 1 }, // R11G11B10F
+ { 0, 0, 0, 0, 1, 1 }, // UnknownDepth
+ { 16, 1, 1, 2, 1, 1 }, // D16
+ { 24, 1, 1, 3, 1, 1 }, // D24
+ { 32, 1, 1, 4, 1, 1 }, // D24S8
+ { 32, 1, 1, 4, 1, 1 }, // D32
+ { 16, 1, 1, 2, 1, 1 }, // D16F
+ { 24, 1, 1, 3, 1, 1 }, // D24F
+ { 32, 1, 1, 4, 1, 1 }, // D32F
+ { 8, 1, 1, 1, 1, 1 }, // D0S8
};
BX_STATIC_ASSERT(TextureFormat::Count == BX_COUNTOF(s_imageBlockInfo) );
@@ -1309,10 +1316,9 @@ namespace bgfx
{
uint32_t m_format;
TextureFormat::Enum m_textureFormat;
-
};
- static TranslateDdsFormat s_translateDdsFormat[] =
+ static TranslateDdsFormat s_translateDdsFourccFormat[] =
{
{ DDS_DXT1, TextureFormat::BC1 },
{ DDS_DXT2, TextureFormat::BC2 },
@@ -1376,6 +1382,22 @@ namespace bgfx
{ DXGI_FORMAT_R10G10B10A2_UNORM, TextureFormat::RGB10A2 },
};
+ struct TranslateDdsPixelFormat
+ {
+ uint32_t m_bitCount;
+ uint32_t m_bitmask[4];
+ TextureFormat::Enum m_textureFormat;
+ };
+
+ static TranslateDdsPixelFormat s_translateDdsPixelFormat[] =
+ {
+ { 32, { 0x00ff0000, 0x0000ff00, 0x000000ff, 0xff000000 }, TextureFormat::BGRA8 },
+ { 32, { 0x00ff0000, 0x0000ff00, 0x000000ff, 0x00000000 }, TextureFormat::BGRA8 },
+ { 32, { 0x000003ff, 0x000ffc00, 0x3ff00000, 0xc0000000 }, TextureFormat::RGB10A2 },
+ { 32, { 0x0000ffff, 0xffff0000, 0x00000000, 0x00000000 }, TextureFormat::RG16 },
+ { 32, { 0xffffffff, 0x00000000, 0x00000000, 0x00000000 }, TextureFormat::R32 },
+ };
+
bool imageParseDds(ImageContainer& _imageContainer, bx::ReaderSeekerI* _reader)
{
uint32_t headerSize;
@@ -1420,20 +1442,11 @@ namespace bgfx
uint32_t fourcc;
bx::read(_reader, fourcc);
- uint32_t rgbCount;
- bx::read(_reader, rgbCount);
-
- uint32_t rbitmask;
- bx::read(_reader, rbitmask);
-
- uint32_t gbitmask;
- bx::read(_reader, gbitmask);
-
- uint32_t bbitmask;
- bx::read(_reader, bbitmask);
+ uint32_t bitCount;
+ bx::read(_reader, bitCount);
- uint32_t abitmask;
- bx::read(_reader, abitmask);
+ uint32_t bitmask[4];
+ bx::read(_reader, bitmask, sizeof(bitmask) );
uint32_t caps[4];
bx::read(_reader, caps);
@@ -1479,14 +1492,31 @@ namespace bgfx
if (dxgiFormat == 0)
{
- uint32_t ddsFormat = pixelFlags & DDPF_FOURCC ? fourcc : pixelFlags;
-
- for (uint32_t ii = 0; ii < BX_COUNTOF(s_translateDdsFormat); ++ii)
+ if (DDPF_FOURCC == (pixelFlags & DDPF_FOURCC) )
{
- if (s_translateDdsFormat[ii].m_format == ddsFormat)
+ for (uint32_t ii = 0; ii < BX_COUNTOF(s_translateDdsFourccFormat); ++ii)
{
- format = s_translateDdsFormat[ii].m_textureFormat;
- break;
+ if (s_translateDdsFourccFormat[ii].m_format == fourcc)
+ {
+ format = s_translateDdsFourccFormat[ii].m_textureFormat;
+ break;
+ }
+ }
+ }
+ else
+ {
+ for (uint32_t ii = 0; ii < BX_COUNTOF(s_translateDdsPixelFormat); ++ii)
+ {
+ const TranslateDdsPixelFormat& pf = s_translateDdsPixelFormat[ii];
+ if (pf.m_bitCount == bitCount
+ && pf.m_bitmask[0] == bitmask[0]
+ && pf.m_bitmask[1] == bitmask[1]
+ && pf.m_bitmask[2] == bitmask[2]
+ && pf.m_bitmask[3] == bitmask[3])
+ {
+ format = pf.m_textureFormat;
+ break;
+ }
}
}
}
@@ -2103,6 +2133,8 @@ namespace bgfx
const uint32_t blockSize = blockInfo.blockSize;
const uint32_t blockWidth = blockInfo.blockWidth;
const uint32_t blockHeight = blockInfo.blockHeight;
+ const uint32_t minBlockX = blockInfo.minBlockX;
+ const uint32_t minBlockY = blockInfo.minBlockY;
if (UINT32_MAX == _imageContainer.m_offset)
{
@@ -2127,8 +2159,8 @@ namespace bgfx
// skip imageSize in KTX format.
offset += _imageContainer.m_ktx ? sizeof(uint32_t) : 0;
- width = bx::uint32_max(blockWidth, ( (width +blockWidth -1)/blockWidth )*blockWidth);
- height = bx::uint32_max(blockHeight, ( (height+blockHeight-1)/blockHeight)*blockHeight);
+ width = bx::uint32_max(blockWidth * minBlockX, ( (width + blockWidth - 1) / blockWidth )*blockWidth);
+ height = bx::uint32_max(blockHeight * minBlockY, ( (height + blockHeight - 1) / blockHeight)*blockHeight);
depth = bx::uint32_max(1, depth);
uint32_t size = width*height*depth*bpp/8;
diff --git a/3rdparty/bgfx/src/image.h b/3rdparty/bgfx/src/image.h
index 23fa05e299f..3ddb1086f7c 100644
--- a/3rdparty/bgfx/src/image.h
+++ b/3rdparty/bgfx/src/image.h
@@ -43,6 +43,8 @@ namespace bgfx
uint8_t blockWidth;
uint8_t blockHeight;
uint8_t blockSize;
+ uint8_t minBlockX;
+ uint8_t minBlockY;
};
///
diff --git a/3rdparty/bgfx/src/renderer_d3d11.cpp b/3rdparty/bgfx/src/renderer_d3d11.cpp
index 8f993f7668f..1cd7735e4e7 100644
--- a/3rdparty/bgfx/src/renderer_d3d11.cpp
+++ b/3rdparty/bgfx/src/renderer_d3d11.cpp
@@ -345,7 +345,7 @@ namespace bgfx
static const GUID IID_IDXGIDevice2 = { 0x05008617, 0xfbfd, 0x4051, { 0xa7, 0x90, 0x14, 0x48, 0x84, 0xb4, 0xf6, 0xa9 } };
static const GUID IID_IDXGIDevice3 = { 0x6007896c, 0x3244, 0x4afd, { 0xbf, 0x18, 0xa6, 0xd3, 0xbe, 0xda, 0x50, 0x23 } };
static const GUID IID_IDXGIAdapter = { 0x2411e7e1, 0x12ac, 0x4ccf, { 0xbd, 0x14, 0x97, 0x98, 0xe8, 0x53, 0x4d, 0xc0 } };
- static const GUID IID_ID3D11InfoQueue = { 0x6543dbb6, 0x1b48, 0x42f5, { 0xab, 0x82, 0xe9, 0x7e, 0xc7, 0x43, 0x26, 0xf6 } };
+ static const GUID IID_ID3D11InfoQueue = { 0x6543dbb6, 0x1b48, 0x42f5, { 0xab, 0x82, 0xe9, 0x7e, 0xc7, 0x43, 0x26, 0xf6 } };
static const GUID s_deviceIIDs[] =
{
@@ -2365,10 +2365,8 @@ namespace bgfx
BX_CHECK(m_dynamic, "Must be dynamic!");
D3D11_MAPPED_SUBRESOURCE mapped;
- D3D11_MAP type = m_dynamic && ( (0 == _offset && m_size == _size) || _discard)
- ? D3D11_MAP_WRITE_DISCARD
- : D3D11_MAP_WRITE_NO_OVERWRITE
- ;
+ BX_UNUSED(_discard);
+ D3D11_MAP type = D3D11_MAP_WRITE_DISCARD;
DX_CHECK(deviceCtx->Map(m_ptr, 0, type, 0, &mapped));
memcpy((uint8_t*)mapped.pData + _offset, _data, _size);
deviceCtx->Unmap(m_ptr, 0);
diff --git a/3rdparty/bgfx/src/renderer_d3d12.cpp b/3rdparty/bgfx/src/renderer_d3d12.cpp
index f2ff51948e7..25054230866 100644
--- a/3rdparty/bgfx/src/renderer_d3d12.cpp
+++ b/3rdparty/bgfx/src/renderer_d3d12.cpp
@@ -5,6 +5,10 @@
#include "bgfx_p.h"
+#if BGFX_CONFIG_RENDERER_DIRECT3D12
+# include "../../d3d12/src/renderer_d3d12.cpp"
+#else
+
namespace bgfx
{
RendererContextI* rendererCreateD3D12()
@@ -16,3 +20,5 @@ namespace bgfx
{
}
} // namespace bgfx
+
+#endif // BGFX_CONFIG_RENDERER_DIRECT3D12
diff --git a/3rdparty/bgfx/src/renderer_gl.cpp b/3rdparty/bgfx/src/renderer_gl.cpp
index 7aa0d24d00b..eb25d6a7013 100644
--- a/3rdparty/bgfx/src/renderer_gl.cpp
+++ b/3rdparty/bgfx/src/renderer_gl.cpp
@@ -3759,7 +3759,9 @@ namespace bgfx
}
}
- writeString(&writer, "precision mediump float;\n");
+ writeStringf(&writer, "precision %s float;\n"
+ , m_type == GL_FRAGMENT_SHADER ? "mediump" : "highp"
+ );
bx::write(&writer, code, codeLen);
bx::write(&writer, '\0');
@@ -4785,11 +4787,12 @@ namespace bgfx
&& 0 == draw.m_instanceDataOffset)
{
if (programChanged
- || currentState.m_vertexBuffer.idx != draw.m_vertexBuffer.idx
- || currentState.m_indexBuffer.idx != draw.m_indexBuffer.idx
- || currentState.m_instanceDataBuffer.idx != draw.m_instanceDataBuffer.idx
+ || baseVertex != draw.m_startVertex
+ || currentState.m_vertexBuffer.idx != draw.m_vertexBuffer.idx
+ || currentState.m_indexBuffer.idx != draw.m_indexBuffer.idx
|| currentState.m_instanceDataOffset != draw.m_instanceDataOffset
- || currentState.m_instanceDataStride != draw.m_instanceDataStride)
+ || currentState.m_instanceDataStride != draw.m_instanceDataStride
+ || currentState.m_instanceDataBuffer.idx != draw.m_instanceDataBuffer.idx)
{
bx::HashMurmur2A murmur;
murmur.begin();
diff --git a/3rdparty/bx/tools/bin/darwin/genie b/3rdparty/bx/tools/bin/darwin/genie
index 995beae5205..b8d2810cf59 100644
--- a/3rdparty/bx/tools/bin/darwin/genie
+++ b/3rdparty/bx/tools/bin/darwin/genie
Binary files differ
diff --git a/3rdparty/bx/tools/bin/linux/genie b/3rdparty/bx/tools/bin/linux/genie
index a8a9b501bce..0f7ae461996 100644
--- a/3rdparty/bx/tools/bin/linux/genie
+++ b/3rdparty/bx/tools/bin/linux/genie
Binary files differ
diff --git a/3rdparty/bx/tools/bin/windows/genie.exe b/3rdparty/bx/tools/bin/windows/genie.exe
index 12ebe425c3b..de1a09d8c19 100644
--- a/3rdparty/bx/tools/bin/windows/genie.exe
+++ b/3rdparty/bx/tools/bin/windows/genie.exe
Binary files differ
diff --git a/3rdparty/genie/README.md b/3rdparty/genie/README.md
index 0466392f7ac..7345b13653b 100644
--- a/3rdparty/genie/README.md
+++ b/3rdparty/genie/README.md
@@ -14,7 +14,7 @@ Supported project generators:
Download (stable)
-----------------
- version 172 (commit d5a8dc1e36d7120ad4b91bbc1d662c543aa8ba8d)
+ version 178 (commit f9ef54d6a5fa3421d141b8fe53683fe1a0fbd9cc)
Linux:
https://github.com/bkaradzic/bx/raw/master/tools/bin/linux/genie
diff --git a/3rdparty/genie/build/gmake.windows/genie.make b/3rdparty/genie/build/gmake.windows/genie.make
index e30b57d7fe5..ac042bc8b78 100644
--- a/3rdparty/genie/build/gmake.windows/genie.make
+++ b/3rdparty/genie/build/gmake.windows/genie.make
@@ -134,8 +134,8 @@ OBJECTS := \
OBJDIRS := \
$(OBJDIR) \
- $(OBJDIR)/src/host/lua-5.2.3/src \
$(OBJDIR)/src/host \
+ $(OBJDIR)/src/host/lua-5.2.3/src \
RESOURCES := \
@@ -156,8 +156,8 @@ $(TARGETDIR):
$(OBJDIRS):
@echo Creating $(OBJDIR)
-$(call MKDIR,$(OBJDIR))
- -$(call MKDIR,$(OBJDIR)/src/host/lua-5.2.3/src)
-$(call MKDIR,$(OBJDIR)/src/host)
+ -$(call MKDIR,$(OBJDIR)/src/host/lua-5.2.3/src)
clean:
@echo Cleaning genie
diff --git a/3rdparty/genie/src/actions/make/make_cpp.lua b/3rdparty/genie/src/actions/make/make_cpp.lua
index a0e5bd2bae1..e36bb41c05b 100644
--- a/3rdparty/genie/src/actions/make/make_cpp.lua
+++ b/3rdparty/genie/src/actions/make/make_cpp.lua
@@ -21,21 +21,10 @@
for _, platform in ipairs(platforms) do
for cfg in premake.eachconfig(prj, platform) do
- premake.gmake_cpp_config(cfg, cc)
+ premake.gmake_cpp_config(prj, cfg, cc)
end
end
- -- list intermediate files
- _p('OBJECTS := \\')
- for _, file in ipairs(prj.files) do
- if path.iscppfile(file) then
- _p('\t$(OBJDIR)/%s.o \\'
- , _MAKE.esc(path.trimdots(path.removeext(file)))
- )
- end
- end
- _p('')
-
-- list object directories
local objdirs = {}
for _, file in ipairs(prj.files) do
@@ -228,7 +217,7 @@
-- Write a block of configuration settings.
--
- function premake.gmake_cpp_config(cfg, cc)
+ function premake.gmake_cpp_config(prj, cfg, cc)
_p('ifeq ($(config),%s)', _MAKE.esc(cfg.shortname))
@@ -250,6 +239,27 @@
-- write out libraries, linker flags, and the link command
cpp.linker(cfg, cc)
+ -- add objects for compilation, and remove any that are excluded per config.
+ _p(' OBJECTS := \\')
+ for _, file in ipairs(prj.files) do
+ if path.iscppfile(file) then
+ -- check if file is excluded.
+ local excluded = false
+ for _, exclude in ipairs(cfg.excludes) do
+ excluded = (exclude == file)
+ if (excluded) then break end
+ end
+
+ -- if not excluded, add it.
+ if excluded == false then
+ _p('\t$(OBJDIR)/%s.o \\'
+ , _MAKE.esc(path.trimdots(path.removeext(file)))
+ )
+ end
+ end
+ end
+ _p('')
+
_p(' define PREBUILDCMDS')
if #cfg.prebuildcommands > 0 then
_p('\t@echo Running pre-build commands')
diff --git a/3rdparty/genie/src/host/scripts.c b/3rdparty/genie/src/host/scripts.c
index f79c4ca2a9a..6c4b0b9e805 100644
--- a/3rdparty/genie/src/host/scripts.c
+++ b/3rdparty/genie/src/host/scripts.c
@@ -179,16 +179,16 @@ const char* builtin_scripts[] = {
"ative(sln.location, prj.location)), _MAKE.esc(_MAKE.getmakefilename(prj, true)))\n_p('')\nend\n_p('clean:')\nfor _ ,prj in ipairs(sln.projects) do\n_p('\\t@${MAKE} --no-print-directory -C %s -f %s clean', _MAKE.esc(path.getrelative(sln.location, prj.location)), _MAKE.esc(_MAKE.getmakefilename(prj, true)))\nend\n_p('')\n_p('help:')\n_p(1,'@echo \"Usage: make [config=name] [target]\"')\n_p(1,'@echo \"\"')\n_p(1,'@echo \"CONFIGURATIONS:\"')\nlocal cfgpairs = { }\nfor _, platform in ipairs(platforms) do\nfor _, cfgname in ipairs(sln.configurations) do\n_p(1,'@echo \" %s\"', premake.getconfigname(cfgname, platform, true))\nend\nend\n_p(1,'@echo \"\"')\n_p(1,'@echo \"TARGETS:\"')\n_p(1,'@echo \" all (default)\"')\n_p(1,'@echo \" clean\"')\nfor _, prj in ipairs(sln.projects) do\n_p(1,'@echo \" %s\"', prj.name)\nend\n_p(1,'@echo \"\"')\n_p(1,'@echo \"For more information, see http://industriousone.com/premake/quick-start\"')\nend\n",
/* actions/make/make_cpp.lua */
- "premake.make.cpp = { }\nlocal cpp = premake.make.cpp\nlocal make = premake.make\nfunction premake.make_cpp(prj)\nlocal cc = premake.gettool(prj)\nlocal platforms = premake.filterplatforms(prj.solution, cc.platforms, \"Native\")\npremake.gmake_cpp_header(prj, cc, platforms)\nfor _, platform in ipairs(platforms) do\nfor cfg in premake.eachconfig(prj, platform) do\npremake.gmake_cpp_config(cfg, cc)\nend\nend\n_p('OBJECTS := \\\\')\nfor _, file in ipairs(prj.files) do\nif path.iscppfile(file) then\n_p('\\t$(OBJDIR)/%s.o \\\\'\n, _MAKE.esc(path.trimdots(path.removeext(file)))\n)\nend\nend\n_p('')\nlocal objdirs = {}\nfor _, file in ipairs(prj.files) do\nif path.iscppfile(file) then\nobjdirs[_MAKE.esc(path.getdirectory(path.trimdots(file)))] = 1\nend\nend\n_p('OBJDIRS := \\\\')\n_p('\\t$(OBJDIR) \\\\')\nfor dir, _ in pairs(objdirs) do\n_p('\\t$(OBJDIR)/%s \\\\', dir)\nend\n_p('')\n_p('RESOURCES := \\\\')\nfor _, file in ipairs(prj.files) do\nif path.isresourcefile(file) then\n_p('\\t$(OBJDIR)/%s.res \\\\', _MAKE.esc"
- "(path.getbasename(file)))\nend\nend\n_p('')\n_p('.PHONY: clean prebuild prelink')\n_p('')\nif os.is(\"MacOSX\") and prj.kind == \"WindowedApp\" then\n_p('all: $(TARGETDIR) $(OBJDIRS) prebuild prelink $(TARGET) $(dir $(TARGETDIR))PkgInfo $(dir $(TARGETDIR))Info.plist')\nelse\n_p('all: $(TARGETDIR) $(OBJDIRS) prebuild prelink $(TARGET)')\nend\n_p('\\t@:')\n_p('')\nif (prj.kind == \"StaticLib\" and prj.options.ArchiveSplit) then\n_p('define max_args')\n_p('\\t$(eval _args:=)')\n_p('\\t$(foreach obj,$3,$(eval _args+=$(obj))$(if $(word $2,$(_args)),$1$(_args)$(EOL)$(eval _args:=)))')\n_p('\\t$(if $(_args),$1$(_args))')\n_p('endef')\n_p('')\n_p('define EOL')\n_p('')\n_p('')\n_p('endef')\n_p('')\nend\n_p('$(TARGET): $(GCH) $(OBJECTS) $(LDDEPS) $(RESOURCES)')\nif prj.kind == \"StaticLib\" then\nif prj.msgarchiving then\n_p('\\t@echo ' .. prj.msgarchiving)\nelse\n_p('\\t@echo Archiving %s', prj.name)\nend\nif (not prj.archivesplit_size) then \nprj.archivesplit_size=200\nend\nif (not prj.options.ArchiveSplit) then\n_p('"
- "\\t$(SILENT) $(LINKCMD) $(OBJECTS)')\nelse\n_p('\\t@$(call max_args,$(LINKCMD),'.. prj.archivesplit_size ..',$(OBJECTS))')\nend\nelse\nif prj.msglinking then\n_p('\\t@echo ' .. prj.msglinking)\nelse\n_p('\\t@echo Linking %s', prj.name)\nend\n_p('\\t$(SILENT) $(LINKCMD)')\nend\n_p('\\t$(POSTBUILDCMDS)')\n_p('')\n_p('$(TARGETDIR):')\npremake.make_mkdirrule(\"$(TARGETDIR)\")\n_p('$(OBJDIRS):')\nif (not prj.solution.messageskip) or (not table.contains(prj.solution.messageskip, \"SkipCreatingMessage\")) then\n_p('\\t@echo Creating $(OBJDIR)')\nend\n_p('\\t-$(call MKDIR,$(OBJDIR))')\nfor dir, _ in pairs(objdirs) do\n_p('\\t-$(call MKDIR,$(OBJDIR)/%s)', dir)\nend\n_p('')\nif os.is(\"MacOSX\") and prj.kind == \"WindowedApp\" then\n_p('$(dir $(TARGETDIR))PkgInfo:')\n_p('$(dir $(TARGETDIR))Info.plist:')\n_p('')\nend\n_p('clean:')\nif (not prj.solution.messageskip) or (not table.contains(prj.solution.messageskip, \"SkipCleaningMessage\")) then\n_p('\\t@echo Cleaning %s', prj.name)\nend\n_p('ifeq (posix,$(SHELLTYPE))')\n_"
- "p('\\t$(SILENT) rm -f $(TARGET)')\n_p('\\t$(SILENT) rm -rf $(OBJDIR)')\n_p('else')\n_p('\\t$(SILENT) if exist $(subst /,\\\\\\\\,$(TARGET)) del $(subst /,\\\\\\\\,$(TARGET))')\n_p('\\t$(SILENT) if exist $(subst /,\\\\\\\\,$(OBJDIR)) rmdir /s /q $(subst /,\\\\\\\\,$(OBJDIR))')\n_p('endif')\n_p('')\n_p('prebuild:')\n_p('\\t$(PREBUILDCMDS)')\n_p('')\n_p('prelink:')\n_p('\\t$(PRELINKCMDS)')\n_p('')\ncpp.pchrules(prj)\ncpp.fileRules(prj)\n_p('-include $(OBJECTS:%%.o=%%.d)')\n_p('ifneq (,$(PCH))')\n_p(' -include $(OBJDIR)/$(notdir $(PCH)).d')\n_p('endif')\nend\nfunction premake.gmake_cpp_header(prj, cc, platforms)\n_p('# %s project makefile autogenerated by GENie', premake.action.current().shortname)\n_p('ifndef config')\n_p(' config=%s', _MAKE.esc(premake.getconfigname(prj.solution.configurations[1], platforms[1], true)))\n_p('endif')\n_p('')\n_p('ifndef verbose')\n_p(' SILENT = @')\n_p('endif')\n_p('')\n_p('SHELLTYPE := msdos')\n_p('ifeq (,$(ComSpec)$(COMSPEC))')\n_p(' SHELLTYPE := posix')\n_p('endif')\n_p('i"
- "feq (/bin,$(findstring /bin,$(SHELL)))')\n_p(' SHELLTYPE := posix')\n_p('endif')\n_p('')\n_p('ifeq (posix,$(SHELLTYPE))')\n_p(' MKDIR = $(SILENT) mkdir -p \"$(1)\"')\n_p(' COPY = $(SILENT) cp -fR \"$(1)\" \"$(2)\"')\n_p('else')\n_p(' MKDIR = $(SILENT) mkdir \"$(subst /,\\\\\\\\,$(1))\" 2> nul || true')\n_p(' COPY = $(SILENT) copy /Y \"$(subst /,\\\\\\\\,$(1))\" \"$(subst /,\\\\\\\\,$(2))\"')\n_p('endif')\n_p('')\n_p('CC = %s', cc.cc)\n_p('CXX = %s', cc.cxx)\n_p('AR = %s', cc.ar)\n_p('')\n_p('ifndef RESCOMP')\n_p(' ifdef WINDRES')\n_p(' RESCOMP = $(WINDRES)')\n_p(' else')\n_p(' RESCOMP = windres')\n_p(' endif')\n_p('endif')\n_p('')\nend\nfunction premake.gmake_cpp_config(cfg, cc)\n_p('ifeq ($(config),%s)', _MAKE.esc(cfg.shortname))\ncpp.platformtools(cfg, cc)\n_p(' OBJDIR = %s', _MAKE.esc(cfg.objectsdir))\n_p(' TARGETDIR = %s', _MAKE.esc(cfg.buildtarget.directory))\n_p(' TARGET = $(TARGETDIR)/%s', _MAKE.esc(cfg.buildtarget.name))\n_p(' DEFINES +=%s', make.list(cc.getdefines(cfg."
- "defines)))\n_p(' INCLUDES +=%s', make.list(cc.getincludedirs(cfg.includedirs)))\ncpp.pchconfig(cfg)\ncpp.flags(cfg, cc)\ncpp.linker(cfg, cc)\n_p(' define PREBUILDCMDS')\nif #cfg.prebuildcommands > 0 then\n_p('\\t@echo Running pre-build commands')\n_p('\\t%s', table.implode(cfg.prebuildcommands, \"\", \"\", \"\\n\\t\"))\nend\n_p(' endef')\n_p(' define PRELINKCMDS')\nif #cfg.prelinkcommands > 0 then\n_p('\\t@echo Running pre-link commands')\n_p('\\t%s', table.implode(cfg.prelinkcommands, \"\", \"\", \"\\n\\t\"))\nend\n_p(' endef')\n_p(' define POSTBUILDCMDS')\nif #cfg.postbuildcommands > 0 then\n_p('\\t@echo Running post-build commands')\n_p('\\t%s', table.implode(cfg.postbuildcommands, \"\", \"\", \"\\n\\t\"))\nend\n_p(' endef')\nmake.settings(cfg, cc)\n_p('endif')\n_p('')\nend\nfunction cpp.platformtools(cfg, cc)\nlocal platform = cc.platforms[cfg.platform]\nif platform.cc then\n_p(' CC = %s', platform.cc)\nend\nif platform.cxx then\n_p(' CXX = %s', platform.cxx)\nend\nif platform.ar t"
- "hen\n_p(' AR = %s', platform.ar)\nend\nend\nfunction cpp.flags(cfg, cc)\nif cfg.pchheader and not cfg.flags.NoPCH then\n_p(' FORCE_INCLUDE += -include $(OBJDIR)/$(notdir $(PCH))')\nend\nif #cfg.forcedincludes > 0 then\n_p(' FORCE_INCLUDE += -include %s'\n,premake.esc(table.concat(cfg.forcedincludes, \";\")))\nend\n_p(' ALL_CPPFLAGS += $(CPPFLAGS) %s $(DEFINES) $(INCLUDES)', table.concat(cc.getcppflags(cfg), \" \"))\n_p(' ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH)%s', make.list(table.join(cc.getcflags(cfg), cfg.buildoptions)))\n_p(' ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CFLAGS)%s', make.list(table.join(cc.getcxxflags(cfg), cfg.buildoptions_cpp)))\n_p(' ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES)%s',\n make.list(table.join(cc.getdefines(cfg.resdefines),\n cc.getincludedirs(cfg.resincludedirs), cfg.resoptions)))\nend\nfunction cpp.linker(cfg, cc)\n_p(' ALL_LDFLAGS += $(LDFLAGS)%s', make.list(table.join(cc.getlibdirflags(cfg), cc.getldflags(cfg)"
- ", cfg.linkoptions)))\n_p(' LDDEPS +=%s', make.list(_MAKE.esc(premake.getlinks(cfg, \"siblings\", \"fullpath\"))))\n_p(' LIBS += $(LDDEPS)%s', make.list(cc.getlinkflags(cfg)))\nif cfg.kind == \"StaticLib\" then\nif cfg.platform:startswith(\"Universal\") then\n_p(' LINKCMD = libtool -o $(TARGET)')\nelse\nif cc.llvm then\n_p(' LINKCMD = $(AR) rcs $(TARGET)')\nelse\n_p(' LINKCMD = $(AR) -rcs $(TARGET)')\nend\nend\nelse\nlocal tool = iif(cfg.language == \"C\", \"CC\", \"CXX\")\n_p(' LINKCMD = $(%s) -o $(TARGET) $(OBJECTS) $(RESOURCES) $(ARCH) $(ALL_LDFLAGS) $(LIBS)', tool)\nend\nend\nfunction cpp.pchconfig(cfg)\nif not cfg.pchheader or cfg.flags.NoPCH then\nreturn\nend\nlocal pch = cfg.pchheader\nfor _, incdir in ipairs(cfg.includedirs) do\nlocal abspath = path.getabsolute(path.join(cfg.project.location, incdir))\nlocal testname = path.join(abspath, pch)\nif os.isfile(testname) then\npch = path.getrelative(cfg.location, testname)\nbreak\nend\nend\n_p(' PCH = %s', _MAKE.esc(pch))\n_"
- "p(' GCH = $(OBJDIR)/$(notdir $(PCH)).gch')\nend\nfunction cpp.pchrules(prj)\n_p('ifneq (,$(PCH))')\n_p('$(GCH): $(PCH)')\n_p('\\t@echo $(notdir $<)')\nlocal cmd = iif(prj.language == \"C\", \"$(CC) -x c-header $(ALL_CFLAGS)\", \"$(CXX) -x c++-header $(ALL_CXXFLAGS)\")\n_p('\\t$(SILENT) %s -MMD -MP $(DEFINES) $(INCLUDES) -o \"$@\" -MF \"$(@:%%.gch=%%.d)\" -c \"$<\"', cmd)\n_p('endif')\n_p('')\nend\nfunction cpp.fileRules(prj)\nfor _, file in ipairs(prj.files or {}) do\nif path.iscppfile(file) then\n_p('$(OBJDIR)/%s.o: %s'\n, _MAKE.esc(path.trimdots(path.removeext(file)))\n, _MAKE.esc(file)\n)\nif prj.msgcompile then\n_p('\\t@echo ' .. prj.msgcompile)\nelse\n_p('\\t@echo $(notdir $<)')\nend\ncpp.buildcommand(path.iscfile(file) and not prj.options.ForceCPP, \"o\")\n_p('')\nelseif (path.getextension(file) == \".rc\") then\n_p('$(OBJDIR)/%s.res: %s', _MAKE.esc(path.getbasename(file)), _MAKE.esc(file))\nif prj.msgresource then\n_p('\\t@echo ' .. prj.msgresource)\nelse\n_p('\\t@echo $(notdir $<)')\nend\n_p('"
- "\\t$(SILENT) $(RESCOMP) $< -O coff -o \"$@\" $(ALL_RESFLAGS)')\n_p('')\nend\nend\nend\nfunction cpp.buildcommand(iscfile, objext)\nlocal flags = iif(iscfile, '$(CC) $(ALL_CFLAGS)', '$(CXX) $(ALL_CXXFLAGS)')\n_p('\\t$(SILENT) %s $(FORCE_INCLUDE) -o \"$@\" -MF $(@:%%.%s=%%.d) -c \"$<\"', flags, objext)\nend\n",
+ "premake.make.cpp = { }\nlocal cpp = premake.make.cpp\nlocal make = premake.make\nfunction premake.make_cpp(prj)\nlocal cc = premake.gettool(prj)\nlocal platforms = premake.filterplatforms(prj.solution, cc.platforms, \"Native\")\npremake.gmake_cpp_header(prj, cc, platforms)\nfor _, platform in ipairs(platforms) do\nfor cfg in premake.eachconfig(prj, platform) do\npremake.gmake_cpp_config(prj, cfg, cc)\nend\nend\nlocal objdirs = {}\nfor _, file in ipairs(prj.files) do\nif path.iscppfile(file) then\nobjdirs[_MAKE.esc(path.getdirectory(path.trimdots(file)))] = 1\nend\nend\n_p('OBJDIRS := \\\\')\n_p('\\t$(OBJDIR) \\\\')\nfor dir, _ in pairs(objdirs) do\n_p('\\t$(OBJDIR)/%s \\\\', dir)\nend\n_p('')\n_p('RESOURCES := \\\\')\nfor _, file in ipairs(prj.files) do\nif path.isresourcefile(file) then\n_p('\\t$(OBJDIR)/%s.res \\\\', _MAKE.esc(path.getbasename(file)))\nend\nend\n_p('')\n_p('.PHONY: clean prebuild prelink')\n_p('')\nif os.is(\"MacOSX\") and prj.kind == \"WindowedApp\" then\n_p('all: $(TARGETDIR) $(OBJDIRS) pr"
+ "ebuild prelink $(TARGET) $(dir $(TARGETDIR))PkgInfo $(dir $(TARGETDIR))Info.plist')\nelse\n_p('all: $(TARGETDIR) $(OBJDIRS) prebuild prelink $(TARGET)')\nend\n_p('\\t@:')\n_p('')\nif (prj.kind == \"StaticLib\" and prj.options.ArchiveSplit) then\n_p('define max_args')\n_p('\\t$(eval _args:=)')\n_p('\\t$(foreach obj,$3,$(eval _args+=$(obj))$(if $(word $2,$(_args)),$1$(_args)$(EOL)$(eval _args:=)))')\n_p('\\t$(if $(_args),$1$(_args))')\n_p('endef')\n_p('')\n_p('define EOL')\n_p('')\n_p('')\n_p('endef')\n_p('')\nend\n_p('$(TARGET): $(GCH) $(OBJECTS) $(LDDEPS) $(RESOURCES)')\nif prj.kind == \"StaticLib\" then\nif prj.msgarchiving then\n_p('\\t@echo ' .. prj.msgarchiving)\nelse\n_p('\\t@echo Archiving %s', prj.name)\nend\nif (not prj.archivesplit_size) then \nprj.archivesplit_size=200\nend\nif (not prj.options.ArchiveSplit) then\n_p('\\t$(SILENT) $(LINKCMD) $(OBJECTS)')\nelse\n_p('\\t@$(call max_args,$(LINKCMD),'.. prj.archivesplit_size ..',$(OBJECTS))')\nend\nelse\nif prj.msglinking then\n_p('\\t@echo ' .. prj.msgl"
+ "inking)\nelse\n_p('\\t@echo Linking %s', prj.name)\nend\n_p('\\t$(SILENT) $(LINKCMD)')\nend\n_p('\\t$(POSTBUILDCMDS)')\n_p('')\n_p('$(TARGETDIR):')\npremake.make_mkdirrule(\"$(TARGETDIR)\")\n_p('$(OBJDIRS):')\nif (not prj.solution.messageskip) or (not table.contains(prj.solution.messageskip, \"SkipCreatingMessage\")) then\n_p('\\t@echo Creating $(OBJDIR)')\nend\n_p('\\t-$(call MKDIR,$(OBJDIR))')\nfor dir, _ in pairs(objdirs) do\n_p('\\t-$(call MKDIR,$(OBJDIR)/%s)', dir)\nend\n_p('')\nif os.is(\"MacOSX\") and prj.kind == \"WindowedApp\" then\n_p('$(dir $(TARGETDIR))PkgInfo:')\n_p('$(dir $(TARGETDIR))Info.plist:')\n_p('')\nend\n_p('clean:')\nif (not prj.solution.messageskip) or (not table.contains(prj.solution.messageskip, \"SkipCleaningMessage\")) then\n_p('\\t@echo Cleaning %s', prj.name)\nend\n_p('ifeq (posix,$(SHELLTYPE))')\n_p('\\t$(SILENT) rm -f $(TARGET)')\n_p('\\t$(SILENT) rm -rf $(OBJDIR)')\n_p('else')\n_p('\\t$(SILENT) if exist $(subst /,\\\\\\\\,$(TARGET)) del $(subst /,\\\\\\\\,$(TARGET))')\n_p('\\t"
+ "$(SILENT) if exist $(subst /,\\\\\\\\,$(OBJDIR)) rmdir /s /q $(subst /,\\\\\\\\,$(OBJDIR))')\n_p('endif')\n_p('')\n_p('prebuild:')\n_p('\\t$(PREBUILDCMDS)')\n_p('')\n_p('prelink:')\n_p('\\t$(PRELINKCMDS)')\n_p('')\ncpp.pchrules(prj)\ncpp.fileRules(prj)\n_p('-include $(OBJECTS:%%.o=%%.d)')\n_p('ifneq (,$(PCH))')\n_p(' -include $(OBJDIR)/$(notdir $(PCH)).d')\n_p('endif')\nend\nfunction premake.gmake_cpp_header(prj, cc, platforms)\n_p('# %s project makefile autogenerated by GENie', premake.action.current().shortname)\n_p('ifndef config')\n_p(' config=%s', _MAKE.esc(premake.getconfigname(prj.solution.configurations[1], platforms[1], true)))\n_p('endif')\n_p('')\n_p('ifndef verbose')\n_p(' SILENT = @')\n_p('endif')\n_p('')\n_p('SHELLTYPE := msdos')\n_p('ifeq (,$(ComSpec)$(COMSPEC))')\n_p(' SHELLTYPE := posix')\n_p('endif')\n_p('ifeq (/bin,$(findstring /bin,$(SHELL)))')\n_p(' SHELLTYPE := posix')\n_p('endif')\n_p('')\n_p('ifeq (posix,$(SHELLTYPE))')\n_p(' MKDIR = $(SILENT) mkdir -p \"$(1)\"')\n_p(' COPY = $("
+ "SILENT) cp -fR \"$(1)\" \"$(2)\"')\n_p('else')\n_p(' MKDIR = $(SILENT) mkdir \"$(subst /,\\\\\\\\,$(1))\" 2> nul || true')\n_p(' COPY = $(SILENT) copy /Y \"$(subst /,\\\\\\\\,$(1))\" \"$(subst /,\\\\\\\\,$(2))\"')\n_p('endif')\n_p('')\n_p('CC = %s', cc.cc)\n_p('CXX = %s', cc.cxx)\n_p('AR = %s', cc.ar)\n_p('')\n_p('ifndef RESCOMP')\n_p(' ifdef WINDRES')\n_p(' RESCOMP = $(WINDRES)')\n_p(' else')\n_p(' RESCOMP = windres')\n_p(' endif')\n_p('endif')\n_p('')\nend\nfunction premake.gmake_cpp_config(prj, cfg, cc)\n_p('ifeq ($(config),%s)', _MAKE.esc(cfg.shortname))\ncpp.platformtools(cfg, cc)\n_p(' OBJDIR = %s', _MAKE.esc(cfg.objectsdir))\n_p(' TARGETDIR = %s', _MAKE.esc(cfg.buildtarget.directory))\n_p(' TARGET = $(TARGETDIR)/%s', _MAKE.esc(cfg.buildtarget.name))\n_p(' DEFINES +=%s', make.list(cc.getdefines(cfg.defines)))\n_p(' INCLUDES +=%s', make.list(cc.getincludedirs(cfg.includedirs)))\ncpp.pchconfig(cfg)\ncpp.flags(cfg, cc)\ncpp.linker(cfg, cc)\n_p(' OBJECTS := \\\\')\nfor _, file"
+ " in ipairs(prj.files) do\nif path.iscppfile(file) then\nlocal excluded = false\nfor _, exclude in ipairs(cfg.excludes) do\nexcluded = (exclude == file)\nif (excluded) then break end\nend\nif excluded == false then\n_p('\\t$(OBJDIR)/%s.o \\\\'\n, _MAKE.esc(path.trimdots(path.removeext(file)))\n)\nend\nend\nend\n_p('')\n_p(' define PREBUILDCMDS')\nif #cfg.prebuildcommands > 0 then\n_p('\\t@echo Running pre-build commands')\n_p('\\t%s', table.implode(cfg.prebuildcommands, \"\", \"\", \"\\n\\t\"))\nend\n_p(' endef')\n_p(' define PRELINKCMDS')\nif #cfg.prelinkcommands > 0 then\n_p('\\t@echo Running pre-link commands')\n_p('\\t%s', table.implode(cfg.prelinkcommands, \"\", \"\", \"\\n\\t\"))\nend\n_p(' endef')\n_p(' define POSTBUILDCMDS')\nif #cfg.postbuildcommands > 0 then\n_p('\\t@echo Running post-build commands')\n_p('\\t%s', table.implode(cfg.postbuildcommands, \"\", \"\", \"\\n\\t\"))\nend\n_p(' endef')\nmake.settings(cfg, cc)\n_p('endif')\n_p('')\nend\nfunction cpp.platformtools(cfg, cc)\nlocal platform "
+ "= cc.platforms[cfg.platform]\nif platform.cc then\n_p(' CC = %s', platform.cc)\nend\nif platform.cxx then\n_p(' CXX = %s', platform.cxx)\nend\nif platform.ar then\n_p(' AR = %s', platform.ar)\nend\nend\nfunction cpp.flags(cfg, cc)\nif cfg.pchheader and not cfg.flags.NoPCH then\n_p(' FORCE_INCLUDE += -include $(OBJDIR)/$(notdir $(PCH))')\nend\nif #cfg.forcedincludes > 0 then\n_p(' FORCE_INCLUDE += -include %s'\n,premake.esc(table.concat(cfg.forcedincludes, \";\")))\nend\n_p(' ALL_CPPFLAGS += $(CPPFLAGS) %s $(DEFINES) $(INCLUDES)', table.concat(cc.getcppflags(cfg), \" \"))\n_p(' ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH)%s', make.list(table.join(cc.getcflags(cfg), cfg.buildoptions)))\n_p(' ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CFLAGS)%s', make.list(table.join(cc.getcxxflags(cfg), cfg.buildoptions_cpp)))\n_p(' ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES)%s',\n make.list(table.join(cc.getdefines(cfg.resdefines),\n cc.getincludedirs("
+ "cfg.resincludedirs), cfg.resoptions)))\nend\nfunction cpp.linker(cfg, cc)\n_p(' ALL_LDFLAGS += $(LDFLAGS)%s', make.list(table.join(cc.getlibdirflags(cfg), cc.getldflags(cfg), cfg.linkoptions)))\n_p(' LDDEPS +=%s', make.list(_MAKE.esc(premake.getlinks(cfg, \"siblings\", \"fullpath\"))))\n_p(' LIBS += $(LDDEPS)%s', make.list(cc.getlinkflags(cfg)))\nif cfg.kind == \"StaticLib\" then\nif cfg.platform:startswith(\"Universal\") then\n_p(' LINKCMD = libtool -o $(TARGET)')\nelse\nif cc.llvm then\n_p(' LINKCMD = $(AR) rcs $(TARGET)')\nelse\n_p(' LINKCMD = $(AR) -rcs $(TARGET)')\nend\nend\nelse\nlocal tool = iif(cfg.language == \"C\", \"CC\", \"CXX\")\n_p(' LINKCMD = $(%s) -o $(TARGET) $(OBJECTS) $(RESOURCES) $(ARCH) $(ALL_LDFLAGS) $(LIBS)', tool)\nend\nend\nfunction cpp.pchconfig(cfg)\nif not cfg.pchheader or cfg.flags.NoPCH then\nreturn\nend\nlocal pch = cfg.pchheader\nfor _, incdir in ipairs(cfg.includedirs) do\nlocal abspath = path.getabsolute(path.join(cfg.project.location, incdir))\nlo"
+ "cal testname = path.join(abspath, pch)\nif os.isfile(testname) then\npch = path.getrelative(cfg.location, testname)\nbreak\nend\nend\n_p(' PCH = %s', _MAKE.esc(pch))\n_p(' GCH = $(OBJDIR)/$(notdir $(PCH)).gch')\nend\nfunction cpp.pchrules(prj)\n_p('ifneq (,$(PCH))')\n_p('$(GCH): $(PCH)')\n_p('\\t@echo $(notdir $<)')\nlocal cmd = iif(prj.language == \"C\", \"$(CC) -x c-header $(ALL_CFLAGS)\", \"$(CXX) -x c++-header $(ALL_CXXFLAGS)\")\n_p('\\t$(SILENT) %s -MMD -MP $(DEFINES) $(INCLUDES) -o \"$@\" -MF \"$(@:%%.gch=%%.d)\" -c \"$<\"', cmd)\n_p('endif')\n_p('')\nend\nfunction cpp.fileRules(prj)\nfor _, file in ipairs(prj.files or {}) do\nif path.iscppfile(file) then\n_p('$(OBJDIR)/%s.o: %s'\n, _MAKE.esc(path.trimdots(path.removeext(file)))\n, _MAKE.esc(file)\n)\nif prj.msgcompile then\n_p('\\t@echo ' .. prj.msgcompile)\nelse\n_p('\\t@echo $(notdir $<)')\nend\ncpp.buildcommand(path.iscfile(file) and not prj.options.ForceCPP, \"o\")\n_p('')\nelseif (path.getextension(file) == \".rc\") then\n_p('$(OBJD"
+ "IR)/%s.res: %s', _MAKE.esc(path.getbasename(file)), _MAKE.esc(file))\nif prj.msgresource then\n_p('\\t@echo ' .. prj.msgresource)\nelse\n_p('\\t@echo $(notdir $<)')\nend\n_p('\\t$(SILENT) $(RESCOMP) $< -O coff -o \"$@\" $(ALL_RESFLAGS)')\n_p('')\nend\nend\nend\nfunction cpp.buildcommand(iscfile, objext)\nlocal flags = iif(iscfile, '$(CC) $(ALL_CFLAGS)', '$(CXX) $(ALL_CXXFLAGS)')\n_p('\\t$(SILENT) %s $(FORCE_INCLUDE) -o \"$@\" -MF $(@:%%.%s=%%.d) -c \"$<\"', flags, objext)\nend\n",
/* actions/make/make_csharp.lua */
"local function getresourcefilename(cfg, fname)\nif path.getextension(fname) == \".resx\" then\n local name = cfg.buildtarget.basename .. \".\"\n local dir = path.getdirectory(fname)\n if dir ~= \".\" then \nname = name .. path.translate(dir, \".\") .. \".\"\nend\nreturn \"$(OBJDIR)/\" .. _MAKE.esc(name .. path.getbasename(fname)) .. \".resources\"\nelse\nreturn fname\nend\nend\nfunction premake.make_csharp(prj)\nlocal csc = premake.dotnet\nlocal cfglibs = { }\nlocal cfgpairs = { }\nlocal anycfg\nfor cfg in premake.eachconfig(prj) do\nanycfg = cfg\ncfglibs[cfg] = premake.getlinks(cfg, \"siblings\", \"fullpath\")\ncfgpairs[cfg] = { }\nfor _, fname in ipairs(cfglibs[cfg]) do\nif path.getdirectory(fname) ~= cfg.buildtarget.directory then\ncfgpairs[cfg][\"$(TARGETDIR)/\" .. _MAKE.esc(path.getname(fname))] = _MAKE.esc(fname)\nend\nend\nend\nlocal sources = {}\nlocal embedded = { }\nlocal copypairs = { }\nfor fcfg in premake.project.eachfile(prj) do\nlocal action = csc.getbuildaction(fcfg)\nif action == \"Co"